.H XREF Copyright (c), 1993, Gary D. Campbell NAME =XREF $$$$ CODE=0100 >XREF [dr:][.ext] CREATES: $$$$ DATA=0900 DEFAULTS: dr = C, ext = AUX .XRF 0900 STACK (256) 0A00 SORTED (1) 0A01 LINE.CNT (1) 0A02 TOP.RB (2) 0A04 AFTER.RB (2) 0A06 MODULES (2) @ MODULE NAMES 0A08 LAST.REF (2) HIGH CODE REF 0A0A ABORT.ADR (2) 0A0C TOPLIST (2) 0A0E SWAPBUFR (16) 0A1E KEY (2) 0A20 EOD (0) 0080 UNDEF=080 00F0 FB.ENTRY=0F0 000F MASK=0F SKIP NIBBLE 000D CR=0D 000A LF=0A 0000 ZBASE=XREF-0100 0005 CPM=ZBASE+5 0100 XREF ENTRY 0100* HL=0 0102 SP=STACK+256 0105 PUSH HL 0106 CALL INPUT 0109 CALL PACK 010C PUSH BC # ENTRIES TO SORT 010D HL=M0 0110 CALL DSPLY 0113 POP BC 0114 HL=@EOD 0117 CALL XSORT 011A HL=%AFTER.RB 011E* HL=HL-4 BOTTOM OF RB 0121 DE=HL 0123 HL=%TOP.RB 0127 CALL QSORT 012A CALL OUTPUT 012D HL=M2 0130 DO CALL DSPLY 0133 GOTO ZBASE 0136 ABORT DE=M3 0139 ERROR POP HL 013A %ABORT.ADR=HL 013E SWAP HL,DE 0140 LOOP 0142 X.CHAR: =".","Copyright" 014C M0: ="(c)1993,G.D.Campbell",0 0161 M1: ="NO FILE",0 0169 M2: =2,@05C,3,@05C," CREATED O.K.",0 017D M3: ="ABORT: ",6,@ABORT.ADR," IN ",3,@05C,0 018F M4: ="MEMORY OVFL",0 019B M5: ="DIRECTORY OVFL",0 01AA M6: ="DISK OVFL",0 01B4 TITLE:=".H",9,9,"CROSS REFERENCE LISTING FOR ",0 .P 01D5 J.TBL:=RTN,SUB,LET,NAM,DEC,HEX,ADR 01E3 DSPLY ENTRY 01E3 A=$HL 01E5* A:0 01E7 IF EQ,RTN 01EA BC=@DSPLY 01ED PUSH BC 01EE PUSH HL 01EF* A:7 01F1 IF GE,CALL DSP.A 01F6 D=0 01F8 E=A 01FA HL=@J.TBL 01FD* HL=HL+DE 01FF E=$HL 0201 HL=@CASE 0204* HL=HL+DE 0206 POP DI 0207 PUSH HL 0208 HL=DI 020A+CASE HL=HL+1 020B RTN RETURN 020C SUB E=$HL 020E+ HL=HL+1 020F D=$HL 0211+ HL=HL+1 0212 PUSH HL 0213 SWAP HL,DE 0215 CALL DSPLY 0218 POP HL 0219 RETURN 021A LET E=$HL 021C+ HL=HL+1 021D D=$HL 021F+ HL=HL+1 0220 SI=DE 0222 A=$SI+ 0223 PUSH HL 0224* A=A+"@" 0226 CALL DSP.A 0229 E=":" 022B CALL DPE 022E POP HL 022F RETURN 0230 HEX E=$HL 0232+ HL=HL+1 0233 D=$HL 0235+ HL=HL+1 0236 PUSH HL 0237 HEX.2 CALL DSP.HEX 023A POP HL 023B RETURN 023C ADR E=$HL 023E+ HL=HL+1 023F D=$HL 0241+ HL=HL+1 0242 PUSH HL 0243 PUSH DE 0244+ DE=DE+1 0245 CALL DSP.HEX 0248 POP DE 0249 GOTO HEX.2 .P 024B DEC E=$HL 024D+ HL=HL+1 024E D=$HL 0250+ HL=HL+1 0251 PUSH HL 0252 SI=DE 0254 A=$SI+ 0255 CALL DSP.DEC 0258 POP HL 0259 RETURN 025A DSP.DEC PUSH AF 025C. RR A,4 025F* A=A AND 0F 0261 IF NZ,CALL DSP.D1 0266* POP AF 0268* A=A AND 0F 026A*DSP.D1 A=A OR 030 026C GOTO DSP.A 026E DSP.HEX SI=DE 0270 A=$SI+ 0271 PUSH AF 0273. RR A,4 0276 CALL DSP.NIB 0279* POP AF 027B*DSP.NIB A=A AND 0F 027D* A=A+090 027F* DAA 0280* A=A+CY+040 0282* DAA 0283 DSP.A E=A 0285 DPE C=2 0287 CALL CPM 028A* AF=0 028C RETURN 028D NAM E=$HL 028F+ HL=HL+1 0290 D=$HL 0292+ HL=HL+1 0293 PUSH HL 0294 C=8 0296 CALL EMIT.C 0299 PUSH DE 029A E="." 029C CALL DPE 029F POP DE 02A0 C=3 02A2 CALL EMIT.C 02A5 POP HL 02A6 RETURN 02A7+EMIT.C DO DE=DE+1 02A8 SI=DE 02AA A=$SI+ 02AB PUSH DE 02AC PUSH BC 02AD* A:" " 02AF IF NE,CALL DSP.A 02B4 POP BC 02B5 POP DE 02B6+ C=C-1 02B8 LOOP UNTIL ZR 02BA RETURN .P 02C0 :INPUT -------------------------------------------------------- 02C0 : OPEN THE .AUX FILE AND COPY INTO MEMORY, CHECKING FOR OVERFLOW 02C0 :-------------------------------------------------------------- 02BB INPUT HL=05C 02BE A=$HL 02C0* A:0 02C2 IF EQ, 02C4 $HL=3 DEFAULT=C: 02C7 A=$065 02CA* A:" " 02CC IF EQ, 02CE A="A" 02D0 L="U" 02D2 H="X" 02D4 $065=A 02D7 %066=HL 02DB CALL F.OPEN 02DE HL=EOD+4 02E1 DO PUSH HL 02E2 SWAP HL,DE 02E4 C=26 02E6 CALL CPM SET DMA 02E9 C=20 02EB CALL CPM.05C READ SEQ 02EE POP HL 02EF* A:0 02F1 IF NE, RTN EOF 02F4 BC=128 02F7* HL=HL+BC 02F9 A=$ZBASE+7 PAGES AVAIL 02FC* A:H 02FE LOOP WHILE NE 0300 OVFL DE=M4 0303 GOTO ERROR 0306 F.OPEN A=0 0308 C=24 030A DE=@068 030D DO DI=DE 030F $DI+=A 0310+ DE=DE+1 0311+ C=C-1 0313 LOOP UNTIL ZR 0315 C=15 0317 CALL CPM.05C 031A+ A=A+1 031C DE=M1 031F IF ZR,CALL ERROR 0324 RETURN 0325 SKIP PUSH BC 0326 A=$HL 0328* A=A AND 0F SKIP 032A C=A 032C B=0 032E* HL=HL+BC 0330 POP BC 0331 RETURN .P 0337 :PACK--------------------------------------------------- 0337 : ==> HL-->LOWEST AVAILABLE BYTE (RECORD) 0337 : <== BC = # OF ENTRIES IN SYMBOL TABLE 0337 : $TOB.RB = @ OF 1ST RECORD IN REFERENCE BLOCK 0337 : $AFTER.RB = @ AFTER LAST BYTE OF REFERENCE BLOCK 0337 : $MODULES = @ OF MODULE-NAME ENTRIES (FB-ENTRIES) 0337 : $LAST.REF = LAST, & THUS HIGHEST CODE REFERENCE 0337 : 0337 : MOVES THE INPUT STREAM DOWN IN MEMORY, SKIPING ANY 0337 : UNWANTED ELEMENT TYPES AND COUNTING THE # OF VALID 0337 : ITEMS IN THE SYMBOL TABLE. THE RECORD DEFINITION LIST 0337 : IS ALLIGNED ON @(MULT OF 4) AND EVERYTHING IS CHECKED 0337 : FOR VALID FORMAT. OVERFLOWS & OTHER PROBLEMS ARE ABORTED. 0337 :-------------------------------------------------------- 0332 PACK %MODULES=HL 0336 %TOPLIST=HL 033A $HL=0 END OF LIST 033D* HL=0 033F %LAST.REF=HL 0343 DE=@EOD 0346 HL=EOD+4 0349 CALL PACK.SYM (BUMPS LAST.REF TO LAST MODULE) 034C PUSH BC # OF ENTRIES 034D* HL=HL+3 0350 A=L 0352* A=A AND 0FC MULT OF 4 0354 L=A 0356 %TOP.RB=HL 035A DO A=$ZBASE+7 035D* A:D 035F IF EQ,CALL OVFL 0364 C=4 0366. CY=1 0367 DO SI=DE 0369 A=$SI+ 036A $HL=A 036C IF CY, 036E* A=A-01 0370+ HL=HL+1 0371+ DE=DE+1 0372+ C=C-1 0374 LOOP UNTIL ZR 0376 LOOP WHILE NC CY==>ALL ZEROS 0378* HL=HL-4 037B %AFTER.RB=HL 037F* HL=HL-3 0382 D=$HL 0384+ HL=HL-1 0385 E=$HL 0387+ DE=DE+2 0389 HL=%LAST.REF 038D CALL DE.HL 0390 IF GE, 0392 SWAP HL,DE 0394 %LAST.REF=HL 0398 POP BC # OF ENTRIES 0399 RETURN .P 03A0 :EXCHANGE SORT------------------------------------------- 03A0 : ==> HL-->TOP OF SYMBOL TABLE, BC = # ENTRIES 03A0 : <== HL-->TOP OF SORTED SYMBOL TABLE 03A0 :-------------------------------------------------------- 039A XSORT %TOPLIST=HL 039E+ DO BC=BC-1 039F A=B 03A1* A=A OR C 03A3 * IF ZR,EXIT 03A5 PUSH BC OUTER LOOP 03A6 $SORTED=A NZ = SORTED 03A9 DO PUSH BC INNER LOOP 03AA DE=HL JTH ELEM 03AC A=$HL 03AE* A=A AND MASK SKIP 03B0 B=0 03B2 C=A 03B4* HL=HL+BC J+1TH ELEM 03B6 A=$HL 03B8* A=A AND MASK LEN OF J+1 03BA* A:C 03BC PUSH AF WHICH IS LONG 03BE IF LT, 03C0 C=A SHORTER 03C2 PUSH DE 03C3 PUSH HL 03C4* DE=DE+3 03C7* HL=HL+3 03CA* BC=BC-3 03CD SWAP HL,DE 03CF DO SI=DE 03D1 A=$SI+ 03D2* A:$HL 03D4 * IF NE,EXIT 03D6+ DE=DE+1 03D7+ HL=HL+1 03D8+ C=C-1 03DA LOOP WHILE NZ 03DC POP HL 03DD POP DE 03DE IF ZR, RECALL LONGER 03E0* POP AF 03E2 PUSH AF 03E4 IF LT, 03E6 CALL SWITCH 03E9 A=0 03EB $SORTED=A 03EE* POP AF 03F0 POP BC 03F1+ BC=BC-1 03F2 A=B 03F4* A=A OR C 03F6 LOOP UNTIL ZR 03F8 HL=%TOPLIST 03FC POP BC 03FD A=$SORTED 0400* A:0 0402 LOOP UNTIL NZ 0404 RETURN .P 0405*PACK.SYM BC=0 0407 DO PUSH BC 0408 DO A=~MASK 040A* A=A AND $HL TYPE 040C* A:UNDEF 040E IF EQ, 0410 CALL SKIP 0413 * LOOP 0415* A:FB.ENTRY 0417 * IF NE,EXIT 0419 CALL MOD.NAM 041C LOOP 041E A=$HL 0420* A=A AND MASK SKIP 0422 * IF ZR,EXIT 0424 B=A 0426* A:4 SKIP >= 4 0428 IF LT, CALL ABORT 042D DO A=$HL 042F DI=DE 0431 $DI+=A 0432+ HL=HL+1 0433+ DE=DE+1 0434+ B=B-1 0436 LOOP UNTIL ZR 0438 POP BC 0439+ BC=BC+1 043A LOOP 043C DI=DE 043E $DI+=A 043F+ HL=HL+1 0440+ DE=DE+1 0441 POP BC 0442 SWAP HL,DE 0444 RETURN 0445 SWITCH PUSH BC 0446 PUSH HL 0447 PUSH DE 0448 A=$HL 044A* A=A AND MASK 044C C=A LEN OF J+1TH 044E HL=@SWAPBUFR 0451 CALL XFER 0454 POP DE 0455 POP HL 0456 PUSH DE 0457 SWAP HL,DE 0459 CALL XFER 045C POP DE 045D HL=DE 045F B=0 0461* HL=HL+BC 0463 PUSH HL 0464 PUSH DE 0465 DE=@SWAPBUFR 0468 CALL XFER 046B POP DE 046C POP HL 046D POP BC 046E RETURN .P 0475 :QUICKSORT------------------------------------------ 0475 : ==> HL-->TOP OF LIST (ADDR MUST BE MULT OF 4) 0475 : DE-->BOT OF LIST 0475 : <== HL-->TOP OF SORTED LIST 0475 : 0475 : LIST CONSISTS OF 4-BYTE RECORDS WITH THE MSB HIGH 0475 :--------------------------------------------------- 046F QSORT CALL DE.HL 0472 IF EQ,RTN 1 ELEM LIST 0475 PUSH HL TOP OF LIST 0476 PUSH DE BOTTOM 0477 DO PUSH AF DE:HL 0479 CALL COMPARE 047C IF LT, 047E* POP AF 0480 IF GE,CALL SWAP 0485* HL=HL-4 NEXT ELEM 0488 * EXIT 048A* ELSE POP AF 048C IF LT,CALL SWAP 0491* HL=HL+4 NEXT ELEM 0494 CALL DE.HL 0497 LOOP WHILE NE 0499 POP DE 049A CALL DE.HL 049D IF NE, BOT 1/2 TO SORT 049F PUSH HL MIDDLE 04A0* HL=HL+4 04A3 CALL QSORT 04A6 POP HL 04A7 DE=HL MIDDLE 04A9 POP HL TOP 04AA CALL DE.HL 04AD IF NE, TOP 1/2 TO SORT 04AF* DE=DE-4 04B2 CALL QSORT 04B5 RETURN 04B6 DE.HL A=D 04B8* A:H 04BA IF EQ, 04BC A=E 04BE* A:L 04C0 RETURN 04C1 SWAP PUSH HL 04C2 PUSH DE 04C3 C=4 04C5 DO B=$HL 04C7 SI=DE 04C9 A=$SI+ 04CA SWAP HL,DE 04CC $HL=B 04CE DI=DE 04D0 $DI+=A 04D1+ HL=HL+1 04D2+ DE=DE+1 04D3+ C=C-1 04D5 LOOP UNTIL ZR 04D7 POP DE 04D8 POP HL 04D9 SWAP HL,DE 04DB RETURN .P 04E6 :BINARY SEARCH----------------------------------------- 04E6 : ==> BC-->TOP OF LIST (=MULT OF 4) 04E6 : DE-->AFTER LAST ELEMENT IN LIST 04E6 : HL-->WORD TO FIND 04E6 : <== HL-->1ST MATCH (LOWEST ADDR) 04E6 : C = # OF MATCHES 04E6 : 04E6 : LIST CONSISTS OF ADJACENT 4-BYTE RECORDS WHERE THE 2ND 04E6 : WORD (3RD & 4TH BYTES) IS TO BE MATCHED WITH $HL 04E6 :------------------------------------------------------ 04DC BSEARCH A=$HL 04DE $KEY=A 04E1+ HL=HL+1 04E2 A=$HL 04E4 $KEY+1=A 04E7 DO A=C HL=1/2(BC+DE) 04E9* A=A+E 04EB L=A 04ED A=B 04EF* A=A+CY+D 04F1. RR` A 04F3 H=A 04F5 A=L 04F7. RR` A 04F9* A=A AND 0FC MULT OF 4 04FB L=A 04FD CALL BCOMP 0500 * IF EQ,EXIT FOUND 0502 PUSH AF 0504 A=L 0506* A:C 0508 IF EQ, 050A A=H 050C* A:B 050E IF EQ, NO MORE 0510* POP AF 0512 C=0 0514 RETURN 0515* POP AF 0517 IF LT, LOOK IN TOP 1/2 0519 D=H 051B E=L 051D * EXIT 051F ELSE B=H LOOK IN BOT 1/2 0521 C=L 0523* BC=BC+4 NOT THIS ONE 0526 LOOP 0528 GOTO N.REFS 052A BCOMP PUSH HL 052B* HL=HL+3 MSB 052E A=$KEY+1 0531* A:$HL 0533 IF EQ, 0535+ HL=HL-1 LSB 0536 A=$KEY 0539* A:$HL 053B POP HL 053C RETURN .P 053D XFER: SI=DE 053F A=$SI+ 0540* A=A AND MASK 0542 B=A 0544 COPY DO SI=DE 0546 A=$SI+ 0547 $HL=A 0549+ HL=HL+1 054A+ DE=DE+1 054B+ B=B-1 054D LOOP WHILE NZ 054F RETURN 0550 COMPARE PUSH HL 0551 PUSH DE 0552* HL=HL+3 0555* DE=DE+3 0558 C=4 055A DO SI=DE 055C A=$SI+ 055D* A:$HL 055F * IF NE,EXIT 0561+ DE=DE-1 0562+ HL=HL-1 0563+ C=C-1 0565 LOOP UNTIL ZR 0567 POP DE 0568 POP HL 0569 RETURN 056A N.REFS C=1 COUNT # FOUND 056C PUSH HL 056D* DO HL=HL+4 0570 CALL BCOMP 0573 * IF NE,EXIT 0575+ C=C+1 0577 LOOP 0579 POP HL 057A* DO HL=HL-4 057D CALL BCOMP 0580 * IF NE,EXIT 0582+ C=C+1 0584 LOOP 0586* HL=HL+4 0589 RETURN 058A MOD.NAM PUSH DE 058B DE=HL 058D HL=%TOPLIST 0591 B=2 0593 CALL COPY 0596 $LAST.REF=A 0599 B=1 059B CALL COPY 059E $LAST.REF+1=A 05A1 B=8 05A3 CALL COPY 05A6 $HL=0 MARK EOL 05A9 %TOPLIST=HL 05AD HL=DE 05AF POP DE 05B0 RETURN .P 05B1 OUTPUT A="X" FOR EACH ELEMENT IN THE SYMBOL TABLE, 05B3 L="R" (BSEARCH) THE RECORD BLKS FOR A REF. 05B5 H="F" IF FOUND, EMIT SYMBOL NAME, DEF, AND 05B7 $065=A ALL REF ADDRESSES. 05BA %066=HL THE OUT.XXXX ROUTINES EMIT BUFFERED 05BE A=0 OUTPUT USING "DE" (WHICH MUST BE 05C0 C=24 PRESERVED BY ALL OTHER ROUTINES). 05C2 DE=@068 05C5 DO DI=DE 05C7 $DI+=A 05C8+ DE=DE+1 05C9+ C=C-1 05CB LOOP UNTIL ZR 05CD $LINE.CNT=A 05D0 C=19 DELETE 05D2 CALL CPM.05C 05D5 C=22 MAKE FILE 05D7 CALL CPM.05C 05DA+ A=A+1 05DC DE=M5 05DF IF ZR,CALL ERROR 05E4 DE=080 05E7 C=26 SET DMA 05E9 CALL CPM 05EC DE=080 05EF CALL PR.TITLE 05F2 CALL PR.MODS 05F5 HL=EOD 05F8 DO A=$HL 05FA* A=A AND MASK SKIP 05FC * IF ZR,EXIT 05FE PUSH AF 0600 PUSH DE 0601 PUSH HL 0602 %TOPLIST=HL 0606 HL=%TOP.RB 060A BC=HL 060C HL=%AFTER.RB 0610 DE=HL 0612 POP HL 0613+ HL=HL+1 KEY 0614 CALL BSEARCH 0617 POP DE 0618 A=C # OF MATCHES 061A* A:0 061C IF NZ,CALL WRITE1 REPORT THESE 0621 HL=%TOPLIST 0625* POP AF 0627 C=A 0629 B=0 062B* HL=HL+BC 062D LOOP 062F CALL OUT.CLOSE 0632 RETURN .P 0633 PR.TITLE HL=TITLE 0636 DO A=$HL 0638* A:0 063A * IF EQ,EXIT 063C CALL OUT.A 063F+ HL=HL+1 0640 LOOP 0642 HL=05D 0645 B=8 0647 DO A=$HL 0649 CALL OUT.A 064C+ HL=HL+1 064D+ B=B-1 064F LOOP UNTIL ZR 0651 CRLF CALL BMP.LINE 0654 A=CR 0656 CALL OUT.A 0659 A=LF 065B GOTO OUT.A 065E PR.MODNUM B=A 0660 CALL OUT.SP 0663 A=B 0665* A:0FF 0667 IF EQ, 0669 CALL OUT.SP 066C A="[" 066E CALL OUT.A 0671 A="$" 0673 CALL OUT.A 0676 A="]" 0678 GOTO OUT.A 067B* A=A-10 067D IF NC, 067F B=A 0681 A="[" 0683 CALL OUT.A 0686 A=B 0688 B=0 068A+ DO B=B+1 068C* A=A-10 068E LOOP UNTIL CY 0690 PUSH AF 0692 A=B 0694* A=A+"0" 0696 CALL OUT.A 0699* POP AF 069B* A=A+10+"0" 069D * EXIT 069F ELSE CALL OUT.SP 06A2 A="[" 06A4 CALL OUT.A 06A7 A=B 06A9* A=A+"0" 06AB CALL OUT.A 06AE A="]" 06B0 GOTO OUT.A .P 06B2 WRITE1 PUSH HL SYM TAB ENTRY 06B3 CALL CK.LINE 06B6 HL=%TOPLIST 06BA A=$HL 06BC* A=A AND MASK SKIP 06BE* A=A-3 LEN OF SYM 06C0 B=A 06C2* HL=HL+3 06C5 PUSH BC 06C6 DO A=$HL 06C8 CALL OUT.A 06CB+ HL=HL+1 06CC+ B=B-1 06CE LOOP WHILE NZ 06D0 POP BC 06D1 A=10 SYM FIELD LEN 06D3* A=A-B 06D5 B=A 06D7 IF NZ, 06D9 DO CALL OUT.SP 06DC+ B=B-1 06DE LOOP WHILE NZ 06E0 A="=" 06E2 CALL OUT.A 06E5 HL=%TOPLIST 06E9+ HL=HL+1 06EA CALL OUT.ADDR VALUE OF SYM 06ED A=0FF 06EF $SORTED=A 06F2 CALL GET.MODNUM 06F5 CALL PR.MODNUM 06F8 A=":" 06FA CALL OUT.A 06FD POP HL 06FE GOTO PR.REFS 0700 OUT.SP A=" " 0702 OUT.A DI=DE 0704 $DI+=A 0705+ E=E+1 0707 IF NZ,RTN 070A PUSH AF 070C PUSH BC 070D PUSH HL 070E C=21 WRITE SEQ 0710 CALL CPM.05C 0713* A:0 0715 DE=M6 0718 IF NZ,GOTO ERROR 071C POP HL 071D POP BC 071E* POP AF 0720 DE=080 0723 RETURN 0724+OUT.ADDR HL=HL+1 0725 CALL OUT.2HEX 0728+ HL=HL-1 0729 CALL OUT.2HEX 072C RETURN .P 072D PR.REFS DO CALL GET.MODNUM 0730 $SORTED=A 0733 IF NZ, 0735 CALL PR.MODNUM 0738 * EXIT 073A ELSE CALL OUT.SP 073D CALL OUT.SP 0740 CALL OUT.SP 0743 CALL OUT.SP 0746 CALL OUT.SP 0749 B=10 10 PER LINE 074B DO CALL OUT.SP 074E CALL OUT.ADDR 0751+ C=C-1 0753 * IF ZR,EXIT 0755* HL=HL+4 0758 CALL GET.MODNUM 075B * IF NZ,EXIT 075D+ B=B-1 075F LOOP WHILE NZ 0761 CALL CRLF 0764 B=21 0766 DO CALL OUT.SP 0769+ B=B-1 076B LOOP WHILE NZ 076D LOOP 076F GOTO CRLF 0772 OUT.2HEX A=$HL 0774. RR A,4 0777 CALL OUT.HEX 077A A=$HL 077C*OUT.HEX A=A AND 0F 077E* A=A+090 0780* DAA 0781* A=A+CY+040 0783* DAA 0784 GOTO OUT.A 0787 BMP.LINE A=$LINE.CNT 078A+ A=A+1 078C $LINE.CNT=A 078F RETURN 0790 CK.LINE A=$LINE.CNT 0793* A:55 0795 IF LT,RTN 0798* A=A-61 079A $LINE.CNT=A 079D IF GE,RTN 07A0 A=$X.CHAR 07A3 CALL OUT.A 07A6 A="P" 07A8 CALL OUT.A 07AB CALL CRLF 07AE* AF=0 07B0 $LINE.CNT=A 07B3 RETURN .P 07B4 GET.MODNUM PUSH HL 07B5 PUSH BC 07B6 PUSH DE 07B7 B=0FF DATA MODULE 07B9 E=$HL 07BB+ HL=HL+1 07BC D=$HL 07BE HL=%LAST.REF 07C2 A=H 07C4* A:D 07C6 IF EQ, 07C8 A=L 07CA* A:E 07CC IF GE, 07CE HL=%MODULES 07D2 B=0 07D4 DO A=$HL 07D6* A:0 07D8 * IF ZR,EXIT 07DA+ HL=HL+2 07DC A=$HL 07DE* A:D 07E0 IF EQ, 07E2+ HL=HL-1 07E3 A=$HL 07E5+ HL=HL+1 07E6* A:E 07E8 IF GE, 07EA * IF NE,EXIT 07EC* HL=HL+9 07EF+ B=B+1 07F1 LOOP 07F3 A=$SORTED 07F6* A:B 07F8 A=B 07FA POP DE 07FB POP BC 07FC POP HL 07FD RETURN 07FE OUT.CLOSE A=E 0800* A:080 0802 IF NZ, 0804 A=01A EOF 0806 DO CALL OUT.A 0809 LOOP WHILE NZ 080B C=16 CLOSE FILE 080D CPM.05C DE=@05C 0810 GOTO CPM .P 0813 PR.MODS HL=%MODULES 0817 C=1 0819 DO A=$HL 081B* A:0 081D * IF ZR,EXIT 081F B=21 0821 DO CALL OUT.SP 0824+ B=B-1 0826 LOOP UNTIL ZR 0828+ HL=HL+1 0829 PUSH HL 082A+ HL=HL+2 082C A=C 082E CALL PR.MODNUM 0831 CALL OUT.SP 0834 B=8 0836 DO A=$HL 0838+ HL=HL+1 0839 CALL OUT.A 083C+ B=B-1 083E LOOP UNTIL ZR 0840 CALL OUT.SP 0843 A="=" 0845 CALL OUT.A 0848 POP DI 0849 PUSH HL 084A HL=DI 084C CALL OUT.ADDR 084F CALL CRLF 0852 POP HL 0853+ C=C+1 0855 LOOP 0857 GOTO CRLF 085A NEXT .