Pass 1: (build external symbol table)
BEGIN
initialize Scnt to 0
get Memaddr from operating system
set CSaddr to Memaddr /* control section address */
WHILE not end of input
BEGIN
read input Record /* header record */
increment Scnt and set Sourceline[Scnt] to Record
set CSname to csect name
set CSlngth to csect length
Xsearch EStable for CSname
IF found THEN
set error flag /* duplicate external symbol */
ELSE
insert (CSname,CSaddr) into EStable
ENDIF
WHILE Record[0] <> 'E'
BEGIN
read next input Record
increment Scnt and set Sourceline[Scnt] to Record
IF Record[0] = 'D' THEN
FOR EACH Symbol in Record
BEGIN
Xsearch EStable for Symbol
IF found THEN
set error flag /* duplicate external symbol */
ELSE
insert (Symbol,CSaddr+symbol address) into EStable
ENDIF
END {for}
ENDIF
END {while}
CSaddr <-- CSaddr + CSlngth /* starting address for next csect */
END (while}
set Endcnt to Scnt
END {of Pass 1}
|