title M$ BASIC Compiler name ('BASCOM') ; DASMed version of Microsoft BASIC compiler BASCOM.COM ; By W. Cirsovius .z80 aseg org 0100h OS equ 0000h BDOS equ 0005h CCP equ 0080h TPA equ 0100h .conout equ 2 .rdr equ 3 .lstout equ 5 .rdcon equ 10 .resdsk equ 13 .seldsk equ 14 .open equ 15 .close equ 16 .delete equ 19 .rdseq equ 20 .wrseq equ 21 .make equ 22 .retdsk equ 25 .setdma equ 26 OSerr equ 255 .drv equ 1 .nam equ 8 .ext equ 3 _EX equ 12 _CR equ 32 FCBlen equ 33 reclng equ 128 SRClen equ 4 RELlen equ 2 LSTlen equ 4 CMDLEN equ 80 null equ 00h bell equ 07h .bell equ 87h tab equ 09h .tab equ 89h lf equ 0ah .lf equ 8ah ff equ 0ch cr equ 0dh eof equ 1ah NoMSB equ 01111111b MSB equ 10000000b $BASGO equ 0114h ; Standard start of BASIC programs $COMlen equ 6 @@ON equ 1 @@CAL equ 2 @@DEF equ 4 @@DAT equ 5 @@COM equ 8 $LD.BC equ 001h $LD.HL equ 021h $JP equ 0c3h _LD.BC macro db 001h endm _LD.HL macro db $LD.HL endm _LD.A macro db 03eh endm _LD.L macro db 02eh endm _OR macro db 0f6h endm _CP macro db 0feh endm _JP macro db $JP endm _JP.NC macro db 0d2h endm _JP.C macro db 0dah endm _JP.PE macro db 0eah endm _JP.M macro db 0fah endm ; ; Relator tokens ; _eq equ 011h _lt equ 014h _gt equ 015h ; Tokentable - Token prefixed by 0ffh ; Keyword Value ; ======= ===== ; MOD = 010h ; AND = 018h ; NOT = 019h ; OR = 01ah ; EQV = 01bh ; XOR = 01ch ; IMP = 01dh ; DATA = 056h ; GOSUB = 057h ; GOTO = 058h ; IF = 059h ; INPUT = 05bh ; LET = 05ch ; READ = 05dh ; RESTORE = 05eh ; RETURN = 05fh ; DEF = 060h ; OUT = 061h ; POKE = 062h ; LINE = 063h ; RESUME = 064h ; SWAP = 065h ; FIELD = 066h ; LSET = 067h ; RSET = 068h ; CALL = 069h ; DEFDBL = 06ah ; DEFINT = 06bh ; DEFSNG = 06ch ; DEFSTR = 06dh ; OPTION = 06eh ; REM = 06fh ; %INCLUDE = 070h ; DIM = 071h ; COMMON = 072h ; NEXT = 073h ; PRINT = 074h ; WRITE = 075h ; STOP = 076h ; NULL = 077h ; ON = 078h ; WAIT = 079h ; LPRINT = 07ah ; TROFF = 07bh ; TRON = 07ch ; WIDTH = 07dh ; CLOSE = 07eh ; GET = 07fh ; OPEN = 080h ; PUT = 081h ; ERROR = 082h ; WHILE = 083h ; WEND = 084h ; GO = 085h ; RANDOMIZE = 086h ; KILL = 087h ; NAME = 088h ; END = 089h ; SYSTEM = 089h ; FOR = 08ah ; CLEAR = 08bh ; RUN = 08ch ; CHAIN = 08dh ; FILES = 08eh ; RESET = 08fh ; ERASE = 095h ; AUTO = 096h ; CONT = 096h ; DELETE = 096h ; EDIT = 096h ; LIST = 096h ; LLIST = 096h ; LOAD = 096h ; MERGE = 096h ; NEW = 096h ; RENUM = 096h ; SAVE = 096h ; AS = 097h ; BASE = 098h ; VARPTR = 099h ; SUB = 09ah ; TO = 09bh ; TAB = 09ch ; SPC = 09dh ; THEN = 09eh ; STEP = 09fh ; ELSE = 0a0h ; USING = 0a1h ; cr = 0a2h ; lf = 0a3h ; CINT = 0a4h ; CSNG = 0a5h ; CDBL = 0a6h ; FRE = 0a7h ; INP = 0a8h ; ASC = 0a9h ; LEN = 0aah ; POS = 0abh ; LPOS = 0adh ; PEEK = 0aeh ; SGN = 0afh ; USR0 = 0b1h ; USR = 0b1h ; USR1 = 0b2h ; USR2 = 0b3h ; USR3 = 0b4h ; USR4 = 0b5h ; USR5 = 0b6h ; USR6 = 0b7h ; USR7 = 0b8h ; USR8 = 0b9h ; USR9 = 0bah ; INSTR = 0bbh ; SPACE$ = 0bch ; STRING$ = 0bdh ; INPUT$ = 0bfh ; ABS = 0c0h ; ATN = 0c1h ; CHR$ = 0c2h ; COS = 0c3h ; EXP = 0c4h ; FIX = 0c5h ; HEX$ = 0c6h ; LEFT$ = 0c7h ; INT = 0c8h ; LOG = 0c9h ; MID$ = 0cah ; OCT$ = 0cbh ; RND = 0cch ; RIGHT$ = 0cdh ; SIN = 0ceh ; SQR = 0cfh ; STR$ = 0d0h ; TAN = 0d1h ; VAL = 0d2h ; EOF = 0d3h ; LOC = 0d4h ; LOF = 0d5h ; MKI$ = 0d6h ; MKS$ = 0d7h ; MKD$ = 0d8h ; CVI = 0d9h ; CVS = 0dah ; CVD = 0dbh ; ERR = 0ddh ; ERL = 0deh ; INKEY$ = 0e0h l0000 equ 00h l0001 equ 01h l0002 equ 02h l0003 equ 03h l0004 equ 04h l0005 equ 05h l0006 equ 06h l0007 equ 07h l0008 equ 08h l0009 equ 09h l000a equ 0ah l000b equ 0bh l000c equ 0ch l000d equ 0dh l000e equ 0eh l000f equ 0fh l0010 equ 10h l0012 equ 12h l001a equ 1ah l001e equ 1eh l0033 equ 33h l0040 equ 40h l0080 equ 80h l009b equ 9bh l00f2 equ 0f2h l00ff equ 0ffh l0100 equ 0100h l0107 equ 0107h l0109 equ 0109h ld hl,main ; Get main routine address jp coldstart ; .. enter cold start ; ; >>> Main entry <<< ; main: call fgetc ; Get character cp lf ; Test end of line call nz,stchr ; .. nope, store character call compile ; Do the compile task call relend ; Write end of REL file call praddr ; Give address line call prnl ; Give new line l011a: call prnl ; Give new line ld a,(errcnt) ld e,a ld d,0 call prdec ; Print errors call ilstrg db ' Fatal Error(s)',cr,.lf call prfree ; Print free memory ld a,(enaLST) ; Test list enabled or a jp z,l014b ; .. nope ld a,(F$LST) ; Get list device inc a ; Test console jp z,l0157 ; .. yeap l014b: ld a,(conflg) ; Get console flag and a ld a,1 ld (conflg),a ; .. force console jp z,l011a ; .. repeat above task for console l0157: call oclose ; .. close files call lclose call sclose jp OS ; .. and exit ; ; >> The real compile task << ; compile: ld a,(_stat2) ; Get status and 00100000b ; .. test MS exec jp z,l0170 ; .. nope ld a,'4' ld (l170c),a ; .. change 530 -> 430 l0170:: call l2a03 ld (l12e6),hl ex de,hl call l2d58 ld de,l170f call l0395 l0180: call l3111 ld a,(l23e3) ; Get end of file and a jp nz,l01f8 ; EOF l018a: call get.token ; Get token cp 0a2h ; Test new line jp z,l01ab call l0242 jp nc,l01ab l0198: call get.token ; Get token cp 0a2h ; Test new line jp z,l01ab cp 0a3h jp z,l01ab call get.new.token jp l0198 l01ab: call get.token ; Get token cp 0a3h ; Test new line jp z,l01c6 call get.new.token cp 0a2h jp z,l01c2 call err.code ; Syntax error db 1 jp l0198 l01c2: xor a ld (l23de),a l01c6: ld hl,(l17e1) ld a,(_stat1) ; Get option and 00100000b ; .. test /X error handling or h or l call nz,l334b ; Yeap call l2370 call l021a call get.token ; Get token cp 0a3h ; Test new line jp z,l01e7 call l0201 jp l018a l01e7: call get.new.token ld a,(_stat2) ; Get status and 10000000b ; .. test relax numbering call z,l334b ; .. nope call l2370 jp l0180 l01f8: call _END ; Process end call l334b jp l334b ; ; ; l0201: ld a,(_stat1) ; Get option and 00100000b ; .. test /X error handling ret z ; .. nope call get.token ; Get token cp 0a2h ; Test new line ret z ld hl,(l1516) ex de,hl call l2ef7 ex de,hl ld a,'?' jp l2dba ; ; ; l021a: ld hl,(data.lo) ; Get heap ld de,700 add hl,de ; .. add a bit ex de,hl ld hl,(heap.lo) ; Get top ld a,l sub e ld a,h sbc a,d call c,l334b ld hl,(heap.lo) call neg.hl ; -HL ex de,hl ld hl,(heap.hi) ; Get heap base add hl,de push hl ld hl,(data.lo) ; Get heap add hl,de pop de add hl,de call c,l334b ret ; ; ; l0242: call get.token ; Get token cp 0a2h ; Test new line ret z call l18d4 ; Output header to file cp 056h ; Test range of token jp c,l0e95 cp 096h+1 jp nc,l0e95 call get.new.token sub 056h call caseswitch dw l10c4 ; 0x56 : DATA dw l0cac ; 0x57 : GOSUB dw l0ca4 ; 0x58 : GOTO dw l0cbd ; 0x59 : IF dw intern.err ; 0x5A : --- dw l0d6e ; 0x5B : INPUT dw l0e95 ; 0x5C : LET dw l1093 ; 0x5D : READ dw l10b2 ; 0x5E : RESTORE dw l0703 ; 0x5F : RETURN dw l0472 ; 0x60 : DEF dw l0d58 ; 0x61 : OUT dw l0f2b ; 0x62 : POKE dw l0df3 ; 0x63 : LINE dw l07ab ; 0x64 : RESUME dw l1117 ; 0x65 : SWAP dw l080c ; 0x66 : FIELD dw l084e ; 0x67 : LSET dw l0851 ; 0x68 : RSET dw l039e ; 0x69 : CALL dw l05d8 ; 0x6A : DEFDBL dw l05cf ; 0x6B : DEFINT dw l05d5 ; 0x6C : DEFSNG dw l05d2 ; 0x6D : DEFSTR dw l0c67 ; 0x6E : OPTION dw intern.err ; 0x6F : [REM] dw l02f1 ; 0x70 : %INCLUDE dw l0646 ; 0x71 : DIM dw l17f8 ; 0x72 : COMMON dw l092e ; 0x73 : NEXT dw l0f4a ; 0x74 : PRINT dw l1034 ; 0x75 : WRITE dw l06fd ; 0x76 : STOP dw l037d ; 0x77 : NULL dw l0bdc ; 0x78 : ON dw l1144 ; 0x79 : WAIT dw l102a ; 0x7A : LPRINT dw l0389 ; 0x7B : TROFF dw l0383 ; 0x7C : TRON dw l035e ; 0x7D : WIDTH dw l078e ; 0x7E : CLOSE dw l073a ; 0x7F : GET dw l0760 ; 0x80 : OPEN dw l0734 ; 0x81 : PUT dw l07ff ; 0x82 : ERROR dw l0a80 ; 0x83 : WHILE dw l0abb ; 0x84 : WEND dw l0c92 ; 0x85 : GO dw l06e4 ; 0x86 : RANDOMIZE dw l072a ; 0x87 : KILL dw l070e ; 0x88 : NAME dw _END ; 0x89 : END, SYSTEM dw l0862 ; 0x8A : FOR dw l11ae ; 0x8B : CLEAR dw l118d ; 0x8C : RUN dw l1183 ; 0x8D : CHAIN dw l1170 ; 0x8E : FILES dw l58b2 ; 0x8F : RESET dw l58c2 ; 0x90 : ?? dw l58c2 ; 0x91 : ?? dw l58c2 ; 0x92 : ?? dw l58c2 ; 0x93 : ?? dw l58c2 ; 0x94 : ?? dw l02e2 ; 0x95 : ERASE dw l02df ; 0x96 : AUTO et.al ; ; Token : AUTO et.al ; l02df: ld a,8 ; Leads to an error _LD.HL ; ; Token : ERASE ; l02e2: ld a,24 call prc.err ; .. statement ignored l02e7: call get.new.token ; Get token cp 0a2h ; .. skip to end of line jp nz,l02e7 scf ret ; ; Token : %INCLUDE ; l02f1: ld a,@@DAT ld (l23e1),a ; Set mode ld b,32-1 ; Set max length ld de,l033e ; .. and buffer l02fb: ld a,1 ld (l23e2),a call get.new.token ; Get token cp 0a2h ; Test end of line jp z,l031e ld a,h ; Get character cp tab ; Skip white spaces jp z,l02fb cp ' ' jp z,l02fb inc b ; .. skip too many characters dec b jp z,l02fb ld (de),a ; .. unpack name inc de dec b jp l02fb l031e: ld a,cr ; Close line ld (de),a xor a ld (l23e1),a ; .. reset mode ld (l23e2),a ld hl,l033e call l4b08 ; Build FCB or a jp z,l0338 call err.code ; INCLUDE error db 18 scf ret l0338: ld a,1 ld (incflg),a ; Set include file ret ; l033e: ds 32 ; ; Token : WIDTH [LPRINT] ; l035e: ld de,l1719 call get.token ; Get token cp 07ah ; Test LPRINT jp nz,l036f ; .. nope call get.new.token ; .. point to integer ld de,l171e l036f: call l2649 ; Convert integer ret c l0373: ld a,037h push af ; Set token push de ; .. address push hl ; .. width ld b,1 jp put.rec.chn ; .. put value into data ; ; Token : NULL ; l037d: ld de,l1778 jp l036f ; .. convert integer ; ; Token : TRON ; l0383: ld de,l1723 jp l038c ; ; Token : TROFF ; l0389: ld de,l1728 l038c: ld a,(_stat1) ; Get option rra ; .. test /D debug code ld a,24 jp nc,prc.err ; .. nope, statement ignored ; ; ; l0395: ld a,037h push af ; Set token push de ; .. and address ld b,0 jp put.rec.chn ; .. into data ; ; Token : CALL [] ; l039e: call l334b ld a,@@CAL ld (l23e1),a ; Set mode call get.new.token cp 0f4h ld a,NULL ld (l23e1),a ; .. reset mode ld a,1 jp nz,prc.err ; .. syntax error ld bc,6 call alloc.dwn ; Get some memory push hl ld de,l25f6 ld a,6 call move ; .. move bytes dec hl ld a,(hl) or MSB ; Clear end ld (hl),a ld bc,l0000 call l2c55 ; Get new token jp z,l03fb ; .. new line or ELSE call vrf.token db 0e4h jp c,l3347 l03d9: push bc call l31a2 pop bc jp c,l046a push hl inc hl ld (hl),4 inc c ld a,10 cp c ld a,5 jp c,l0467 ; .. too complex call l2c49 jp z,l03d9 call vrf.token db 0e5h jp c,l046a l03fb: ld a,c sub 4 jp c,l0446 dec c dec c ld hl,(l1256) ld a,h or l jp nz,l0416 push bc ld bc,l0010 call l2b15 ld (l1256),hl pop bc l0416: pop hl push bc ld de,l0436 push de push hl ld hl,l1253 call l2ba9 ld (hl),1 push hl ld de,l0007 add hl,de ld a,c dec a add a,a ld (hl),a ld a,05ch ld bc,2*256+9 jp l2b9a l0436: pop bc dec c jp nz,l0416 ld c,3 ld hl,l1253 call l2ba9 ld (hl),1 push hl l0446: ld b,c ld a,c ; Get length add a,a ; .. double it add a,7 ; .. fix it ld c,a ld a,069h call ini.dat.0 ; Init CALL data ld (l045f),hl ; .. save pointer inc b ; .. fix for non zero l0455: pop de ; Get value ld (hl),e ; .. save inc hl ld (hl),d inc hl dec b jp nz,l0455 ld hl,$-$ ; Get back pointer l045f equ $-2 call l2a7d jp l334b l0467: call prc.err ; .. process error l046a: ld a,c l046b: pop hl sub 1 ret c jp l046b ; ; Token : DEF FN/USR ----- ?? ; l0472: call get.token ; Get token cp 0f1h ; Test ??? jp nz,l050b call l334b call l2a03 push hl ex de,hl call l2db8 call l048d pop de ret c jp l2d58 l048d: call get.new.token push hl ld (l0509),hl ld de,l0006 add hl,de ld a,(hl) inc hl or (hl) jp nz,l0503 ld a,@@DEF ld (l23e1),a ; Set mode call l0536 ld a,NULL ld (l23e1),a ; .. reset mode jp c,l04f7 ld hl,(l0509) ld de,l0005 add hl,de ld (hl),c inc hl ld (l04dd),hl ld a,c add a,a jp z,l04cf push bc ld c,a call alloc.up ; Allocate BC bytes add hl,bc pop bc l04c6: pop de dec hl ld (hl),d dec hl ld (hl),e dec c jp nz,l04c6 l04cf: push hl call vrf.token db 011h call nc,l2662 jp c,l3346 ex (sp),hl ex de,hl ld hl,$-$ l04dd equ $-2 ld (hl),e inc hl ld (hl),d pop hl pop de inc de ld a,(de) dec de call l2ece ld a,060h push af ; Set DEF token push de ; .. address push hl ; .. parameter call l059f ld b,1 jp put.rec.chn ; .. put into data record l04f7: push hl call err.code ; Syntax error db 1 pop hl pop hl call l059f scf ret l0503: call err.code ; Function already defined db 13 pop hl ret ; l0509: dw 0 ; ; ; l050b: call get.new.token sub 0b1h ; Test USR range jp c,l0531 cp 0bah-0b1h+1 jp nc,l0531 ld h,a add a,h add a,h inc a push af ld hl,l1243 call l2ba9 dec (hl) ex de,hl ld hl,l0007 add hl,de pop bc ld (hl),b ex de,hl ld b,05ch jp l0eb1 l0531: ld a,1 jp prc.err ; .. syntax error l0536: ld bc,l0000 pop hl ld (l0585+1),hl call get.token ; Get token sub 0e4h ; Test ??? and a jp nz,l0585 call get.new.token l0549: call get.new.token cp 0efh jp nz,l058f push hl inc hl ld a,(hl) call l2fb8 inc hl inc hl ex de,hl push bc ld c,a ld b,0 call l2b15 pop bc ex de,hl ld a,(hl) ld (hl),e inc hl or (hl) ld (hl),d ld a,1 call nz,prc.err ; .. syntax error inc c jp m,l0588 call get.new.token cp 0eah ; Test , jp z,l0549 cp 0e5h ; Test ) jp nz,l058f ld a,c cp '<' ccf jp c,l0588 l0585: jp $-$ l0588: call err.code ; Too complex db 5 jp l0593 l058f: call err.code ; Syntax error db 1 l0593: ld a,c l0594: sub 1 jp c,l0585 pop hl ld c,0 jp l0594 ; ; ; l059f: push hl ld hl,l11ff ; Set buffer ld b,'Z'-'A'+1 ; .. and length l05a5: push hl l05a6: ex de,hl l05a7: ld a,(de) ; Get pointer ld l,a inc de ld a,(de) ld h,a or l jp z,l05c5 ; .. end of chain inc hl inc hl inc hl inc hl ld a,(hl) add a,a dec hl dec hl dec hl ld a,(hl) dec hl jp p,l05a6 ld (de),a ; .. unpack address ld a,(hl) dec de ld (de),a jp l05a7 l05c5: pop hl inc hl inc hl dec b jp nz,l05a5 pop hl and a ret ; ; DEF ; ; Token : DEFINT ; l05cf: ld a,4 _LD.HL ; ; Token : DEFSTR ; l05d2: ld a,7 _LD.HL ; ; Token : DEFSNG ; l05d5: ld a,5 _LD.HL ; ; Token : DEFDBL ; l05d8: ld a,6 push af l05db: call l0620 jp nz,l0640 push hl push hl call l2c55 ; Get new token jp z,l05fc ; .. new line or ELSE cp 0eah jp z,l05fc call vrf.token db 00fh jp c,l3345 call l0620 jp nz,l063e ex (sp),hl l05fc: pop hl pop de pop bc push bc ld a,l sub e ld a,h sbc a,d jp nc,l0608 ex de,hl l0608: ld (hl),b call cmp.r ; Test end reached (HL:DE) dec hl jp nz,l0608 ; .. nope call l2c55 ; Get new token jp z,l3347 ; .. new line or ELSE call vrf.token db 0eah jp c,l3347 jp l05db ; ; ; l0620: ld a,@@CAL ld (l23e1),a ; Set mode call get.new.token ld hl,l23e1 ld (hl),NULL ; .. reset mode cp 0f4h ret nz ld a,(l25f6) ; Get index '????' xor MSB ; Toggle hi bit ret m ; .. was not set ld hl,l2626-'A' ; .. get base call adda ; HL+ACCU xor a ret ; ; ; l063e: pop hl pop hl l0640: pop hl call err.code ; Syntax error db 1 ret ; ; Token : DIM ; l0646: call get.new.token ld (l06dc),hl cp 0efh jp nz,l065c call l6521 ld a,11 jp c,prc.err ; .. array already dimensioned jp l06bd l065c: cp 0f0h ld a,1 jp nz,prc.err ; .. syntax error ld de,l0007 add hl,de ld a,(hl) and a ld a,11 jp nz,prc.err ; .. array already dimensioned ld (l06da),hl ld c,0 l0673: call l3204 jp nz,l06ca ld a,(l17e4) and a jp nz,l069a ld de,l0005 add hl,de ld a,(hl) and a jp m,l06ca inc hl ld a,(hl) inc hl ld h,(hl) ld l,a inc hl ld (l1366),hl ld a,2 ld (l1375),a call l2f2e l069a: push hl inc c jp m,l06cd call get.new.token cp 0eah ; Test , jp z,l0673 cp 0e7h ; Test ] jp z,l06b1 cp 0e5h jp nz,l06ca l06b1: ld a,c cp '<' jp nc,l06cd ld hl,(l06da) call l3278 l06bd: ld hl,(l06dc) call l18a8 call l2c49 ret nz jp l0646 l06ca: ld a,6 _LD.HL l06cd: ld a,5 call prc.err ; .. too complex ld a,c l06d3: sub 1 ret c pop hl jp l06d3 l06da: dw 0 l06dc: dw 0 ; ; Token : END, SYSTEM ; _END: ld de,l176e jp l0395 ; ; Token : RANDOMIZE [] ; l06e4: ld de,l1764 call l2c55 ; Get new token jp z,l0395 ; .. new line or ELSE ld de,l1769 call l2640 ret c jp l0373 ; ; ; l06f7: ld de,l1787 jp l0395 ; ; Token : STOP ; l06fd: ld de,l1773 jp l0395 ; ; Token : RETURN ; l0703: ld a,05fh ld (l0cfe),a ld bc,0*256+5 jp l2ba0 ; ; Token : NAME AS ; l070e: call l326c ret c ld a,037h ; Set token push af ld de,l1714 push de ; .. address push hl ; .. old filename call vrf.token ; Verify AS db 097h call nc,l326c jp c,l3345 push hl ; .. save new filename ld b,2 jp put.rec.chn ; .. unpack into data record ; ; Token : KILL ; l072a: call l326c ret c ld de,l172d jp l0373 ; ; Token : PUT [#][,] ; l0734: ld bc,l1732 jp l073d ; ; Token : GET [#][,] ; l073a: ld bc,l1737 l073d: ld a,037h ; .. set token push af push bc ; .. address call l2d4d push hl ; .. file number call nc,l325a jp c,l3345 ld b,1 jp z,l075d ; .. number only ld b,h ld c,l pop hl ex (sp),hl ld de,l000a add hl,de ex (sp),hl push hl ; .. save number push bc ; .. and record ld b,2 l075d: jp put.rec.chn ; .. put into data record ; ; Token : OPEN ,[#],[,] ; l0760: call l2b94 call l326c ret c ld de,l1746 call l0373 ld a,037h ld de,l174b push af push de call l2c91 call nc,l2d4d push hl ; Save mode call nc,l2c91 call nc,l326c push hl ; .. file number call nc,l325a jp c,l3344 push hl ; .. record length ld b,3 jp put.rec.chn ; Put into data record ; ; Token : CLOSE [[#][,[#]]] ; l078e: call l2c55 ; Get new token jp nz,l079a ; .. not new line or ELSE call l2de7 jp l079e l079a: call l2d4d ret c l079e: ld de,l1750 call l0373 call l2c49 ret nz jp l078e ; ; Token : RESUME ; RESUME 0 ; RESUME NEXT ; RESUME ; l07ab: call l2b94 call l3211 ld de,l175a ret c jp z,l07c9 ; .. resume only call get.token ; Get token cp 073h ; Test NEXT jp nz,l07d4 call get.new.token ld de,l1755 jp l07d4 l07c9: ld a,h ; Test 0 or l jp z,l07d4 ex de,hl ld a,064h jp l2dba l07d4: ld a,(_stat1) ; Get option and 00100000b ; .. /X error handling ld a,17 jp z,prc.err ; .. missing "/X" switch jp l0395 ; ; ; l07e1: ld a,(_stat1) ; Get option add a,a ; .. test /E or /X error handling ld a,16 call p,prc.err ; .. nope, missing "/E" switch call get.new.token call l29ed call nc,l3211 ret c ld a,h or l jp z,l06f7 ex de,hl ld a,040h jp l2dba ; ; Token : ERROR ; l07ff: call l2b94 call l2649 ret c ld de,l175f jp l0373 ; ; Token : FIELD [#], AS ... ; l080c: call l2d4d ret c push hl ld a,066h ld bc,1*256+7 call l2b75 ; Init FIELD data call l2a81 l081c: call l2c91 call nc,l2649 ret c push hl call vrf.token ; Verify AS db 097h call nc,l31a2 pop de ret c cp 7 ld a,4 jp nz,prc.err ; Type mismatch push de push hl ld a,051h ;;'Q' ld bc,2*256+9 call ini.dat.1 ; Init ??? data call l2b78 call l2a81 call get.token ; Get token cp 0eah ; Test ??? jp z,l081c and a ret ; ; Token : LSET = ; l084e: ld b,067h _LD.HL ; ; Token : RSET = ; l0851: ld b,068h call get.token ; Get token inc hl ld a,(hl) cp 7 jp z,l0eab call err.code ; Type mismatch db 4 ret ; ; Token : FOR = x to y [STEP z] ; l0862: call get.token ; Get token cp 0efh ; Test ??? ld a,1 jp nz,prc.err ; .. syntax error inc hl ld a,(hl) dec hl cp 7 ld a,1 jp z,prc.err ; .. syntax error push hl call l31a2 jp c,l3347 ld (l092d),a push hl push af call vrf.token db 011h call nc,l2662 jp c,l3345 pop af call l2ece ld a,(_stat2) ; Get compiler option and 00100000b ; .. test /T execution conventions jp z,l08a5 ; .. nope ex (sp),hl push hl ld bc,2*256+9 ld a,05ch call ini.dat.1 ; Init LET data jp l08ae l08a5: ex (sp),hl ld bc,1*256+7 ld a,053h call ini.dat.0 ; .. init ??? data l08ae: call l2b78 push hl call vrf.token ; Verify TO db 09bh call nc,l0af3 jp c,l3346 push hl call get.token ; Get token cp 09fh ; Test STEP jp nz,l08d1 call get.new.token call l0af3 jp c,l3345 jp l08da l08d1: ld hl,l1297+2 call l2ba9 call l0af7 l08da: push hl push af call l0ade ld de,FOR.NEXT call l2c84 pop af ld (hl),a pop de inc hl inc hl inc hl ld (hl),e inc hl ld (hl),d inc hl pop de ld (hl),e inc hl ld (hl),d inc hl ex (sp),hl call l2a81 ld a,(_stat2) ; Get compiler option and 00100000b ; .. test /T execution conventions jp nz,l0909 ; .. yeap call l2a03 push hl ex de,hl call l2db8 pop de l0909: pop hl ld (hl),e inc hl ld (hl),d inc hl ex de,hl call l2a03 ex de,hl ld (hl),e inc hl ld (hl),d push hl call l2d58 pop hl ld de,-8 add hl,de pop de ld (hl),d dec hl ld (hl),e call l0b6d ccf ret nc call err.code ; FOR/NEXT error db 12 ret ; l092d: db 0 ; ; Token : NEXT [][,...] ; l092e: call l2c55 ; Get new token jp nz,l0947 ; .. not new line or ELSE ld hl,(FOR.NEXT) ; Get state ld a,h or l jp z,l094a ; .. zero level inc hl inc hl inc hl ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(hl) jp l094a l0947: call get.new.token l094a: cp 0efh ld a,1 jp nz,prc.err ; .. syntax error l0951: ex de,hl ld hl,WHILE.WEND+1 call l0b6d jp c,l0a73 push de ex de,hl ld hl,(FOR.NEXT) ; Get level inc hl inc hl inc hl call cmp.r ; Test same (HL:DE) jp z,l09a2 ; .. yeap call err.code ; FOR/NEXT error db 12 call ilstrg dc 'Missing ''NEXT'' for ' ld a,(hl) ; Get address inc hl ld h,(hl) ld l,a dec hl ; .. fix for string dec hl dec hl l098a: ld a,(hl) ; Get character and NoMSB call putchr ; .. print cp (hl) ; Test end dec hl jp z,l098a ; .. nope call prnl ; Give new line ld hl,FOR.NEXT call l0bc8 pop hl jp l0951 l09a2: pop hl push hl push hl call l2ba9 call push.AESTK ; Push onto stack inc de inc de ld a,(de) ld l,a inc de ld a,(de) ld h,a ld (l0a7e),hl call l2ba9 call push.AESTK ; Push onto stack ld a,0eh call l2e22 call pop.AESTK ; Get from stack push hl ; .. save ld a,053h ld bc,1*256+7 call ini.dat.0 ; .. init ??? data call l2b78 call l2a81 ld hl,(FOR.NEXT) ; Get level ld de,l0009 ex de,hl add hl,de ld e,(hl) inc hl ld d,(hl) inc hl push hl ld a,(_stat2) ; Get compiler option and 00100000b ; .. test /T execution conventions call z,l2d58 ; .. nope pop hl ex (sp),hl call l2ba9 ld (hl),1 push hl ld a,054h ld bc,1*256+7 call ini.dat.1 ; Init ??? data call l2b78 call l2a81 pop hl ld c,(hl) inc hl ld b,(hl) dec hl dec hl dec hl dec hl ld d,(hl) dec hl ld e,(hl) dec hl dec hl dec hl dec hl dec hl ld a,(hl) pop hl and a jp nz,l0a58 push bc push de push hl call l2a03 ld b,h ld c,l ld (l0a7a),hl ld hl,(l0a7e) ex de,hl ld hl,l128d+2 ld a,013h call l0b86 pop hl pop de pop bc ld a,016h call l0b86 push bc push de push hl call l2a03 ld (l0a7c),hl ex de,hl call l2db8 ld hl,(l0a7a) ex de,hl call l2d58 pop hl pop de pop bc ld a,013h call l0b86 ld hl,(l0a7c) ex de,hl call l2d58 jp l0a63 l0a58: and a ld a,016h jp m,l0a60 ld a,013h l0a60: call l0b86 l0a63: ld hl,FOR.NEXT call l0bc8 call l334b l0a6c: call l2c49 ret nz jp l0947 l0a73: call err.code ; FOR/NEXT error db 12 jp l0a6c l0a7a: dw 0 ; l0a7c: dw 0 l0a7e: dw 0 ; ; Token : WHILE ; l0a80: call l2a03 push hl ex de,hl call l2d58 call l2652 jp c,l3347 ex de,hl ld a,05ah ld bc,1*256+9 call ini.dat.0 ; Init ??? data ld (hl),e ; save address inc hl ld (hl),d inc hl ex de,hl call l2a03 ex de,hl ld (hl),e inc hl ld (hl),d push de call l2a7a call l0ade ld de,WHILE.WEND call l2c84 pop de ld (hl),e inc hl ld (hl),d inc hl pop de ld (hl),e inc hl ld (hl),d and a ret ; ; Token : WEND ; l0abb: ld hl,(WHILE.WEND) ; Get state ld a,h or l ld a,15 jp z,prc.err ; .. WHILE/WEND error inc hl inc hl ld e,(hl) inc hl ld d,(hl) inc hl push de ld e,(hl) inc hl ld d,(hl) call l2db8 pop de call l2d58 ld hl,WHILE.WEND call l0bc8 and a ret ; ; Get pointer for ??? ; l0ade: ld hl,(l1357) ; Get pointer ld a,h or l ; Test zero ld bc,13 jp z,alloc.up ; .. yeap, allocate bytes ld e,(hl) ; Fetch address inc hl ld d,(hl) dec hl ex de,hl ld (l1357),hl ; .. save ex de,hl ret ; ; ; l0af3: call l2662 ret c l0af7: ld a,(l092d) call l2ece ld a,(l17e1) and a jp nz,l0b0e l0b04: ld b,0 call l3545 ld a,b and a jp nz,l0b04 l0b0e: call l2c5e jp c,l0b36 cp 0eeh jp nz,l0b36 ld de,l0005 add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a ex de,hl ld hl,l0005 add hl,de ld a,(hl) cp 050h ld a,1 jp z,l0b34 ld a,(hl) and MSB rra add a,040h l0b34: ex de,hl ret l0b36: push hl ld bc,12 call alloc.up ; Get some bytes ld (hl),0c6h inc hl ld a,$-$ l0b41 equ $-1 inc a ld (l0b41),a call l4d28 inc hl inc hl ld (hl),0efh inc hl pop de inc de ld a,(de) dec de ld (hl),a dec hl push hl push de call l2ba9 push hl ld (hl),1 ld bc,2*256+9 ld a,05ch call ini.dat.1 ; Init LET data call l2b78 call l2a81 pop hl xor a ret ; ; ; l0b6d: dec hl dec hl ld a,(hl) dec hl ld l,(hl) ld h,a or l scf ret z inc hl inc hl inc hl ld a,(hl) cp e jp nz,l0b6d inc hl ld a,(hl) dec hl cp d jp nz,l0b6d ret ; ; ENTRY Accu holds token ; l0b86: push hl push de push bc push de push hl ld bc,2*256+9 call ini.dat.0 ; Init data pop de ex de,hl call l2ba9 pop bc push bc inc bc ld a,(bc) call l2ece ex de,hl ld (hl),e inc hl ld (hl),d inc hl pop de ex de,hl call l2ba9 ex de,hl ld (hl),e inc hl ld (hl),d ld de,-8 add hl,de ex de,hl ld bc,1*256+9 ld a,059h call ini.dat.0 ; Init IF data ld (hl),e ; .. save address inc hl ld (hl),d inc hl pop bc ld (hl),c inc hl ld (hl),b push bc call l2a7a pop bc pop de pop hl ret ; ; ; l0bc8: ld e,(hl) inc hl ld d,(hl) ld a,d or e ret z inc de ld a,(de) ld (hl),a dec de dec hl ld a,(de) ld (hl),a ex de,hl ld de,l1357 jp l2c84 ; ; Token : ON ERROR GOTO ; ON GOTO ; ON GOSUB ; l0bdc: call l2b94 call get.token ; Get token cp 082h ; Test ERROR jp z,l07e1 call l2640 ret c ex de,hl call get.new.token ; Get token add a,0eah cp LOW (058h+0eah) ; .. test GOTO jp z,l0c0f cp LOW (057h+0eah) ; .. GOSUB jp z,l0c0f cp LOW (085h+0eah) ; .. GO jp nz,l0c61 call get.new.token add a,0a7h cp LOW (09bh+0a7h) ; .. TO jp z,l0c0f cp LOW (09ah+0a7h) ; .. SUB jp nz,l0c61 ; ; GOTO, GOSUB, GO TO|SUB ; l0c0f: ld (l0c66),a ; .. save token push de ld bc,1*256+0 l0c16: push bc call l2fcb pop bc jp c,l0c59 push hl inc c jp m,l0c55 call l2c49 jp z,l0c16 ld a,c cp '<' jp nc,l0c55 push bc add a,a add a,8 ld c,a ld a,(l0c66) ; .. get token call ini.dat.0 ; Init data pop bc ld a,c add a,a add a,2 call adda ; HL+ACCU ld b,c l0c43: pop de ; Get value ld (hl),d ; .. save dec hl ld (hl),e dec hl dec b jp nz,l0c43 ld (hl),c dec hl pop de ld (hl),d dec hl ld (hl),e jp l2a7d l0c55: call err.code ; Out of memory db 2 l0c59: ld a,c l0c5a: pop hl sub 1 ret c jp l0c5a l0c61: ld a,1 jp prc.err ; .. syntax error l0c66: db 0 ; ; Token : OPTION BASE n ; l0c67: ld a,(l17e5) ; Get error and a jp nz,prc.err ; .. process it call vrf.token ; Verify BASE db 098h ret c call get.new.token ld de,l128d+2 ld b,0 call cmp.r ; Test same (HL:DE) jp z,l0c8d ; .. yeap ld de,l1297+2 inc b call cmp.r ; Test same ld a,1 jp nz,prc.err ; .. nope, syntax error l0c8d: ld a,b ld (l17e4),a ret ; ; Token : GO TO ; GO SUB ; l0c92: call get.new.token ; Get new token cp 09bh ; Test TO jp z,l0ca4 cp 09ah ; .. or SUB jp z,l0cac ld a,1 jp prc.err ; .. syntax error ; ; Token : GOTO ; l0ca4: ld a,058h ; Set GOTO ld (l0cfe),a jp l0cb1 ; ; Token : GOSUB ; l0cac: call l2b94 ld a,057h ; Set GOSUB l0cb1: push af call l2fcb jp c,l3347 ex de,hl pop af jp l2dba ; ; Token : IF THEN {|} ; [ELSE {|}] ; IF GOTO ; [ELSE {|}] ; l0cbd: call l2652 ret c ex de,hl ld a,05ah ld bc,1*256+9 call ini.dat.0 ; Init ??? data ld (hl),e ; .. save address inc hl ld (hl),d l0ccd: inc hl ex de,hl call l2a03 ex de,hl ld (hl),e inc hl ld (hl),d push de call l2a7a call get.token ; Get token cp 058h ; Test GOTO jp z,l0ceb cp 085h ; .. GO jp z,l0ceb call vrf.token ; Verify THEN db 09eh l0ceb: call nc,l0d2a pop de ret c call get.token ; Get token sub 0a0h ; Test ELSE and a jp nz,l0d10 call l2a03 push hl ld a,$-$ l0cfe equ $-1 cp 058h ; Test GOTO jp z,l0d0f cp 05fh ; .. or RETURN jp z,l0d0f l0d09: push de ex de,hl call l2db8 pop de l0d0f: xor a l0d10: push af call l2d58 call l0d24 pop af ret nz call get.new.token call l0d2a pop hl ex de,hl call nc,l2d58 l0d24: ld a,0 ld (l0cfe),a ret l0d2a: call l0d24 call l3210 ret c jp nz,l0d42 ex de,hl call l2db8 l0d38: call get.token ; Get token sub 0a2h ; Test end of line and a ret nz ld (l23de),a l0d42: call get.token ; Get token cp 0a0h ; Test ELSE ret z cp 0a3h ; .. or end of line ret z call l0d24 call l0201 call l0242 ret c jp l0d38 ; ; Token : OUT i,j ; l0d58: call l2649 call nc,l2c91 push hl call nc,l2649 jp c,l3347 push hl ld a,061h ld bc,2*256+9 jp l2ba0 ; ; Token : INPUT [;][<"prompt string">;] ; l0d6e: xor a call l0e20 ret c call l334b ld a,(_stat2) ; Get compiler option and 00100000b ; .. test /T execution conventions jp z,l0d98 ; .. nope ld a,(l0e93) cp '5' jp nz,l0d98 call l2a03 ex de,hl push de ld a,055h call l2dba call l0d98 pop de ret c jp l2d58 l0d98: ld bc,0 l0d9b: push bc call l31a2 pop bc jp c,l0deb push hl inc c ld a,'<' sub c jp c,l0de7 call l2c49 jp z,l0d9b ld b,c ld a,c add a,a add a,c add a,5 ld c,a ld a,05bh call ini.dat.0 ; Init INPUT data ld (l0dd9),hl ; .. save pointer ld e,b ld d,0 add hl,de ; .. position pointer to top add hl,de ex de,hl add hl,de ex de,hl ld a,b ; Get count l0dc9: pop bc dec hl ld (hl),b ; .. save value dec hl ld (hl),c push af inc bc ld a,(bc) ; .. fetch byte dec de ld (de),a ; .. save pop af dec a jp nz,l0dc9 ld hl,$-$ ; Get back pointer l0dd9 equ $-2 dec hl dec hl dec hl ld a,(hl) ; Get state or 00000010b ; .. set bit ld (hl),a dec hl ; .. fix for start dec hl jp l2a81 l0de7: call err.code ; Too complex db 5 l0deb: ld a,c l0dec: sub 1 ret c pop hl jp l0dec ; ; Token : LINE INPUT [;][<"prompt string">;] ; LINE INPUT# , ; l0df3: call vrf.token ; Verify INPUT db 05bh ld a,2 call nc,l0e20 call nc,l31a2 ret c ex de,hl cp 7 ld a,4 jp nz,prc.err ; .. type mismatch ld a,63h ld bc,1*256+7 call ini.dat.0 ; .. init LINE data ld (hl),e ; .. save address inc hl ld (hl),d dec hl call l2a7d call l2c55 ; Get new token ret z ; .. new line or ELSE call err.code ; Too complex db 5 ret l0e20: ld (l0e94),a call get.token ; Get token cp 0e8h ; Test ??? jp nz,l0e3e call l2d4d call nc,l2c91 ret c push hl ld a,'6' ld (l0e93),a ld bc,1*256+7 jp l2ba0 l0e3e: cp 0e9h jp nz,l0e50 call get.new.token ld hl,l0e94 ld a,(hl) or 1 ld (hl),a call get.token ; Get token l0e50: cp 0eeh ; Test ??? jp z,l0e5c l0e55: call l2e07 push hl jp l0e81 l0e5c: inc hl ld a,(hl) cp 7 jp nz,l0e55 call l2662 ret c push hl call get.new.token sub 0e9h ; Test ; jp z,l0e81 dec a jp z,l0e7a pop hl ld a,1 jp prc.err ; .. syntax error l0e7a: ld hl,l0e94 ld a,(hl) or 2 ld (hl),a l0e81: ld a,(l0e94) call l2dc7 push hl ld a,035h ld (l0e93),a ld bc,2*256+9 jp l2ba0 ; l0e93: db 0 l0e94: db 0 ; ; Token : LET = ; l0e95: call get.token ; Get token cp 0cah ; Test MID$ jp z,l0ed2 ld b,5ch cp 0efh ; ??? jp z,l0eab cp 0f0h ; ??? ld a,8 jp nz,prc.err ; .. unrecognizable command l0eab: push bc call l31a2 pop bc ret c l0eb1: push hl push af ld a,b ld (l0ecb),a call vrf.token db 011h call nc,l2662 jp c,l3346 pop af call l2ece jp c,l3347 ex (sp),hl push hl ld a,$-$ l0ecb equ $-1 ld bc,2*256+9 jp l2b9a l0ed2: call get.new.token call vrf.token db 0e4h call nc,l31a2 ret c cp 7 ld a,4 jp nz,prc.err ; .. type mismatch push hl call l2c91 call nc,l2649 jp c,l3347 ex (sp),hl push hl call l2c49 jp nz,l0eff call l2649 jp c,l3346 jp l0f02 l0eff: call l2dff l0f02: call vrf.token db 0e5h jp c,l3346 ex (sp),hl push hl call vrf.token db 011h call nc,l2662 jp c,l3345 cp 7 jp z,l0f21 call err.code ; Type mismatch db 4 jp l3345 l0f21: ex (sp),hl push hl ld a,03eh ld bc,4*256+13 jp l2b9a ; ; Token : POKE i,j ; l0f2b: call l2662 ret c cp 6 ld a,5 call z,l2ece push hl call l2c91 call nc,l2649 jp c,l3347 ex (sp),hl push hl ld a,062h ld bc,2*256+9 jp l2ba0 ; ; Token : PRINT [] ; PRINT USING ; ; PRINT#,[USING ;] ; l0f4a: xor a ld (l1092),a l0f4e: ld bc,0 call get.token ; Get token cp 0e8h ; Test ??? jp nz,l0f64 call l2d4d call nc,l2c91 ret c inc b inc c inc c push hl l0f64: ld a,(l1092) or a jp m,l0f8d call get.token ; Get token cp 0a1h ; Test USING jp nz,l0f8d ld a,1 ld (l1092),a call get.new.token push bc call l326c pop bc jp c,l1006 push hl inc b inc c call vrf.token db 0e9h jp c,l1006 l0f8d: ld a,c add a,043h ld h,a ld a,b add a,a add a,5 ld c,a ld a,h call l2b75 call l2a81 ld a,(l1092) or a jp nz,l1054 l0fa4: call get.token ; Get token cp 0a1h ; Test USING jp z,l1043 ld hl,l0000 cp 0eah jp z,l0fd2 cp 0e9h jp z,l0fd2 call l2c58 ; .. test new line or ELSE jp z,l0fd2 ; .. yeap cp 09ch ; Test TAB jp z,l100f cp 09dh ; .. space jp z,l100f call l2662 ret c ex de,hl call get.token ; Get token ex de,hl l0fd2: ex de,hl ld b,04bh call l2c58 ; .. test new line or ELSE jp z,l0fee ; .. yeap dec b cp 0e9h jp z,l0feb dec b cp 0eah jp z,l0feb inc b jp l0fee l0feb: call get.new.token l0fee: ex de,hl ld a,h or l call z,l2e07 ld a,b l0ff5: ld bc,1*256+7 push hl call l2b75 call l2a81 call l2c55 ; Get new token jp nz,l0fa4 ; .. not new line or ELSE ret l1006: ld a,b sub 1 ld b,a ret c pop hl jp l1006 l100f: call get.new.token add a,0b0h push af call vrf.token db 0e4h call nc,l2640 jp c,l3347 call vrf.token db 0e5h jp c,l3347 pop af jp l0ff5 ; ; Token : LPRINT [] ; LPRINT USING ; ; l102a: xor a ld (l1092),a ld bc,l0004 jp l0f64 ; ; Token : WRITE [] ; l1034: ld a,-1 ld (l1092),a ld hl,l0f4e push hl ld de,l177d jp l0395 ; ; ; l1043: call get.new.token call l326c ret c ld de,l17b9 call l0373 call vrf.token db 0e9h l1054: call l2662 ret c ld b,04ah ex de,hl call get.token ; Get token ex de,hl cp 0eah jp z,l1072 cp 0e9h jp z,l1072 inc b call l2c58 ; .. test new line or ELSE ld a,1 jp nz,prc.err ; .. syntax error if not l1072: ld a,b ld bc,1*256+7 push hl call l2b75 call l2a81 call l2c55 ; Get new token ret z ; .. new line or ELSE call get.new.token ld a,(l1092) or a jp m,l1054 call l2c55 ; Get new token jp nz,l1054 ; .. not new line or ELSE ret ; l1092: db 0 ; ; Token : READ ; l1093: call l31a2 ret c push af push hl ld bc,1*256+7 ld a,05dh call ini.dat.1 ; Init READ data call l2b78 pop af inc hl ld (hl),a ; .. save byte dec hl call l2a81 call l2c49 ret nz jp l1093 ; ; Token : RESTORE [] ; l10b2: call l3210 ret c ld a,05eh ld bc,0*256+5 ;;l0005 jp nz,l2ba0 ex de,hl ld a,04eh jp l2dba ; ; Token : DATA ; l10c4: call l2a03 ex de,hl push de call l2db8 call l2a03 ex de,hl call l2d58 xor a ld (l23e2),a ld a,@@DAT ld (l23e1),a ; Set mode ld a,056h l10de: ld bc,0*256+26 call ini.dat.0 ; Init DATA data ld c,20 ;;14h push hl inc hl l10e8: ex de,hl call get.new.token ; Get new token ex de,hl cp 0a2h ; Test end of line jp nz,l10f8 ; .. nope ld (hl),0 ; .. close entry dec c jp l10fe l10f8: ld (hl),d ; .. save byte inc hl dec c jp nz,l10e8 l10fe: pop hl push af ld a,21 sub c ; Calculate length ld (hl),a ; .. save call l2a7d pop af cp 0a2h ; Test end ld a,052h jp nz,l10de ; .. nope, try next data set pop de xor a ld (l23e1),a ; Reset mode jp l2d58 ; ; Token : SWAP , ; l1117: call l31a2 push hl push af call nc,l2c91 call nc,l31a2 jp c,l3346 pop bc cp b jp z,l1130 call err.code ; Type mismatch db 4 pop hl ret l1130: push hl ld bc,2*256+9 ld a,65h call l2b75 ; Init SWAP data inc hl inc hl ld a,(hl) or 2 ld (hl),a dec hl dec hl jp l2a81 ; ; Token : WAIT ,i[,j] ; l1144: call l2649 call nc,l2c91 push hl call nc,l2649 jp c,l3347 ex (sp),hl push hl call l2c49 ld a,04fh ld bc,2*256+9 jp nz,l116d call l2649 jp c,l3346 pop bc ex (sp),hl push hl push bc ld a,050h ld bc,3*256+11 l116d: jp l2ba0 ; ; Token : FILES ; l1170: ld de,l17a5 call l2c55 ; Get new token jp z,l0395 ; .. new line or ELSE call l326c ret c ld de,l17aa jp l0373 ; ; Token : CHAIN [MERGE] ; [,[line num expr>][,ALL][,DELETE ]] ; l1183: call l326c ret c ld de,l17a0 jp l0373 ; ; Token : RUN [] ; RUN [,R] ; l118d: call l3210 ret c jp z,l119d call l2c55 ; Get new token ld hl,(l12e6) jp nz,l11a4 ; .. not new line or ELSE l119d: ex de,hl call l11f6 jp l2db8 l11a4: call l326c ret c ld de,l179b jp l0373 ; ; Token : CLEAR [,[][,]] ; l11ae: call l2b94 call l2c55 ; Get new token jp z,l11f6 ; .. new line or ELSE call l2c49 jp z,l11ca call l2640 ret c call l2c55 ; Get new token jp z,l11f6 ; .. new line or ELSE call l2c91 l11ca: call l11e8 ret c ld a,037h push af ; Set token ld de,l1791 push de ; .. address push hl ; .. expr1 call l11e2 jp c,l3345 push hl ; .. expr2 ld b,2 jp put.rec.chn ; .. put into data record ; ; ; l11e2: call l2c49 jp nz,l11f3 l11e8: call l2c55 ; Get new token jp z,l11f3 ; .. new line or ELSE cp 0eah jp nz,l2640 l11f3: jp l2de7 l11f6: push de ld de,l1796 call l0395 pop de ret l11ff: ds 2*('Z'-'A'+1) l1233: dw l128d dw 0 dw l1285 dw 0 dw 0 ; l123d:: dw l12d4 db 0d5h,024h,0,0 l1243: db 0f0h,4,20h l1246: dw 0 db 0,0,0,0,0,0c7h,'RA$',0,0 l1253: db 0f0h,4,0 l1256: dw 0 db 0,0,0,0,0,0d4h,'F$',0,0 l1262: db 0f0h,4,20h l1265: dw 0 db 0,0,0,0,0 db 0c3h,'A$' db 0,0 l1271: db 0efh,4,20h l1274: dw 0 db 0,0,0c3h,'AD$',0,0 l127e: db 0efh,4,20h l1281: dw 0 db 0,0 ; l1285: dw 0 db 0eeh db 7 db 00100000b dw 0 db 0 ; l128d: dw l1297 db 0eeh db 4 db 00100000b dw 0 db 00000000b dw 0 l1297: dw l12a1 db 0eeh db 4 db 00100000b dw 0 db 01010000b dw 1 l12a1: dw l12ab db 0eeh db 4 db 00100000b dw 0 db 01010001b dw 2 l12ab: dw l12b5 db 0eeh db 4 db 00100000b dw 0 db 01000000b dw 3 l12b5: dw l12bf db 0eeh db 4 db 00100000b dw 0 db 11010000b dw -1 l12bf: dw l12c9 db 0eeh db 4 db 00100000b dw 0 db 01000000b dw 11 l12c9: dw 0 db 0eeh db 4 db 00100000b dw 0 db 01000000b db 11111111b dw 40960 l12d4: db 0,0,0f2h,0,0 l12d9: dw 0 l12db: dw 0 l12dd: dw l12db l12df: db 0,0,0 l12e2: db 0,0,0,0 l12e6: dw 0 l12e8: db 1,4,0,0,0 dw l128d+2 db 0,0 l12f1: db 1,4,0,0,0 dw l1297+2 db 0,0 l12fa: db 1,4,0,0,0 dw l12a1+2 db 0,0 l1303: db 1,4,0,0,0 dw l12ab+2 db 0,0 l130c: db 1,4,0,0,0 dw l12b5+2 db 0,0 l1315: db 1,4,0,0,0 dw l12c9+2 db 0,0 l131e: db 1,7,0,0,0 dw l1285+2 db 0,0 l1327: db 0eh,0eh db 0ah,0ah db 0ch,0ch db 11h,11h db 12h,12h db 14h,15h db 15h,14h db 13h,16h db 16h,13h db 18h,18h db 1ah,1ah db 1ch,1ch db null l1340: db 10h,10 db 18h, 5 db 19h, 6 db 1ah, 4 db 1bh, 2 db 1ch, 3 db 1dh, 1 db null AESTK.base: dw l13cb AESTK.ptr: dw l13cb FOR.NEXT: dw 0 WHILE.WEND: dw 0 l1357: db 0,0,0,0,0,0,0,0,0,0 l1361: db 0 l1362: db 0,0 l1364: db 0 l1365: db 0 l1366: db 0 l1367: db 0 l1368: db 0 l1369: db 0 l136a: db 0 l136b: db 0 l136c: db 0 l136d: db 0 l136e: db 0,0,0,0 l1372: db 0 l1373: db 0,0 l1375: db 0 l1376: db 0 l1377: call intern.err call intern.err l137d: db 0,0 l137f: db 0 l1380: db 0 l1381: db 0a1h l1382: db 0deh l1383: dw l1382 db 0,0,0,0,0 l138a: dw l138c l138c: db 40h,10h ; ; Cold start of program ; ; !!!! WILL BE OVERWRITTEN !!!! ; coldstart: ld (l1419+1),hl ; Save xfer address ld hl,l1397 ; Get exec address jp l4402 ; .. go init ; ; ; l1397: ld hl,-256 add hl,sp ; Get one stack page ld de,l8703 ld a,e sub l ; Test in range ld a,d sbc a,h jp nc,l13a9 ; .. nope ld de,-256 add hl,de ; .. get second page l13a9: call neg.hl ; -HL ld (top.data),hl ; .. save as top call neg.hl ; -HL ld (heap.hi),hl ; Init heap pointers ld (heap.lo),hl ld (data.hi),hl ; .. and top data pointer ; ; Cleared until 'l13bf' ; ;l13bf: ld de,-200 add hl,de ex de,hl ld hl,l7f33 call neg.hl ; -HL ex de,hl add hl,de jp nc,l2394 ; ; NEXT WILL BE OVERWRITTEN DYNAMICALLY ; l13cb: ld hl,(l23f5) ld (hl),0 ld hl,-2 add hl,sp ld de,l7f33 l13d7: ld (hl),0 dec hl ld a,l cp e jp nz,l13d7 ld a,h cp d jp nz,l13d7 ld hl,l1420 push hl call prstrg ; Give header ld a,(_stat2) ; Get compiler option and 00010000b ; .. test /O library substitution jp z,l13fc ; .. nope ld hl,'BO' ld (l7b30),hl ; .. change BASLIB -> OBSLIB jp l1408 l13fc: ld hl,l1458 ld (BFIELD),hl ; Set 'HBCLOAD' ld bc,0100b call RELITEM ; Give special link item l1408: pop hl ld a,l145f-l1420 call clrmem ; Clear header call prfree ; Print free memory ld hl,coldstart ld a,49 call clrmem ; .. dtto. l1419: jp l1419+1 ; Jump to 'main' ; ; ; l141c: dw l141e l141e: ;; dw l1e40 db '@',1eh l1420: db cr,lf db 'BASCOM 5.30a- ' dc 'Copyright 1979,80,81 (C) by MICROSOFT - ' l1458: dc 'HBCLOAD' l145f: ds 90 ; ; Put header to file ; l14b9: ld hl,l1509 ld (BFIELD),hl ; Set 'BASIC' ld bc,0010b call RELITEM ; Give name of program ld hl,l150e ld (BFIELD),hl ; Set '$$MAIN' ld de,0 ld bc,01b*256+0111b call RELITEM ; Give code entry point ; ; Build standard basic header: ; ; LD HL,0114h ; JP xxxx ; DW 0,0 ; DW ; DW 0,0,0,0 ; ld b,$LD.HL call put.cons ; .. give sequence 21xxxx ld b,01b call put.code ; .. indicate program relative ld b,LOW ($BASGO-TPA) call put.byte ; Give address ld b,HIGH ($BASGO-TPA) call put.byte ld b,$JP call put.cons ; Give sequence c3xxxx ld c,2*3 call l14ff ; Clear next words ld hl,(l12d9) ; .. get ??? ld b,l call put.cons ; .. put word ld b,h call put.cons ld c,2*4 ; Clear next words l14ff: ld b,0 call put.cons ; Clear next bytes dec c jp nz,l14ff ret ; l1509: dc 'BASIC' l150e: dc '$$MAIN' l1514: dw -1 l1516: dw 0 ; ; Table 1 ; l1518: dc 'IS2' db 0,0,2,87h,07h,04h dc 'IST' db 0,0,3,04h,07h,07h,04h dc 'SP$' db 0,0,1,04h,07h dc 'ST$' db 0,0,2,04h,44h,07h l153c: dc 'S2$' db 0,0,2,04h,07h,07h dc 'IN$' db 0,0,2,04h,0a4h,07h dc 'ABS' db 0,0,1,85h,05h dc 'ABI' db 0,0,1,84h,04h dc 'ABD' db 0,0,1,06h,06h dc 'ATD' db 0,0,1,86h,06h dc 'ATN' db 0,0,1,05h,05h dc 'CHR' db 0,0,1,04,07h dc 'COD' db 0,0,1,86h,06h dc 'COS' db 0,0,1,05h,05h dc 'EXD' db 0,0,1,86h,06h dc 'EXP' db 0,0,1,05h,05h dc 'FIX' db 0,0,1,85h,05h dc 'FID' db 0,0,1,86h,06h dc 'RET' db 0,0,1,04h,04h dc 'HEX' db 0,0,1,84h,07h dc 'HXF' db 0,0,1,05h,07h dc 'LEF' db 0,0,2,07h,04h,07h dc 'INT' db 0,0,1,85h,05h dc 'IND' db 0,0,1,86h,06h dc 'RET' db 0,0,1,04h,04h dc 'LOD' db 0,0,1,86h,06h dc 'LOG' db 0,0,1,05h,05h dc 'MID' db 0,0,3,07h,04h,84h,07h dc 'OCT' db 0,0,1,84h,07h l1609: dc 'OCF' db 0,0,1,05h,07h l1611: dc 'RAN' db 0,0,1,05h,05h dc 'RIG' db 0,0,2,07h,04h,07h dc 'SID' db 0,0,1,86h,06h dc 'SIN' db 0,0,1,05h,05h dc 'SQD' db 0,0,1,86h,06h dc 'SQR' db 0,0,1,05h,05h dc 'STR' db 0,0,1,85h,07h dc 'STI' db 0,0,1,84h,07h dc 'STD' db 0,0,1,06h,07h dc 'TAD' db 0,0,1,86h,06h dc 'TAN' db 0,0,1,05h,05h dc 'VAL' db 0,0,1,07h,06h dc 'EOF' db 0,0,1,04h,04h dc 'LOC' db 0,0,1,04h,04h dc 'LOF' db 0,0,1,04h,04h dc 'MKI' db 0,0,1,04h,07h dc 'MKS' db 0,0,1,05h,07h dc 'MKD' db 0,0,1,06h,07h dc 'CVI' db 0,0,1,07h,04h dc 'CVS' db 0,0,1,07h,05h dc 'CVD' db 0,0,1,07h,06h dc 'DKF' db 0,0,1,04h,04h dc 'ERN' db 0,0,0,04h dc 'ERL' db 0,0,0,05h dc 'ERS' db 0,0,0,07h dc 'INK' db 0,0,0,07h dc 'TIM' db 0,0,0,07h dc 'DAT' db 0,0,0,07h dc 'GPT' db 0,0,2,04h,04h,04h ; ; End of table 1 ; l16f5:: db 0,0,0,5,4,4,4,4,4,4,4,0,5,4 db 4,4,4,4,4,4,4,4,4 ; ; Table 2 ; l170c: dc '530' l170f: db 0,0 dc 'DKR' l1714: db 0,0 dc 'WID' l1719: db 0,0 dc 'LWI' l171e: db 0,0 dc 'TRN' l1723: db 0,0 dc 'TRF' l1728: db 0,0 dc 'DKK' l172d: db 0,0 dc 'PUT' l1732: db 0,0 dc 'GET' l1737: db 0,0 dc 'RPT' db 0,0 dc 'RGT' db 0,0 dc 'DKN' l1746: db 0,0 dc 'DKM' l174b: db 0,0 dc 'DKC' l1750: db 0,0 dc 'RSN' l1755: db 0,0 dc 'RS0' l175a: db 0,0 dc 'FOE' l175f: db 0,0 dc 'RZ0' l1764: db 0,0 dc 'RZ1' l1769: db 0,0 dc 'END' l176e: db 0,0 dc 'STP' l1773: db 0,0 dc 'NUL' l1778: db 0,0 dc 'WRI' l177d: db 0,0 dc 'VPT' l1782: db 0,0 dc 'ON0' l1787: db 0,0 l1789: dc 'RA0' db 0,0 dc 'CLR' l1791: db 0,0 dc 'CLX' l1796: db 0,0 dc 'RUN' l179b: db 0,0 dc 'CHN' l17a0: db 0,0 dc 'FL0' l17a5: db 0,0 dc 'FIL' l17aa: db 0,0 dc 'PAT' db 0,0 dc 'PA2' db 0,0 dc 'PRU' l17b9: db 0,0 l17bb: dc 'ST1' db 0,0 dc 'ST2' db 0,0 dc 'ST3' db 0,0 dc 'ST4' db 0,0 dc 'ST5' db 0,0 dc 'ST6' db 0,0 dc 'INI' db 4,0 ; ; End of table 2 ; l17de: dw 0 errcnt: db 0 ; Error count l17e1: db 0 l17e2: db 0 conflg: db 0 ; Log device flag [0 is printer] l17e4: db 0 l17e5: db 0 DSIZE: dw 0007h CSIZE: dw 0014h _stat1: db 00000000b ; Main option _stat2: db 00000000b ; Compiler option top.data: dw 0 ; As negated value l17ee:: ;; dw l7f33 ; Top of heap ??? data.lo: dw l7f33 heap.hi: dw $-$ heap.lo: dw $-$ data.hi: dw $-$ ; Top of memory ; ; Token : COMMON ; l17f8:: ld a,(l19a1) ; Test error or a jp nz,prc.err ; .. yeap, process it call get.token cp 00bh ld hl,l12d9 jp nz,l1828 call get.new.token ld a,@@COM ld (l23e1),a ; Set mode call get.new.token cp 0f2h ld a,NULL ld (l23e1),a ; .. reset mode ld a,1 jp nz,prc.err ; .. syntax call vrf.token db 00bh inc hl inc hl inc hl l1828: ld (l19a4),hl l182b: call get.new.token cp 0efh jp nz,l1848 push hl call l6521 jp c,l187c pop hl l183b: call l1870 call l18b3 call l2c49 ret nz jp l182b l1848: cp 0f0h ld a,1 jp nz,prc.err ; Syntax error push hl call get.token cp 0eeh call z,get.new.token pop hl call vrf.token db 0e5h push hl ld de,l0007 add hl,de ld a,(hl) pop hl or a ld a,21 jp z,prc.err ; COMMON not dimensioned call l1882 jp l183b l1870: inc hl inc hl ld a,(hl) xor 10h jp z,l187c ld (hl),a dec hl dec hl ret l187c: pop bc ld a,22 jp prc.err ; .. duplicate COMMON l1882: push hl ld de,l0005 add hl,de ld e,(hl) inc hl ld d,(hl) push de dec hl ld b,h ld c,l ld hl,l19a2 l1891: ld e,(hl) inc hl ld d,(hl) ld a,c cp e jp nz,l189e ld a,b cp d jp z,l18a2 l189e: ex de,hl jp l1891 l18a2: pop de ld (hl),d dec hl ld (hl),e pop hl ret l18a8: ld a,(l19a1) ; Test error or a ret nz ; .. yeap ld de,l19a2 jp l18b8 l18b3: ex de,hl ld hl,(l19a4) ex de,hl l18b8: ld bc,l0005 add hl,bc xor a ld (hl),a inc hl ld (hl),a dec hl ld b,h ld c,l ex de,hl l18c4: ld e,(hl) inc hl ld d,(hl) ld a,d or e jp z,l18d0 ex de,hl jp l18c4 l18d0: ld (hl),b dec hl ld (hl),c ret ; ; ; l18d4: ld b,a ld hl,l19a1 ld a,(hl) ; Test error or a ld a,b ret nz ; .. yeap cp 6ah jp c,l18e4 cp 73h ret c l18e4: ld (hl),14h push af call l18f2 call l14b9 ; Give header to file call l334b pop af ret ; ; ; l18f2: ld hl,l0000 push hl ld (l19a6),hl ld hl,l19a2 call l1933 ld hl,(l123d) l1902: ld a,h or l jp z,l190f push hl ld a,(hl) inc hl ld h,(hl) ld l,a jp l1902 l190f: pop hl ld a,h or l ret z ld (l19a6),hl ld de,l0005 add hl,de ex de,hl ld hl,(DSIZE) ; Get data address push hl ; .. save ld hl,0 ld (DSIZE),hl ; Set temporary zero ex de,hl call l1933 call l1958 ; Output COMMON size pop hl ld (DSIZE),hl ; Reset data address jp l190f ; ; ; l1933: ld a,(hl) inc hl ld h,(hl) ld l,a l1937: ld a,h or l ret z dec hl ld b,(hl) dec hl ld c,(hl) push hl call l2b15 ex de,hl pop hl ld (hl),e inc hl ld (hl),d inc hl ex de,hl ld hl,(l19a6) ld b,h ld c,l ex de,hl ld e,(hl) ld (hl),c inc hl ld d,(hl) ld (hl),b ex de,hl jp l1937 ; ; Output COMMON size ; l1958: ld hl,(DSIZE) ; Get data address ex de,hl ld hl,(l19a6) ; Get COMMON pointer push hl ld bc,l0005 add hl,bc ld (hl),e ; .. save value inc hl ld (hl),d pop hl call l1971 ; Build name of COMMON ld bc,0101b jp RELITEM ; Give common size ; ; Build name of COMMON ^HL ; l1971: ld bc,l19a8 ; Init buffer push bc l1975: dec hl ld a,(hl) ; .. unpack ld (bc),a inc bc or a jp p,l1975 pop hl ; Get back buffer ld (BFIELD),hl ; .. for address ret ; ; Select COMMON block ; l1982: push hl push de ld e,(hl) inc hl ld d,(hl) ld hl,(l19ae) call l2375 jp z,l199e ex de,hl ld (l19ae),hl push bc call l1971 ; Build name of COMMON ld c,0001b call RELITEM ; Select common block pop bc l199e: pop de pop hl ret ; l19a1: db 0 l19a2: dw 0 l19a4: dw 0 l19a6: dw 0 l19a8: ds $COMlen l19ae: dw 0 ; ; Fetch current token ; l19b0: push bc push de ld hl,(l23f5) ; Get line pointer ex de,hl call l19c1 ; .. get token ex de,hl ld (l23f5),hl ; .. save new pointer ex de,hl pop de pop bc ret ; ; ; l19c1: xor a ld (l2622),a ld a,(de) ; Test end of line and a call z,l20e9 ; .. get new line if so ld hl,l23e1 ld a,(hl) cp @@DAT ; Test DATA or %INCLUDE jp z,l1a6b ; .. yeap call skpblnk ; Skip blanks ld a,(hl) cp 6 ; Test ???? jp z,l1a6b ex de,hl ld (l23e6),hl ex de,hl call l1ee2 jp c,l1a97 cp 0ffh jp z,l1a91 cp '"' jp z,l1cf0 call l1eee jp c,l1a9f ld a,h add a,a jp c,l1a14 ; Letter found jp m,l1ca8 ; Digit found inc de add a,a call m,l1c51 ; Relation found ld a,h and 0fh ld h,a ld a,l cp 0ebh ; Test ' jp z,l1a59 cp 0ech ; Test _ jp z,l1a54 ret l1a14: call l1aa7 jp nz,l1fe5 ld a,(de) cp '$' jp nz,l1a28 inc de ld a,(hl) and 7fh ld (hl),a inc hl ld (hl),0a4h l1a28: push hl push de call tokenize ; .. tokenize pop de pop bc jp c,l1a38 cp 06fh ; Test rem jp z,l1a59 ; .. yeap ret l1a38: ld a,(l25f6) ; Get character and NoMSB cp '%' ; Test %INCLUDE jp nz,l1a45 ld a,096h ret l1a45: ld a,(bc) cp 0a4h jp nz,l1fe5 dec bc dec de ld a,(bc) or 80h ld (bc),a jp l1fe5 l1a54: xor a ld (de),a jp l19c1 l1a59: call l1ee2 inc de jp nc,l1a59 dec de and a jp nz,l1a97 call l20e9 ; Get line jp l1a59 l1a6b: call l1ee2 jp c,l1a97 ld h,a cp 0ffh jp z,l1a91 inc de cp '"' jp nz,l1a82 ld hl,l23e2 inc (hl) ld h,a l1a82: cp ':' ld a,0f5h ret nz ld a,(l23e2) rra ld a,0f5h ret c ld a,0a2h ret l1a91: inc de ld a,(de) inc de jp l1f93 l1a97: and a jp z,l19c1 inc de add a,0a1h ret l1a9f: call err.code ; Syntax error db 1 inc de jp l19c1 l1aa7: ld hl,l25f6 ; Set buffer ld bc,40*256+0 ld a,(de) call toupp ; Get upper case cp '%' jp z,l1ae3 cp 'F' ; Test FN jp nz,l1ad7 ld (hl),a inc hl inc de dec b ld a,(de) call toupp ; Get upper case cp 'N' jp nz,l1ad7 inc b ld (hl),a inc hl inc de inc c call skpblnk ; Skip blanks ld a,(de) call isalph ; Test letter jp c,l1aea ; .. nope l1ad7: ld a,(de) cp '.' jp z,l1ae3 call isalfnum ; Test letter or number jp c,l1aea ; .. nope l1ae3: ld (hl),a inc hl inc de dec b jp nz,l1ad7 l1aea: dec hl ld a,(hl) or 80h ld (hl),a ld a,(_stat2) ; Get compiler option and 01000000b ; .. test /4 lexical conventions push af jp z,l1b11 ; .. nope ld a,(l23e1) cp @@CAL ; Test CALL or DEF jp z,l1b11 cp @@COM ; .. or COMMON jp z,l1b11 ld hl,l25f6+1 ; Init pointer ld a,c add a,a call adda ; HL+ACCU ld a,(hl) or MSB ; Set end ld (hl),a l1b11: ld a,(l23e1) cp @@COM ; Test COMMON jp nz,l1b20 ld hl,l25fb ld a,(hl) or 80h ld (hl),a l1b20: ld hl,l25f5 ld b,0 l1b25: inc hl inc b ld a,(hl) or a jp p,l1b25 ld a,b ld (l25f5),a pop af ret ; ; Test letter or number in Accu - Carry set says no ; isalfnum: cp '0' ; Simple test ret c cp '9'+1 ccf ret nc ; ; Test letter in Accu - Carry set says no ; isalph: call toupp ; Get upper case cp 'A' ret c cp 'Z'+1 ccf ret ; ; Tokenize source line (MS lexical) ; lextoken: ld bc,basline ; Init line pointer ld h,b ld l,c ld a,(scanmode) ; Get index call l4c9f db l1b54-$ ; 0 : Tokenize line db l1bdf-$ ; 1 : DATA db l1c2b-$ ; 2 : REM db l1bf6-$ ; 3 : " in DATA db l1c14-$ ; 4 : " - String db l1c09-$ ; 5 : %INCLUDE ; ; Tokenize line ; l1b54: xor a ld (scanmode),a ; Force new parse call ld.line ; Get from line jp z,l1c31 ; .. end of line cp '''' ; Test remark jp z,l1c22 call toupp ; Get upper case ld de,l58f9 cp '%' ; Test %INCLUDE jp z,l1b8f ; .. yeap, set pointer cp 'A' ; Test start A..Z jp c,l1b78 cp 'Z'+1 jp c,l1b82 l1b78: ld (bc),a ; .. else save what we got inc bc cp '"' ; Test string jp nz,l1b54 ; .. nope, loop on jp l1c14 l1b82: add a,a ex de,hl ld hl,l58c5-2*'A' ;;l5843 call adda ; HL+ACCU ld a,(hl) ; Fetch pointer inc hl ld h,(hl) ld l,a ex de,hl ; ; Test keyword ; l1b8f: push bc ld (scanptr),hl ; Freeze line pointer l1b93: ld a,(de) ; Get from list and NoMSB ; Test end jp z,l1bd0 ; .. yeap, no match ld b,a ld a,(hl) call toupp ; Get upper case cp b ; Compare jp z,l1baf ; .. hit it ld hl,(scanptr) ; .. get back scan pointer l1ba5: ld a,(de) inc de ; .. fix for end of keyword and a jp p,l1ba5 inc de jp l1b93 ; .. retry l1baf: ld a,(de) ; Get from list and a inc de inc hl jp p,l1b93 ; .. still more ld a,0ffh pop bc ld (bc),a ; Indicate keyword follows inc bc ld a,(de) ld (bc),a ; .. save keyword inc bc cp 06fh ; Test REM jp z,l1c24 cp 056h ; .. DATA jp z,l1bda cp 070h ; .. %INCLUDE jp z,l1c04 jp l1b54 ; ; -> No BASIC keyword match ; l1bd0: ld hl,(scanptr) ; Get back scan pointer dec hl pop bc ld a,(hl) ; Get character inc hl jp l1b78 ; .. save ; ; -> Found DATA ; l1bda: ld a,1 ld (scanmode),a ; Set mode ; ; Process DATA ; l1bdf: call ld.line ; Get next character jp z,l1c31 ; .. end of line ld (bc),a ; Unpack it inc bc cp '"' ; Test string jp z,l1bf6 sub ':' ; .. or statement separator jp nz,l1bdf dec bc ; .. fix token pointer dec hl jp l1b54 ; .. restart ; ; -> Found " in DATA ; l1bf6: call get.str ; Sample string jp nz,l1bda ; .. still more in line ld a,3 ld (scanmode),a ; .. set mode jp l1c48 ; .. close line ; ; -> Found %INCLUDE ; l1c04: ld a,5 ld (scanmode),a ; Set mode ; ; Process %INCLUDE ; l1c09: call ld.line ; Get next character jp z,l1c31 ; .. end of line ld (bc),a ; .. unpack inc bc jp l1c09 ; .. till end ; ; -> Found " -- string ; l1c14: call get.str ; Sample string jp nz,l1b54 ; .. there is more in line ld a,4 ld (scanmode),a ; Change mode jp l1c48 ; ; -> Found ' -- REM ; l1c22: inc bc ; Fix token pointer inc bc ; ; -> Found REM ; l1c24: ld a,2 ld (scanmode),a ; Set rem dec bc ; .. fix token pointer dec bc ; ; Process REM ; l1c2b: call ld.line ; Get character jp nz,l1c2b ; .. until end of line ; ; -> Found LF or CR ; l1c31: sub cr ; Test return jp nz,l1c48 ; .. nope ld (scanmode),a dec a ld (bc),a ; Set toke follows inc bc ld a,0a2h ld (bc),a ; .. set new line inc bc ld a,0ffh ld (bc),a inc bc ld a,0a3h ld (bc),a inc bc l1c48: xor a ld (bc),a ; .. close token line ld de,basline ; Return line pointer ret ; scanmode: db 0 scanptr: dw 0 ; ; Get relator ; l1c51: push hl ld a,l ; Get relator sub _eq ; Strip off offset add a,a ; Shift into upper bits add a,a add a,a add a,a ld c,a call skpblnk ; Skip blanks ld a,(de) call l1efd jp c,l1c7d ld a,h and 00100000b ; Test relation jp z,l1c7d ld a,l sub _eq ; Strip off offset add a,c ; Combine the bits ld hl,l1c7f call cp.8.16 ; Find in table jp nz,l1c7d ; .. nope ld a,(hl) ; .. get values inc hl ld h,(hl) ld l,a ex (sp),hl inc de l1c7d: pop hl ret ; ; ; l1c7f: db 16*(_lt-_eq)+(_gt-_eq) ;; 034h db 012h,007h ; <> db 16*(_gt-_eq)+(_lt-_eq) ;; 043h db 012h,007h ; >< db 16*(_lt-_eq)+(_eq-_eq) ;; 030h db 013h,007h ; <= db 16*(_gt-_eq)+(_eq-_eq) ;; 040h db 016h,007h ; >= db 16*(_eq-_eq)+(_gt-_eq) ;; 004h db 016h,007h ; => db 16*(_eq-_eq)+(_lt-_eq) ;; 003h db 013h,007h ; =< db null ; ; Sample string - Zero set indicates end of line ; get.str: call ld.line ; Get next character jp nz,l1c9f ; .. there is more cp lf ; Test line feed ret z ; .. exit if so ld (hl),cr ; Set return ld a,'"' l1c9f: ld (bc),a ; .. unpack inc bc cp '"' ; .. till string delimiter jp nz,get.str or a ret ; ; ; l1ca8: ld a,(l23e1) cp @@ON ; Test ON.. or GOSUB jp z,l1cc2 ex de,hl ld a,2 ld (l1376),a call l5669 ld a,0 ld (l1376),a ex de,hl jp l2f2e l1cc2: ld hl,0 ; Init result l1cc5: ld a,(de) ; Get character and NOMSB ; Strip off hi bit sub '0' ; Make binary jp c,l1cec ; That's all cp 9+1 ; Verify 0..9 jp nc,l1cec inc de push de push af ex de,hl inc de ; Old +1 call l4c6c ; Old *10 ld a,1 call c,prc.err ; Syntax error pop af ld de,-10 ;;lfff6 add hl,de ; Subtract early 1 ld e,a ld d,0 add hl,de ; Insert new digit pop de jp l1cc5 l1cec: ld a,0f3h ; Return token and a ret ; ; ; l1cf0: ld bc,l0000 ld hl,l1de2 push hl inc de l1cf8: call l1ee2 jp nc,l1d0c or a jp nz,l1d1d push bc push hl call l20e9 ; Get line pop hl pop bc dec de ld a,0ah l1d0c: inc de cp '"' jp z,l1d1d ld (hl),a inc hl inc c jp nz,l1cf8 dec c call err.code ; String constant too long db 19 l1d1d: ex de,hl ex (sp),hl ex de,hl ld hl,(l1233+4) ld a,c cp 5 jp c,l1d33 ld a,(_stat1) ; Get option xor 00010000b ; Toggle /S flag and 00010100b ; Test ???? jp z,l1d86 l1d33: push hl ld a,7 call adda ; HL+ACCU ld a,c cp (hl) jp nz,l1d4f or a jp z,l1d80 inc hl push bc push de push hl call cmp.str ; Compare strings pop hl pop de pop bc jp z,l1d80 ; .. match l1d4f: pop hl ld a,(hl) inc hl ld h,(hl) ld l,a or h jp nz,l1d33 push bc push de ld a,8 add a,c ld c,a ld a,b adc a,b ld b,a ld hl,l1233+4 xor a call l2c96 pop de pop bc dec hl dec hl push hl inc hl inc hl ld (hl),0eeh inc hl ld (hl),7 inc hl ld (hl),' ' inc hl inc hl inc hl ld (hl),c inc hl ld a,c ; Get length call move ; .. move DE->HL l1d80: pop hl inc hl inc hl pop de ld a,(hl) ret l1d86: ld hl,(CSIZE) ; Get code address push hl push de push bc ld b,0c3h call put.cons ; Give sequence c3xxxx ld bc,l0006 add hl,bc pop bc push hl add hl,bc ld (CSIZE),hl push bc ex de,hl ld b,1 call l7de0 pop hl ld b,l call put.cons ; .. give byte pop de ld b,1 call l7de0 ex de,hl pop hl l1daf: ld a,e or d jp z,l1dbd ld b,(hl) inc hl dec de call put.cons ; Give byte jp l1daf l1dbd: ld bc,l000a xor a ld hl,l1233+4 call l2c96 dec hl dec hl pop de inc de inc de inc de push hl inc hl inc hl ld (hl),0eeh inc hl ld (hl),7 inc hl ld (hl),8 inc hl ld (hl),e inc hl ld (hl),d inc hl ld (hl),2 jp l1d80 l1de2: ds 256 ; ; ; l1ee2: ld a,(de) cp 3 ret ; ; Get next character from source line ^HL ; Zero indicates end of line ; ld.line: ld a,(hl) ; Get character inc hl cp cr ; Test end ret z cp lf ret ; ; - C set says no success ; ; 1xxx.xxxx A..Z ; x1xx.xxxx 0..9 ; xx1x.xxxx < > = / ; l1eee: ld h,a ld a,(_stat2) ; Get compiler option and 01000000b ; .. test /4 lexical conventions ld a,h jp nz,l1efd ; .. yeap ld h,10000000b cp '%' ret z l1efd: call toupp ; Get upper case ld h,01000000b cp '9'+1 jp nc,l1f0a cp '0' ret nc l1f0a: ld h,10000000b cp 'Z'+1 jp nc,l1f14 cp 'A' ret nc l1f14: ld hl,l1f23 call cp.8.16 ; Find in table ld a,(hl) ; .. get it inc hl ld h,(hl) ; Get mask ld l,a ret z ; .. hit scf ; Indicate not found ld h,00000000b ret ; ; ; l1f23: db '+' db 0eh,08h db ',' db 0eah,00h db '-' db 0fh,09h db '(' db 0e4h,00h db ')' db 0e5h,00h db '*' db 0ah,0ch db '/' db 0bh,2ch db '<' db 14h,27h db '>' db 15h,27h db '=' db 11h,27h db ';' db 0e9h,00h db '^' db 17h,0eh db '\' db 0dh,0bh db '.' db 00h,40h db ':' db 0a2h,00h db '''' db 0ebh,00h db '#' db 0e8h,00h db '&' db 00h,40h db '_' db 0ech,00h db '[' db 0e6h,00h db ']' db 0e7h,00h db '@' db 0edh,00h db null ; ; ; l1f66:: push af sub 0bbh ; Strip off offset jp nc,l1f74 ; 0xBB..0xFF ld hl,l1609+3 ;;l160c call adda ; HL+ACCU pop af ret l1f74: ld hl,l1518 push bc ld b,a l1f79: dec b ; .. count down jp p,l1f80 ; .. while >= 0 pop bc pop af ret l1f80: inc hl ; Skip ??? inc hl inc hl inc hl inc hl ld a,(hl) ; Get length inc hl ld c,(hl) ; .. byte call adda ; HL+ACCU inc hl dec c ; Count down jp m,l1f80 ; .. while < 0 jp l1f79 ; .. loop ; ; ; l1f93: cp 0a4h jp c,l1f9e cp 0e4h ccf jp nc,l1f66 l1f9e: cp 009h ; Test range ccf ret nc cp 01fh ret nc ld hl,l1340 call cp.8.8 ; Find in table ld h,(hl) ; .. get value and a ret ; ; Tokenize line ; tokenize:: ld a,(l25f6) ; Get 1st character ld hl,l58f9 cp '%' ; Test %INCLUDE jp z,l1fc5 ; .. yeap add a,a ret c ld hl,l58c5-2*'A' ;;l5843 call adda ; HL+ACCU ld a,(hl) ; Fetch pointer inc hl ld h,(hl) ld l,a l1fc5: ld de,l25f6+1 ; Init pointer ld a,(hl) ; Get from table and a scf ret z ; .. no match l1fcc: ld a,(de) cp (hl) ; Compare jp nz,l1fdb ; .. no match inc de inc hl and a ; Test more jp p,l1fcc ; Yeap ld a,(hl) ; .. get token jp l1f93 l1fdb: ld a,(hl) inc hl and a jp p,l1fdb inc hl jp l1fc5 l1fe5: ld a,(l23e1) cp @@COM ; Test COMMON jp nz,l1ff7 push de ld bc,0*256+0f2h ;;l00f2 ld hl,l123d jp l205c l1ff7: cp 2 ld a,0f4h ret z ld c,0efh ld hl,l25f6 ; Init pointer ld a,(hl) cp 'F' jp nz,l2013 inc hl ld a,(hl) cp 'N' dec hl jp nz,l2013 ld c,0f1h inc hl inc hl l2013: ld a,(hl) and NoMSB ld hl,l2626-'A' ; .. get base call adda ; HL+ACCU ld b,(hl) ld a,(de) cp ' '+1 ; Test range jp c,l2033 cp '%'+1 jp nc,l2033 ld hl,l20e0 call cp.8.8 ; Find in table jp nz,l2033 ; .. nope ld b,(hl) ; .. get value inc de l2033: call skpblnk ; Skip blanks ld a,c cp 0f1h jp z,l2051 ld a,(l23e1) cp 7 ; Test ??? jp z,l2051 ld a,(de) cp '[' jp z,l204f cp '(' jp nz,l2051 l204f: inc de inc c l2051: push de ld a,(l25f6) ; Get character add a,a ld hl,l11ff-2*'A' ;;l117d call adda ; HL+ACCU l205c: push hl l205d: ld a,(hl) inc hl ld h,(hl) ld l,a or h jp z,l209d push hl dec hl ld de,l25f6 ; Get pointer l206a: ld a,(de) cp (hl) jp nz,l2099 and a inc de dec hl jp p,l206a pop hl push hl inc hl inc hl ld a,(hl) cp c jp nz,l2099 inc hl ld a,(hl) cp b jp nz,l2099 ld a,(l23e1) cp @@DEF ; Test DEF jp nz,l2092 inc hl ld a,(hl) add a,a jp p,l2099 l2092: pop hl inc hl inc hl pop de pop de ld a,c ret l2099: pop hl jp l205d l209d: ld a,c ld hl,l20d7 call cp.8.8 ; Find in table ld a,(l25f5) add a,(hl) ; .. add from table pop hl push bc ld c,a ld b,0 ld a,(l25f5) call l2c96 pop bc push hl dec hl dec hl dec hl ld de,l25f6 ; Get pointer l20bb: ld a,(de) ld (hl),a inc de dec hl and a jp p,l20bb pop hl ld (hl),c inc hl ld (hl),b pop de inc hl ld a,(l23e1) cp @@DEF ; Test DEF jp nz,l20d3 ld (hl),'@' l20d3: dec hl dec hl ld a,c ret ; l20d7: db 0efh, 9 db 0f0h,12 db 0f1h,10 db 0f2h, 7 db null ; l20e0: db '%',4 db '#',6 db '!',5 db '$',7 db null ; ; Read line from source and tokenize it on MS lexical ; l20e9: xor a ld (echoflg),a ; Force echo ld (dspflg),a ; .. and display ld hl,basline ld a,cpyline-basline-2 call fgets ; Read source line push af jp nc,l20ff ; .. was regular line ld (hl),lf ; .. set end of line inc hl l20ff: ld (hl),null ; .. close it ld a,cpyline-basline ld hl,cpyline ld de,basline call move ; Move DE->HL pop af ld a,7 call c,prc.err ; .. line too long ld a,(enaLST) ; Test list enabled or a ; Test /L call nz,echoline ; .. echo source line if so ld a,(_stat2) ; Get status and 01000000b ; .. test /4 lexical conventions jp nz,lextoken ; .. yeap, tokenize ld de,basline-1 ; Init pointer l2124: inc de ld a,(de) ; Get character cp lf ; Test end of line jp z,l2137 ; .. yeap, close it cp cr ; Test return jp nz,l2124 ; .. nope, skip on ld a,1 ld (de),a ; Set end sequence 0x01 and 0x02 inc de inc a ld (de),a inc de l2137: xor a ld (de),a ; Close line ld de,basline ; Return line pointer ret ; ; Skip label in ^DE ; ; *** NEVER CALLED ??? *** ; skplabel: ld a,(de) call isalfnum ; Test letter or number ret c ; .. nope inc de ; .. skip jp skplabel ; ; Skip blanks in ^DE ; l2146: inc de skpblnk: ld a,(de) ; Test blank cp ' ' jp z,l2146 ; .. yeap cp tab jp z,l2146 ; .. dtto. for tab ret ; ; Give address heading and source line ; echoline: ld hl,echoflg ld a,(hl) ; Test echo or a ret nz ; .. nope inc (hl) ; Disable echo .echoline: ld bc,0102h ;;l0102 call praddr ; Print addresses ld hl,cpyline ; Init line l2163: ld a,(hl) ; Get character from source inc hl cp cr ; Test return jp z,prnl ; .. new line if so cp lf ; .. same for line feed jp z,prnl call putchr ; .. print character jp l2163 ; ; Display line on devices ; dsp.line: call echoline ; Echo source line ld a,(F$LST) ; Test device inc a ret z ; .. skip console ld hl,conflg ld (hl),1 ; Set console push hl call echo.cons ; .. echo it pop hl ld (hl),0 ; Disable console ret ; ; Echo line on console if enabled ; echo.cons: ld hl,dspflg ld a,(hl) ; Test display or a ret nz ; .. nope inc (hl) ; Disable for the next time jp .echoline ; .. then echo it ; ; Print segment hex addresses ; praddr: ld hl,(CSIZE) ; Get code address ex de,hl ld hl,l23ea+1 call sthex ; .. build hex inc hl ex de,hl ld hl,(DSIZE) ; Get data address ex de,hl call sthex ; .. dtto. ld hl,l23ea jp prstrg ; Print ; ; Read source line into ^HL with length in Accu ; Carry set indicates too many characters ; fgets: push hl ; Save buffer push af ; Save length ld a,(l23e3) ; Get end of file and a jp nz,l21d4 ; EOF l21b6: call fgetc ; Get character jp c,l21d4 ; .. end of file jp z,l21b6 ; .. not normal character pop bc pop hl ld (hl),a ; .. save character inc hl cp cr ; Test end of line jp z,l21ef cp lf jp z,l21e4 l21cd: ld a,b dec a ; Test more jp nz,fgets scf ret l21d4: ld a,1 ld (l23e3),a ; Set end of file pop af pop hl ld (hl),cr ; .. set empty line inc hl ld (hl),lf inc hl sub 2 ; .. fix length ret l21e4: push af call fgetc ; Get character cp cr ; Test return call nz,stchr ; .. save if not pop af ret l21ef: call fgetc ; Get character cp lf ; Test new line jp z,l21fd ; .. yeap save it call stchr ; .. store if not jp l21cd l21fd: ld (hl),a inc hl ret ; ; Read character from source - C set indicates EOF ; fgetc: ld a,(l222d) ; Test buffered character or a jp z,l2215 ; .. nope xor a ld (l222d),a ; .. force read ld a,(l222e) ; Get buffered one cp eof ; Test end of file scf ret z or a ; .. fix return flag ret l2214: pop af l2215: call fget ; Get from file jp nc,l221e ; .. still more ld a,eof ; Return end of file ret l221e: push af cp 3 ; Test range jp c,l2214 ; .. try next pop af ret ; ; Save character from source file - suppress read ; stchr: ld (l222d),a ld (l222e),a ret ; l222d: db 0 l222e: db 0 ; ; Get character from selected file - C set indicates EOF ; fget: ld a,(incflg) ; Test source state or a jp z,sget ; .. fetch from source file call iget ; .. get from include file ret nc ; .. ok, still more call l4bcb xor a ld (incflg),a ; Disable include file jp fget ; .. get next ; incflg: db 0 ; ; Put character in Accu to console or printer ; putchr: push hl push de push bc push af ld a,(conflg) ; Test flag and a jp nz,l2258 ; .. console pop af call lput ; .. put to list file pop bc pop de pop hl ret l2258: pop af call conout ; .. put to console pop bc pop de pop hl ret ; l2260: db 'BAS' ; ; ; l2263: inc hl ld a,(hl) cp '9'+1 ret nc cp ' ' jp z,l2263 cp '0' ccf inc a dec a ret ; ; ; l2273: ld a,(l1375) cp 8 jp nc,l2280 sub 3 or a scf ret l2280: sub 3 or a ret ; ; ; l2284: dec d cp '-' ret z inc d cp '+' ret z dec hl ret l228e: ret l228f: call l2263 call toupp ; Get upper case cp 'O' jp z,l22a0 cp 'H' jp z,l22a0 dec hl l22a0: call l22ae ld a,1 call c,prc.err ; .. syntax error ex de,hl call l5174 ex de,hl ret ; ; ; l22ae: cp 'H' inc hl jp z,l4cd0 jp l4caa call err.code ; Syntax error db 1 pop de pop de ret l22be: pop af ld a,9 jp prc.err ; .. math overflow l22c4: push de ld de,l1382 call cmp.r ; Test HL=DE ld a,9 jp z,l22d2 ; .. yeap ld a,10 l22d2: pop de jp prc.err ; Math overflow/divide by zero l22d6: ret ; ; Process error code in Accu ; prc.err: push hl push de push bc push af call dsp.line ; Display line pop af push af cp 22+1 ; Test warning jp nc,l22f0 ; .. yeap, skip bump ld (l17e1),a ; .. save error number ld hl,errcnt inc (hl) ; .. bump error count jp nz,l22f0 dec (hl) ; .. truncate to max 255 l22f0: ld hl,l2622-1 ; Init pointer ld b,a ; .. save error number l22f4: inc hl ld a,(hl) ; Get from error field cp b ; .. test match jp z,l2351 ; .. yeap inc a ; .. or end of list jp z,l2351 dec a ; Test empty jp nz,l22f4 ; .. nope ld (hl),b ; .. save error number inc hl ld a,(hl) ; Test end next inc a jp z,l230b ; .. yeap ld (hl),0 ; .. clear it l230b: ld hl,(l23e6) ex de,hl ld hl,basline ; Init line pointer call ilstrg db tab,.tab l2317: ld a,l cp e jp z,l232b ld a,(hl) cp tab jp z,l2324 ld a,' ' l2324: call putchr ; Print character inc hl jp l2317 l232b: call ilstrg db '^',bell dc ' ' pop af push af add a,a ; .. double error for index ld hl,l23ae-2 ; Point to error code table call adda ; HL+ACCU call prstrg ; .. print call prnl ; Give new line ld a,(F$LST) ; Test device inc a jp z,l2351 ; .. console ld hl,conflg ld a,(hl) ld (hl),1 ; Set console or a jp z,l230b ; .. was not before l2351: xor a ld (conflg),a ; Set no console pop af pop bc pop de ld hl,(l23e4) ld a,h or l jp z,l2362 ex (sp),hl push hl l2362: pop hl scf ret ; ; Process immediate error ; err.code: ex (sp),hl ; Get callers address push af ld a,(hl) ; Fetch error number call prc.err ; .. process error inc hl pop af ex (sp),hl ; .. fix return address scf ret ; ; ; l2370: xor a ld (l17e1),a ; Clear error ret ; ; HL:DE ; l2375: ld a,h sub d ret nz ld a,l sub e ret ; ; Tell internal error ; intern.err: call ilstrg db cr,lf,bell,'Internal Error',cr,.lf jp l011a ; ; ; l2394: call ilstrg db cr,lf,bell,'Memory Overflow',cr,.lf jp l011a ; ; ; l23ae: dc 'SN' dc 'OM' dc 'SQ' dc 'TM' dc 'TC' dc 'BS' dc 'LL' dc 'UC' dc 'OV' dc '/0' dc 'DD' dc 'FN' dc 'FD' dc 'UF' dc 'WE' dc '/E' dc '/X' dc 'IN' dc 'LS' dc 'CO' dc 'CN' dc 'CD' ; dc 'ND' dc 'SI' l23de: db 0 l23df: dw 0 l23e1: db NULL l23e2: db 0 l23e3: db 0 ; End of file flag l23e4: dw 0 l23e6: dw 0 echoflg: db 0 dspflg: db 0 l23ea: db ' 0000 0000',.tab l23f5: dw basline basline: ds 255 cpyline: ds 255 l25f5: db 0 l25f6: db 0,0,0,0,0 l25fb: db 0,0,0,0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0 l2611: db 0,0,0,0,0,0 l2617: db 0 l2618: db 0,0,0,0,0,0,0,0,0,0 l2622: db 0,0,0,-1 l2626: ds 26,5 ; ; ; l2640: call l2662 ret c ld a,4 jp l2ece l2649: call l2662 ret c ld a,8 jp l2ece l2652: call l2662 ret c cp 4 ret z ld a,4 call l2ece ret c ld (hl),'"' ret ; ; ; l2662: push bc push de ld hl,(AESTK.base) ; Get stack base push hl ; .. save ld hl,(AESTK.ptr) ld (AESTK.base),hl ; Change address ld bc,l0000 call l268d call nc,pop.AESTK ; .. get from stack jp nc,l2682 push hl ld hl,(AESTK.base) ; Get current base ld (AESTK.ptr),hl ; .. for current pointer pop hl l2682: ex (sp),hl ld (AESTK.base),hl ; .. reset base pop hl pop de pop bc inc hl ld a,(hl) dec hl ret ; ; ; l268d: call chk.mem ; Verify enough memory ret c ; .. nope push bc call l298c pop bc l2696: ld a,1 jp c,prc.err ; .. syntax error call push.AESTK ; Push onto stack l269e: call get.token ; Get token cp 019h ; Test NOT scf jp z,l2696 cp 009h ccf ret nc cp 1fh ret nc ld l,a ld a,b cp h ret nc push bc ld b,h ld c,l call get.new.token call l268d ld a,c call nc,l2e22 pop bc ret c jp l269e l26c4: ex de,hl cp 0b0h ld b,'''' jp z,l2780 push af call vrf.token db 0e4h jp c,l3347 call l2662 jp c,l3347 call vrf.token db 0e5h jp c,l3347 pop af ld b,a cp 0b1h jp nc,l2761 sub 0a4h call caseswitch dw l2716 dw l2719 dw l271c dw l273b dw l2749 dw l2705 dw l2705 dw l2721 dw l2721 dw l2721 dw l2728 dw l2754 l2705: ld a,b add a,7ch ld b,a inc hl ld a,(hl) dec hl cp 7 jp z,l2787 l2711: call err.code ; Type mismatch db 4 ret l2716:: ld a,4 _LD.BC l2719: ld a,5 _LD.BC l271c: ld a,6 jp l2ece l2721: ld a,b add a,81h ld b,a jp l2780 l2728: ld b,'/' inc hl ld a,(hl) dec hl cp 4 jp z,l2787 ld a,5 call l2ece ret c jp l2787 l273b: inc hl ld a,(hl) ld b,'''' cp 7 jp nz,l2780 ld b,'(' jp l2780 l2749: ld a,8 call l2ece ret c ld b,')' jp l2787 l2754: inc hl ld a,(hl) ld b,'*' dec hl cp 7 jp nz,l2787 jp l2711 l2761: ld a,b sub 0b1h ld l,a add a,a add a,l ld b,a ld hl,l1243 call l2ba9 push hl inc hl ld (hl),4 ex de,hl ld hl,l0006 add hl,de ld (hl),b ld a,'+' ld bc,1*256+7 ;;l0107 jp l2794 l2780: ld a,b ld bc,0*256+5 ;;l0005 jp l2794 l2787: ld a,(de) and a jp nz,l278f ld e,l ld d,h inc de l278f: ld a,b push hl ld bc,1*256+7 ;;l0107 l2794: push af ld a,(de) ld (l279f),a pop af call l2b75 inc hl ld (hl),$-$ l279f equ $-1 ld a,(hl) dec hl and a ret ; ; ; l27a4: ld de,l0005 ex de,hl add hl,de ex de,hl ld a,(de) or a inc de jp z,l289a ld de,l1611 call cmp.r ; Test HL=DE jp nz,l27c3 ; .. nope push hl call get.token pop hl cp 0e4h jp nz,l2894 l27c3: call vrf.token db 0e4h ret c push hl call l2662 jp c,l3347 inc hl ex de,hl pop hl l27d2: push hl ld hl,l0000 add hl,sp ld (l2842),hl pop hl push hl ld bc,l0006 add hl,bc ex de,hl ld a,(de) and a jp p,l27f8 xor 80h cp (hl) jp z,l27f8 pop bc ex de,hl dec hl ld a,(hl) inc hl call adda ; HL+ACCU inc hl jp l27d2 l27f8: dec hl push hl dec de ld a,(de) ; Get value ld b,a add a,a ; Double byte request add a,7 ; .. fix ld c,a ld a,023h call ini.dat.0 ; .. init ??? data pop bc push hl push hl ld h,b ld l,c ld a,(de) inc de ld b,a jp l282f l2811: push hl ld hl,(l2842) push hl ld a,(de) and ' ' jp z,l2824 call get.token cp 0e8h call z,get.new.token l2824: call l2662 ex (sp),hl ld (l2842),hl pop hl jp c,l3345 l282f: ld a,(de) and 01000000b jp z,l2848 inc hl ld a,(hl) dec hl cp 7 jp nz,l2848 push hl ld hl,l153c ld ($-$),hl l2842 equ $-2 pop hl ld de,l153c+7 ;;l1543 l2848: ld a,(de) inc de and 1fh call l2ece ex de,hl ex (sp),hl ld (hl),e inc hl ld (hl),d inc hl pop de push hl call get.new.token pop hl cp 0e5h ; Test ) jp z,l2877 cp 0eah ; Test , jp z,l286c call err.code ; Syntax error db 1 jp l3346 l286c: dec b jp nz,l2811 call err.code ; Syntax error db 1 jp l3346 l2877: dec b jp z,l28a4 push de push hl call l2dff ex de,hl pop hl ld (hl),e inc hl ld (hl),d inc hl pop de ld a,(de) inc de and a jp m,l28a4 call err.code ; Syntax error db 1 jp l3346 l2894: ld hl,l1789 ld de,l1611+7 ;;l1618 l289a: push hl ld bc,0*256+7 ld a,023h call ini.dat.0 ; Init ??? data push hl ; .. save pointer l28a4: ld a,(de) ; Get byte pop de ; .. get pointer pop bc inc bc inc bc inc bc ld (hl),c ; Set linkage inc hl ld (hl),b ld hl,-4 add hl,de ; Fix pointer ld (hl),a ; .. save byte dec hl ; .. fix for start and a ret ; ; ; l28b5: push hl ld de,l0005 add hl,de ld a,(hl) and a jp z,l28c8 push hl call vrf.token db 0e4h pop hl jp c,l3347 l28c8: ld a,(hl) add a,a ld b,a add a,a add a,7 ld c,a ; .. set length inc hl ld e,(hl) inc hl ld d,(hl) ld a,d or e ld a,14 pop hl jp z,prc.err ; Function not defined push hl ld a,030h call ini.dat.0 ; Init ??? data ld a,b rra pop bc push hl push bc push de ld b,a ld a,b and a jp z,l292e l28ed: ex (sp),hl ld e,(hl) inc hl ld d,(hl) inc hl ex (sp),hl push de inc de ld a,(de) ld c,a ex de,hl call l2662 jp c,l3344 ld a,c call l2ece ex (sp),hl call l2ba9 ld (hl),1 ex de,hl ld (hl),e inc hl ld (hl),d inc hl pop de ld (hl),e inc hl ld (hl),d inc hl push hl call get.new.token pop hl cp 0eah ; Test , jp nz,l2923 dec b jp nz,l28ed jp l293e l2923: cp 0e5h ; Test ) ld a,1 jp nz,l2940 ; .. syntax error dec b jp nz,l293e l292e: pop de pop de ld (hl),e inc hl ld (hl),d pop hl inc de ld a,(de) ld de,-4 ;;lfffc add hl,de ld (hl),a dec hl and a ret l293e: ld a,1 l2940: call prc.err ; .. syntax rror jp l3345 l2946: call vrf.token db 0e4h ret c call get.token cp 0e8h jp z,l2974 call l31a2 ret c inc hl ld (hl),4 dec hl ex de,hl ld bc,1*256+7 ld a,031h call ini.dat.0 ; Init ??? data ld (hl),e ; Save address inc hl ld (hl),d ld de,-5 add hl,de ; .. fix pointer ld a,4 ld (hl),a ; Set ?? dec hl ; .. fix for start call vrf.token db 0e5h ret l2974: call l2d4d ret c call vrf.token db 0e5h ret c ld a,023h push af ; Set token ld de,l1782 push de ; .. address push hl ; .. parameter ld a,4 ld b,1 jp put.rec ; Put into data record ; ; ; l298c: call get.new.token cp 0eeh jp z,l2ba9 cp 0efh jp z,l2ba9 cp 0f0h jp z,l2b2b cp 0e4h jp z,l29d1 cp 0f1h jp z,l28b5 cp 019h ; Test NOT ld bc,0619h ;;l0619 jp z,l29e2 cp 00fh ; Test - ld bc,l0d09 jp z,l29e2 cp 00eh ; Test + jp z,l298c cp 099h ; Test VARPTR jp z,l2946 cp 0e4h ; Test ( ccf ret c cp 0a4h ret c cp 0bbh jp c,l26c4 jp l27a4 l29d1: call l2662 ret c push af call vrf.token db 0e5h jp c,l29df pop af ret l29df: pop af scf ret l29e2: call l268d ret c ld a,c call l2e22 jp pop.AESTK ; .. get from stack l29ed: call get.new.token ; Get new token cp 058h ; Test GOTO ret z cp 085h ; .. GO jp nz,l29fe call get.new.token cp 09bh ; .. TO ret z l29fe: ld a,1 jp prc.err ; .. syntax error ; ; ; l2a03: ld hl,(l138a) ; Fetch pointer ld (hl),80h ; .. set value inc hl ld a,(hl) ; Get next and a ; Test any set jp nz,l2a21 ; .. yeap push bc push de ex de,hl ld bc,51 ;;l0033 call alloc.up ; Allocate some memory ex de,hl ld (hl),e ; .. save link address inc hl ld (hl),d ex de,hl pop de pop bc ld a,10h inc hl l2a21: dec hl push hl ld (hl),00h ; Init chain inc hl ld (hl),00h inc hl ld (hl),00h inc hl ld (hl),40h dec a ld (l138a),hl ; Save pointer inc hl ld (hl),a ; .. set value pop hl ret ; ; Initialize data record (REC+2=00) ; ENTRY Accu holds token ; Reg B holds ??? ; Reg C holds number of bytes to be allocated ; ini.dat.0: and a ; Clear carry jp l2a3b ; ; Initialize data record (REC+2=01) ; ENTRY Accu holds token ; Reg B holds ??? ; Reg C holds number of bytes to be allocated ; ini.dat.1: scf ; Set carry l2a3b: push af push bc ld b,0 ; Clear hi call alloc.dwn ; Get some bytes pop bc pop af ld (hl),a ; Set value inc hl inc hl jp nc,l2a4b inc (hl) ; .. set 1 on carry l2a4b: inc hl inc hl ld (hl),b ; .. save byte inc hl ret ; ; Get token - take care of end of line ; get.new.token: call get.token ; Get token cp 0a2h ; Test end of line ret z ; .. yeap push af xor a ld (l23de),a ; Force new token pop af ret ; ; Allocate BC bytes of memory - Returns start of memory in ^HL ; alloc.up: push de ld hl,(heap.lo) ; Get to of heap ex de,hl ld hl,(data.lo) ; Get data pointer push hl add hl,bc ; .. add bytes requested ld (data.lo),hl ; .. save ld a,h ; Test enough room sub d jp c,l2a77 jp nz,l2394 ; .. no more memory ld a,l sub e jp nc,l2394 l2a77: pop hl pop de ret ; ; Build new chain entry ???? ; ENTRY Reg HL points to data area of data record ; l2a7a: dec hl ; .. fix for link pointer dec hl dec hl ; ; Build new chain entry ???? ; ENTRY Reg HL points to link area of data record ; l2a7d: ld de,-5 add hl,de ; Point to start of record ; ; Build new chain entry ???? ; ENTRY Reg HL points to start of data record ; l2a81: ld a,(l17e1) ; Test error and a ret nz ; .. yeap, skip check push hl ld a,(hl) ; Get token cp 03fh ; .. test ??? jp z,l2a9f cp 034h ; .. ??? jp z,l2a9f cp 060h ; .. DEF jp z,l2a9f ld a,(l12df) ; Get previous token cp 058h ; Test GOTO jp z,l3347 ; .. yeap l2a9f: ld a,(hl) ; Get token ld (l12df),a ; .. save ld bc,4 call alloc.dwn ; Allocate bytes ex de,hl ld hl,(l12dd) ; Get chain pointer ld (hl),e ; .. save link inc hl ld (hl),d ex de,hl ld (l12dd),hl ; .. set chain address inc hl inc hl pop de ld (hl),e inc hl ld (hl),d ld a,(l17e2) and a ret z jp l334b ; ; Allocate BC bytes of memory - Returns start of memory in ^HL ; alloc.dwn: push bc push de ld hl,(heap.lo) ; Get top of heap ld a,l sub c ; .. calculate new address ld l,a ld a,h sbc a,b ld h,a ld (heap.lo),hl ; Set new top ex de,hl ld hl,(data.lo) ; Get data pointer ld a,40 call adda ; HL+ACCU ld a,l sub e ; Test range ld a,h sbc a,d jp c,l2af9 ; .. data.lo+40 < heap.lo ld hl,0 ld (l12db),hl ; NIL chain ld hl,l12db ld (l12dd),hl ; .. set base call err.code ; Expression too complex db 5 ld hl,(heap.hi) ld (heap.lo),hl ; .. reset heap pop de pop bc ret l2af9: ld hl,(data.hi) ; Get data pointer ld a,l sub e ; .. test gap ld a,h sbc a,d ex de,hl jp c,l2b07 ld (data.hi),hl ; .. set new pointer l2b07: push hl l2b08: ld (hl),0 ; Clear memory inc hl dec bc ld a,b or c jp nz,l2b08 pop hl pop de pop bc ret ; ; ; l2b15: ld a,(l19a1) ; Test error or a ld h,b ld l,c ret z ; .. nope ld hl,(DSIZE) ; Get data address push hl add hl,bc ld (DSIZE),hl pop hl ld a,2 jp c,prc.err ; .. out of memory ret l2b2b: call l2fd5 ret c push hl inc hl inc hl ld a,(hl) rra ld a,001h jp nc,l2b3b ld a,002h l2b3b: ld bc,0*256+9 call ini.dat.0 ; Init ??? data pop de ld (hl),e ; Save address inc hl ld (hl),d ld bc,-5 add hl,bc ; Fix pointer inc de ld a,(de) ; Get byte push af ld (hl),a ; .. save into dec hl push hl call pop.AESTK ; .. get from stack push hl ; .. save ld a,032h ld bc,2*256+9 ;;l0209 call l2b75 pop af inc hl ld (hl),a dec hl push af ex de,hl ld bc,1*256+7 ;;l0107 ld a,033h call ini.dat.0 ; Init ??? data ld (hl),e ; Set address inc hl ld (hl),d ld de,-5 add hl,de ; Fix pointer pop af ld (hl),a ; .. save value dec hl ; .. fix for start and a ret ; ; ENTRY Accu holds token ; l2b75: call ini.dat.0 ; Init data l2b78: ld a,b ; Copy count ld b,h ; .. and data pointer ld c,l ex (sp),hl ; Get caller ld (l2b92),hl ; .. save pop hl ; .. get back pointer l2b80: sub 1 ; Count down jp c,l2b8d ; .. got it pop de ; .. get from outer space ld (hl),e ; .. save inc hl ld (hl),d inc hl jp l2b80 l2b8d: ld hl,-5 add hl,bc ; Reset pointer to start jp $-$ ; .. exit l2b92 equ $-2 ; ; ; l2b94: ld a,1 ld (l17e2),a ret ; ; ENTRY Accu holds token ; Reg B holds ??? ; Reg C holds ??? ; l2b9a: call ini.dat.1 ; Init data jp l2ba3 ; ; ENTRY Accu holds token ; Reg B holds ??? ; Reg C holds ??? ; l2ba0: call ini.dat.0 ; Init data l2ba3: call l2b78 jp l2a81 ; ; ENTRY Reg HL points to token line ; l2ba9: push bc push de ld b,1 ; Init value ld a,(hl) ; Get token inc hl cp 0eeh ; Test ?? jp z,l2bbd ; .. hit it inc b ; Fix value inc hl ; Skip for next ld a,(hl) ; Get byte dec hl rra ; Test bit jp nc,l2bbd inc b ; Fix value l2bbd: ld a,(hl) push af dec hl ex de,hl ld a,b ld bc,0*256+9 call ini.dat.0 ; Init ??? data ld (hl),e ; Set address inc hl ld (hl),d ld de,-5 add hl,de ; Fix pointer pop af ld (hl),a ; .. save byte dec hl ; .. fix for start and a pop de pop bc ret ; ; ; ;l2bd6: xor a ld (l2c18),a ld a,b add a,a ld e,a ld d,0 add a,7 ld c,a call ini.dat.1 ; Init ??? data jp l2bf7 ; ; Set up data record ; ENTRY Reg B holds parameter count (used as index here) ; ; Only if reg B<>0 ; ; Last (optional) parameter ; holds pointer ??? ; holds token ; put.rec.chn: xor a put.rec: ld (l2c18),a ; Save entry ld a,b ; Get value add a,a ; .. double it ld e,a ; .. for index ld d,0 add a,7 ; Fix length ld c,a call ini.dat.0 ; .. init ??? data l2bf7: add hl,de ; .. position within record ex de,hl add hl,sp ; .. and stack ex de,hl ld a,(de) ; Get address from stack ld (hl),a ; .. move into data record inc de inc hl ld a,(de) ld (hl),a dec hl ld a,b and a ; Test zero entry jp z,l2c10 ; .. yeap l2c07: pop de ; .. get from stack dec hl ld (hl),d ; .. save into data record dec hl ld (hl),e dec a jp nz,l2c07 l2c10: pop bc ; Clean stack ld de,-5 add hl,de ; Point to start of data pop af ld (hl),a ; .. save token ld a,$-$ ; Get entry byte l2c18 equ $-1 inc hl ld (hl),a ; .. save dec hl and a ret nz ; .. exit if not zero jp l2a81 ; ; ; l2c21: ld a,(hl) cp 1 scf ret nz push de push hl ld de,l0005 add hl,de ld e,(hl) inc hl ld d,(hl) ld a,(de) cp 0eeh jp nz,l2c45 inc de ld a,(de) cp 7 jp z,l2c45 ld hl,l0004 add hl,de ld a,(hl) pop hl pop de and a ret l2c45: pop hl pop de scf ret ; ; ; l2c49: call get.token sub 0eah and a ret nz call get.new.token xor a ret ; ; Get token and test new line or ELSE - Z flag set says yes ; l2c55: call get.token ; Get token ; ; Test token in ACuu for new line or ELSE - Z flag set says yes ; l2c58: cp 0a2h ; Test new line ret z cp 0a0h ; .. or ELSE ret ; ; ; l2c5e: ld a,(hl) cp 1 scf ret nz push de ex de,hl ld hl,l0005 add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(hl) cp 0f0h jp z,l2c81 cp 0eeh scf jp nz,l2c81 inc hl ld a,(hl) dec hl xor 7 sub 1 ld a,(hl) l2c81: ex de,hl pop de ret l2c84: ld a,(de) ld (hl),a ld a,l ld (de),a ld b,h inc de inc hl ld a,(de) ld (hl),a ld a,b ld (de),a inc hl ret l2c91: call vrf.token db 0eah ret ; ; ; l2c96: push af ex de,hl call alloc.up ; Get BC bytes pop af call adda ; HL+ACCU jp l2c84 ; ; Check enough memory for expression - Carry set indicates no ; chk.mem: push hl push de ld hl,-40 add hl,sp ; Get low address ex de,hl ld hl,(top.data) ; Get (negated) top add hl,de ; Verify some space remaining ccf pop de pop hl ret nc ; .. ok ld a,5 jp prc.err ; .. too complex ; ; ; l2cb6: ld a,(l1375) sub 1 jp nz,l2cc6 ld (l1367),a ld a,2 ld (l1375),a l2cc6: ld a,(l1375) ld b,0 cp 2 jp z,l2cd2 ld b,' ' l2cd2: push bc call l500d jp z,l2d4a jp p,l2ce3 pop af or 80h push af call l4ff2 l2ce3: ld a,(l1375) cp 2 jp z,l2d2c push af ld hl,l136c call l507b call l2273 jp nc,l2cfb call l5196 l2cfb: ld hl,l2d07 push hl call l5167 pop hl pop bc jp l2d48 l2d07: pop bc ld hl,(l1366) push hl ld a,b cp 4 jp z,l2d1b call l51b8 call l50fa jp l2d27 l2d1b: call l518c ld hl,l136c call l503e call l508d l2d27: pop hl and a jp nz,l2d48 l2d2c: pop af or '@' push af ld e,l ld d,h dec de ld a,l and e ld e,a ld a,h and d or e jp nz,l2d48 ld b,10h l2d3e: dec b add hl,hl jp nc,l2d3e pop af or b or 10h push af l2d48: pop af ret l2d4a: pop af xor a ret l2d4d: call get.token cp 0e8h call z,get.new.token jp l2649 ; ; ; l2d58: ld a,034h call l2dba jp l334b ; ; ; l2d60: ld de,l12bf+2 ld a,c l2d64: push de dec a jp nz,l2d64 call err.code ; Array not dimensioned db 23 call l3278 ret l2d71: inc hl ld a,(hl) dec hl cp 7 jp nz,l2d8c ld a,b add a,a jp p,l2d83 ld a,b or 8 ld b,a ret l2d83: call err.code ; Type mismatch db 4 ld a,5 call l2ece l2d8c: ld a,b and 8 jp z,l2d9b call err.code ; Type mismatch db 4 ld a,7 jp l2ece l2d9b: ld a,b and 0bfh ld b,a and ' ' jp z,l2da9 ld a,4 jp l2ece l2da9: ld a,b and 4 ret z inc hl ld a,(hl) dec hl cp 4 ret nz ld a,5 jp l2ece l2db8: ld a,058h l2dba: ld bc,0*256+7 call ini.dat.0 ; Init data ld (hl),e ; Save address inc hl ld (hl),d dec hl ; .. fix pointer jp l2a7d ; ; ENTRY Accu holds index ; l2dc7: push de ld d,a add a,a add a,d ld hl,l2ddb call adda ; HL+ACCU ld e,(hl) ; Fetch address inc hl ld d,(hl) inc hl ld a,(hl) ; .. and length ex de,hl pop de jp l2e0f ; ; ; l2ddb: dw l12e8 db 9 dw l12f1 db 9 dw l12fa db 9 dw l1303 db 9 ; ; ; l2de7: ld hl,l12e8 ld a,9 jp l2e0f ; ; ; l2def: ld hl,l12f1 ld a,9 jp l2e0f ; ; ; l2df7: ld hl,l130c ld a,9 jp l2e0f ; ; ; l2dff: ld hl,l1315 ld a,9 jp l2e0f ; ; ; l2e07: ld hl,l131e ld a,9 jp l2e0f ; ; Move data to heap ; ENTRY Reg HL points to block of data ; Accu holds length of block ; l2e0f: push bc push de ex de,hl ld c,a ld b,0 call alloc.dwn ; Allocate BC bytes push hl ld a,c ; Get length call move ; Move DE->HL pop hl pop de pop bc xor a ret ; ; ; l2e22: push bc push de push hl push af sub 9 ld hl,l2eb7 call adda ; HL+ACCU ld b,(hl) call pop.AESTK ; Get from stack call l2d71 ld a,b ld (l2ecd),a and a jp p,l2e48 pop af ld bc,1*256+7 push hl call l2b75 jp l2e77 l2e48: inc hl ld c,(hl) dec hl push hl call pop.AESTK ; Get from stack call l2d71 jp c,l2eb1 ld a,b and 8 jp nz,l2e6e inc hl ld a,(hl) dec hl cp c jp c,l2e6a ex (sp),hl call l2ece ex (sp),hl jp l2e6e l2e6a: ld a,c call l2ece l2e6e: push hl ld bc,2*256+9 call l2b75 pop af ld (hl),a l2e77: ex de,hl ld hl,l0005 add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a inc hl ld a,(hl) ex de,hl inc hl ld (hl),a ld a,(l2ecd) and 00010000b jp z,l2e8f ld (hl),4 l2e8f: ld a,(hl) dec hl cp 4 jp nz,l2e9e ld a,(hl) cp 0ah jp nz,l2e9e ld (hl),0ch l2e9e: cp 7 jp nz,l2eab ld a,(hl) cp 0eh jp nz,l2eab ld (hl),1eh l2eab: call push.AESTK ; Push onto stack jp l2eb3 l2eb1: pop hl pop hl l2eb3: pop hl pop de pop bc ret l2eb7: db 080h,000h,004h,020h,020h,040h db 000h,020h,050h,050h,050h,050h db 050h,050h,004h,020h,0a0h,020h db 020h,020h,020h,008h l2ecd: db 0 l2ece: inc hl cp (hl) jp z,l2eef cp 7 call z,l2ef2 push de push bc push af ld a,(hl) cp 7 call z,l2ef2 dec hl push hl ld bc,1*256+7 call l2b75 pop af pop bc pop de ld (hl),a ; ..save value inc hl ld (hl),a l2eef: dec hl ; .. fix for start and a ret ; ; ; l2ef2: call err.code ; Type mismatch db 4 ret l2ef7: ld hl,(l141c) inc hl ld a,(hl) ld (hl),0 dec hl and a jp nz,l2f17 push de push hl ld bc,155 ;;l009b call alloc.up ; Get BC bytes ex de,hl pop hl ld (hl),80h inc hl ld (hl),e inc hl ld (hl),d ex de,hl pop de ld a,1eh l2f17: ld (hl),2 inc hl inc hl inc hl ld (hl),e inc hl ld (hl),d inc hl ld (hl),'@' ld (l141c),hl dec a inc hl ld (hl),a ld de,-6 ;;Lfffa add hl,de xor a ret l2f2e: push bc push de ld a,(l1375) ld b,a ld de,l1366 cp 8 jp nz,l2f3f ld de,l1362 l2f3f: ld hl,l2f9f l2f42: inc hl inc hl inc hl inc hl ld a,(hl) inc hl cp b jp nz,l2f42 ld b,(hl) inc hl ld c,(hl) inc hl ld a,(hl) inc hl ld h,(hl) ld l,a push hl l2f55: ld a,(hl) inc hl ld h,(hl) ld l,a or h jp z,l2f78 push hl push de ld de,l0008 add hl,de pop de push bc push de ld b,0 call cmp.str ; Compare strings pop de pop bc pop hl jp nz,l2f55 ; .. no match inc hl inc hl pop de pop de pop bc ld a,(hl) ret l2f78: pop hl push bc push de ld b,0 ld a,8 add a,c ld c,a xor a call l2c96 pop de pop bc push hl ld (hl),0eeh inc hl ld (hl),b inc hl ld (hl),' ' inc hl inc hl inc hl inc hl push hl ld a,c ; Get length call move ; Move DE->HL call l2cb6 pop hl dec hl ld (hl),a pop hl l2f9f: pop de pop bc ld a,(hl) ret l2fa3: db 02h,04h db 02h,33h db 12h,04h db 05h,04h db 39h,12h db 08h,06h db 08h,3bh db 12h,01h db 08h,01h db 35h,12h db 0 ; ; Swap byte from table ; ENTRY Accu holds byte to be swapped ; EXIT Accu holds swapped byte ; Zero set on match ; l2fb8: push hl ld hl,l2fc2 call cp.8.8 ; Find in table ld a,(hl) ; .. swap byte pop hl ret ; ; ; l2fc2: db 5,4 db 4,2 db 7,3 db 6,8 db null ; ; ; l2fcb: call l3210 ret c ret z ld a,1 jp prc.err ; .. syntax error l2fd5: push hl ld bc,l0000 l2fd9: push bc call l2640 pop bc jp c,l30d1 inc bc ld a,(l17e4) and a jp z,l2ffa call push.AESTK ; Push onto stack call l2df7 call push.AESTK ; Push onto stack ld a,0eh call l2e22 call pop.AESTK ; Get from stack l2ffa: push hl call get.new.token cp 0eah ; Test , jp z,l2fd9 cp 0e7h ; Test ] jp z,l300d cp 0e5h ; Test ) jp nz,l30da l300d: ld h,b ld l,c add hl,hl add hl,sp ld e,(hl) inc hl ld d,(hl) ld hl,l0007 add hl,de ld a,(hl) and a call z,l2d60 ld a,c cp (hl) jp nz,l30e1 inc hl ld a,(hl) inc hl ld h,(hl) ld l,a inc hl inc hl ld b,c ld a,(_stat1) ; Get option rra ; .. test /D debug code jp c,l3078 ; .. yeap l3031: ex (sp),hl call push.AESTK ; Push onto stack ld a,b cp c ld a,0eh call nz,l2e22 pop hl dec c jp z,l3055 ld e,(hl) inc hl ld d,(hl) inc hl ex de,hl call l2ba9 call push.AESTK ; Push onto stack ld a,0ch call l2e22 ex de,hl jp l3031 l3055: pop hl push hl inc hl ld a,(hl) call l2fb8 ld l,a ld h,0 ld (l1366),hl ld a,2 ld (l1375),a call l2f2e call l2ba9 call push.AESTK ; Push onto stack ld a,0ch call l2e22 pop hl and a ret l3078: ld (l3096),hl ld a,b ; Get byte add a,a ; .. *2 ld b,a add a,a ; .. *2 add a,6 ; Fix length ld c,a ld a,024h call ini.dat.0 ; Init data ld c,b ; .. get length ld (l30e8),hl ; .. save pointer l308b: pop de ; .. get value ld (hl),e ; .. save inc hl ld (hl),d inc hl dec c ; .. count down dec c jp nz,l308b ld de,$-$ l3096 equ $-2 dec de dec de ld c,b ld b,0 ex de,hl add hl,bc ex de,hl l30a0: push hl ex de,hl dec hl ld d,(hl) dec hl ld e,(hl) ex de,hl call l2ba9 ex de,hl ex (sp),hl ld (hl),e inc hl ld (hl),d inc hl pop de dec c dec c jp nz,l30a0 pop de push de inc de ld a,(de) call l2fb8 ld (hl),a ld hl,(l30e8) ld de,-4 ;;Lfffc add hl,de pop de inc de ld a,(de) ld (hl),a dec de dec hl call push.AESTK ; Push onto stack ex de,hl and a ret l30d1: pop hl ld a,c sub 1 ld c,a ret c jp l30d1 l30da: call err.code ; Syntax error db 1 jp l30d1 l30e1: call err.code ; Bad subscript db 6 jp l30d1 l30e8: dw 0 ; ; Print bytes free ; prfree: ld hl,(data.lo) ; Get pointers ex de,hl ld hl,(data.hi) ld a,l sub e ; Calculate gap ld e,a ld a,h sbc a,d ld d,a jp nc,l30fd ; .. ok ld de,0 ; .. oops, nothing free l30fd: call prdec call ilstrg db ' Bytes Free',cr,.lf ret ; ; ; l3111: call l3210 ret c jp z,l3130 ld a,(l23e3) ; Get end of file and a ret nz ; EOF call get.token ; Get token cp 0a2h ; Test end of line ret z ld a,(_stat2) ; Get compiler option and 10000000b ; .. test /C line numbering relaxing jp nz,l0201 ; .. yeap ld a,1 jp prc.err ; .. syntax error l3130: ld a,(hl) rra ld a,3 call c,prc.err ; .. sequence error push hl inc hl inc hl inc hl ld e,(hl) inc hl ld d,(hl) ex de,hl ld (l1516),hl ex de,hl ld hl,(l1514) ld a,(_stat2) ; Get compiler option and 10000000b ; .. test /C line numbering relaxing push af jp z,l315a ; .. nope call cmp.r ; Test HL=DE ld a,3 jp z,l3166 ; .. sequence error jp l316a l315a: inc hl ld a,e sub l ld a,d sbc a,h dec hl dec de jp nc,l316a ld a,3 l3166: call prc.err ; .. sequence error ex de,hl l316a: ex de,hl ld (l1514),hl pop af call nz,l334b pop de ld a,03fh jp l2dba ; ; Get token from source ; get.token: ld a,(l23de) ; Test any here and a ld hl,(l23df) ret nz ; .. yeap call l19b0 ; .. get new one ld (l23de),a ld (l23df),hl ret ; ; Get value into reg HL from stack ; pop.AESTK: push de ld hl,(AESTK.base) ; Get base ex de,hl ld hl,(AESTK.ptr) call cmp.r ; Test HL=DE call z,intern.err ; .. same, should not occur dec hl ld d,(hl) ; .. fetch value dec hl ld e,(hl) ld (AESTK.ptr),hl ; .. set new pointer ex de,hl pop de ret ; ; ; l31a2: call get.new.token cp 0efh jp z,l31b4 cp 0f0h jp z,l31ba call err.code ; Syntax error db 1 ret l31b4: call l2ba9 jp l31be l31ba: call l2b2b ret c l31be: push af ld a,(hl) dec a ld (hl),a cp '2' jp nz,l31cf ld de,l0005 add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a l31cf: pop af ret ; ; Get token and verify against expected one ; vrf.token: ex (sp),hl push hl call get.new.token ; Get token pop hl cp (hl) ; Verify ld a,(hl) inc hl ex (sp),hl ret z ; .. ok push hl ld hl,l31e9 call cp.8.8 ; Find in table ld a,(hl) call prc.err ; .. syntax error pop hl ret ; l31e9: db 0e4h,1 db 0e9h,1 db 00fh,1 db 097h,1 db 058h,1 db 05bh,1 db 011h,1 db 0e5h,1 db 0eah,1 db 09bh,1 db 09eh,1 db 098h,1 db 00bh,1 db null ; ; ; l3204: call get.new.token cp 0eeh ret nz inc hl ld a,(hl) dec hl cp 4 ret ; ; ; l3210: _LD.A ; ; ; l3211: xor a push af ld a,@@ON ld (l23e1),a ; Set mode call get.token sub 0f3h and a ld a,NULL ld (l23e1),a ; Reset mode pop bc ret nz call get.new.token ld a,h or l jp nz,l322f cp b ret z l322f: ex de,hl ld hl,l141e l3233: ld a,(hl) inc hl add a,a jp nc,l3240 ld a,(hl) inc hl ld h,(hl) ld l,a jp l3233 l3240: jp m,l3257 inc hl inc hl ld a,(hl) cp e inc hl ld a,(hl) inc hl jp nz,l3233 cp d jp nz,l3233 ld de,-5 ;;Lfffb add hl,de xor a ret l3257: jp l2ef7 l325a: call get.token cp 0eah jp nz,l2de7 call get.new.token call l2640 ret c or 1 ret l326c: call l2662 ret c cp 7 ret z call err.code ; Type mismatch db 4 ret l3278: ld b,0 ld a,11 ld (l17e5),a ; Array already dimensioned ld (hl),c ex (sp),hl ld (l3309),hl ld a,c ld (l3318),a ld (l3319),a add a,a ld c,a call alloc.up ; Get BC bytes ex de,hl pop hl inc hl ld (hl),e inc hl ld (hl),d dec hl dec hl push hl dec hl dec hl dec hl dec hl dec hl ld bc,l0001 ld a,(hl) and 0c0h pop hl jp z,l32a9 dec bc l32a9: ex (sp),hl ld a,l ld (de),a inc de ld a,h ld (de),a inc de ex de,hl push hl ld a,b or c jp z,l32d1 ld hl,l0006 add hl,de ld e,(hl) inc hl ld d,(hl) ld a,d and e inc a call z,l330b ld a,d or e call z,l3313 call l4c77 call nz,l330b ld b,h ld c,l l32d1: pop de ld hl,l3318 dec (hl) pop hl jp nz,l32a9 ld a,b or c jp z,l3302 push hl ld de,-6 ;;Lfffa add hl,de ld a,(hl) call l2fb8 ld hl,l0000 l32eb: add hl,bc call c,l330b dec a jp nz,l32eb ld b,h ld c,l call l2b15 ex de,hl pop hl push hl dec hl dec hl dec hl ld (hl),d dec hl ld (hl),e pop hl l3302: ld a,(l3319) ld c,a ld b,0 jp l3309 l3309 equ $-2 l330b: call err.code ; Out of memory db 2 ld hl,l0000 ret l3313: call err.code ; Bad subscript db 6 ret l3318: db 0 l3319: db 0 ; ; Push reg HL onto stack ; push.AESTK: push de ex de,hl ld hl,(AESTK.ptr) ; Get current pointer ld (hl),e ; .. save value inc hl ld (hl),d inc hl push de ld (AESTK.ptr),hl ; Set new top ld de,l13cb+2*29+1 ;;l1406 ld a,e sub l ; Test in rnage ld a,d sbc a,h pop hl pop de inc hl ld a,(hl) dec hl ret nc ; .. yeap call err.code ; Too complex db 5 push hl ld hl,(AESTK.ptr) dec hl ; .. fix stack pointer dec hl ld (AESTK.ptr),hl pop hl ret ; ; ; ;l3343: pop hl l3344: pop hl l3345: pop hl l3346: pop hl l3347: pop hl ret l3349:: ;; pop de ret ; ; ; l334b: ld a,(l19a1) ; Get error or a ret z ; .. none ld hl,0 add hl,sp ; Copy stack ld (l3364),hl ; .. save ld hl,l3363 ld (l23e4),hl call l3383 call l5bc2 l3363: ld sp,$-$ ; Reset stack l3364 equ $-2 ld hl,(heap.hi) ; Reset heap pointer ld (heap.lo),hl ld hl,0 ld (l12db),hl ; Init a bit ld (l17e1),hl ld (l23e4),hl ld hl,l12db ; Reset chain pointer ld (l12dd),hl xor a ld (l12df),a ret ; ; ; l3383: ld bc,26 ;;l001a call alloc.dwn ; Allocate BC bytes ld (l12e2),hl ; .. save pointer ld hl,l12db ; Init chain pointer l338f: ld a,(hl) ; Get from link inc hl ld h,(hl) ld l,a or h ; Test NIL jp z,l33dd ; .. yeap ld (l3d76),hl ; .. save pointer inc hl inc hl push hl ld a,(hl) inc hl ld h,(hl) ld l,a push hl call l3d5d l33a5: call l3d69 jp z,l33b7 call l3488 call l348d call l3492 jp l33a5 l33b7: pop hl ld a,(hl) sub 059h jp z,l33bf dec a l33bf: call z,l33e4 call l3b8b ex de,hl ld a,(_stat1) ; Get option and 00100000b ; .. test /X error handling ld a,1ah ld hl,(l12e2) call nz,clrmem ; .. yeap, clear memory pop hl inc hl ld (hl),d dec hl ld (hl),e dec hl dec hl jp l338f l33dd: ld hl,(l12e2) ld a,1ah l33e2: ret l33e3: db 0 l33e4: ex de,hl push de call l3424 pop de ld hl,l0005 add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(hl) ex de,hl cp 11h ret c cp 17h ret nc ld a,(hl) cp 'Z' ld a,(de) call z,l3d1b ld bc,l0007 add hl,bc push hl add a,027h ld bc,2*256+11 call ini.dat.0 ; Init ??? data ld bc,l0005 ex de,hl add hl,bc ex de,hl ld a,4 call move ; Move 4 bytes DE->HL pop de ld a,2 call move ; Move 2 bytes DE->HL ld de,-11 add hl,de ; .. fix for start of pointer ret ; ; ; l3424: ld hl,l0007 add hl,de ld c,(hl) inc hl ld b,(hl) ld hl,(l3d76) ld a,(hl) inc hl ld h,(hl) ld l,a or h ret z inc hl inc hl ld e,(hl) inc hl ld d,(hl) ld a,(de) cp 'X' ret nz push hl ld hl,l0005 add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a ld (l3482),hl pop hl dec hl dec hl ld a,(hl) dec hl ld l,(hl) ld h,a or l ret z inc hl inc hl ld e,(hl) inc hl ld d,(hl) ex de,hl ld a,(hl) cp '4' ret nz inc hl inc hl inc hl inc hl inc hl ld a,(hl) cp c ret nz inc hl ld a,(hl) cp b ret nz ld hl,(l3d76) dec de dec de dec de ld a,(de) ld (hl),a inc de inc hl ld a,(de) ld (hl),a inc hl ld a,(hl) inc hl ld h,(hl) ld l,a ld a,0b3h sub (hl) ld (hl),a ld de,l0007 add hl,de ld bc,$-$ l3482 equ $-2 ld (hl),c inc hl ld (hl),b ret l3488: ld a,0 jp l3494 l348d: ld a,1 jp l3494 l3492: ld a,2 l3494: push hl ld hl,(l33e2) ld (l33e3),a ex (sp),hl call l34a4 pop af ld (l33e3),a ret l34a4: ld a,(hl) cp 4 jp c,l34ef push bc push de l34ac: push hl call l3d5d l34b0: call l3d69 jp z,l34bc call l34a4 jp l34b0 l34bc: pop hl ld b,0 call l34ca ld a,b and a jp nz,l34ac pop de pop bc ret l34ca: ld a,(l33e3) dec a jp z,l34e3 jp p,l34e6 call l34ef call l387b call l3545 call l35fe jp l3674 l34e3: jp l35cc l34e6: call l34ef call l387b jp l3674 l34ef: push de push hl ld a,(hl) cp 4 jp nc,l3512 add a,1 cp 2 jp nz,l353c ld de,l0005 add hl,de ld e,(hl) inc hl ld d,(hl) ld a,(de) cp 0eeh ld a,1 jp z,l353c ld a,2 jp l353c l3512: call l3d48 add a,a jp c,l351e l3519: ld a,5 jp l353c l351e: inc hl ld a,(hl) cp 5 jp z,l3519 cp 6 jp z,l3519 inc hl inc hl inc hl inc hl ld e,(hl) inc hl ld d,(hl) inc de inc de inc de ld a,(de) cp 3 jp nc,l353c ld a,3 l353c: pop hl pop de push hl inc hl inc hl inc hl ld (hl),a pop hl ret l3545: ld a,(hl) cp 4 ret c cp '2' jp z,l3d00 push bc push hl call l3d48 ld b,a rra jp c,l35c0 ld de,l0004 add hl,de ld c,(hl) inc hl ld e,(hl) inc hl ld d,(hl) inc hl ld a,(hl) inc hl ld h,(hl) ld l,a dec c call nz,l2c5e jp c,l35c0 ex de,hl call l2c5e jp c,l357c pop hl pop bc ld b,(hl) call l3999 ld b,(hl) ret l357c: ld a,b and ' ' jp z,l35c0 ex (sp),hl ld a,(hl) ex (sp),hl cp (hl) jp nz,l35c0 ld c,a push de ex de,hl ld hl,l0007 add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a call l2c5e jp c,l35bf ld (l35c8),hl pop hl ld (l35ca),hl ex de,hl pop de ld a,(hl) push hl inc hl ld b,(hl) ld hl,l35c3 ld (hl),a inc hl ld (hl),b dec hl call l3999 pop bc ex de,hl ld hl,l0007 add hl,bc ld (hl),e inc hl ld (hl),d ld h,b ld l,c pop bc ld b,(hl) ret l35bf: pop hl l35c0: pop hl pop bc ret l35c3: db 0,0,0,0,2 l35c8: dw 0 l35ca: dw 0 l35cc: ld a,(hl) cp 0bh ret nz ex de,hl ld hl,l0005 add hl,de ld c,(hl) inc hl ld b,(hl) inc hl ld a,(bc) ex de,hl cp (hl) jp nz,l35fb dec (hl) ld hl,l0008 add hl,bc ld b,(hl) dec hl ld c,(hl) ex de,hl dec hl ld (hl),b dec hl ld (hl),c ld bc,-5 ;;Lfffb add hl,bc call l3488 ex de,hl ld (hl),e inc hl ld (hl),d ld bc,-8 ;;Lfff8 add hl,bc l35fb: ld b,0 ret l35fe: ld a,(hl) cp 0ah jp z,l3607 cp 0ch ret nz l3607: ld (l366b),a push bc push hl ld de,l0005 add hl,de ld e,(hl) inc hl ld d,(hl) inc hl ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(de) cp 0eh scf call z,l2c5e jp c,l3668 ld (l3670),hl ld hl,l0005 add hl,de ld c,(hl) inc hl ld b,(hl) inc hl ld a,(hl) inc hl ld h,(hl) ld l,a call l2c5e jp c,l3668 ld (l3672),hl ex de,hl ex (sp),hl ex de,hl ld hl,l0005 add hl,de ld (hl),c inc hl ld (hl),b push de inc de ld a,(de) ld hl,l366c ld (hl),a dec hl call l3999 ex (sp),hl call l3488 ld b,h ld c,l pop hl pop de push hl ld hl,l0005 add hl,de ld (hl),c inc hl ld (hl),b inc hl pop bc ld (hl),c inc hl ld (hl),b ex de,hl pop bc ld b,(hl) ret l3668: pop hl pop bc ret l366b: db 0 l366c: db 0,0,0,2 l3670: dw 0 l3672: dw 0 l3674: ld a,(hl) sub 4 ret c cp '0' ret nc ex de,hl ld hl,l5b92 call adda ; HL+ACCU ld a,(hl) ld c,a ex de,hl add a,a ret c jp m,l3690 ld a,(l33e3) cp 2 ret nz l3690: ld a,c and 00100000b jp z,l36ad inc hl inc hl ld a,(hl) dec hl dec hl and 8 ret nz ex de,hl ld hl,l0007 add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a call l2c21 ex de,hl ret c ld d,a l36ad: ld a,c and 00001111b ; Mask bits ld c,d ex de,hl ld hl,l0005 add hl,de call caseswitch dw l36cd dw l36d9 dw l3705 dw l3731 dw l373f dw l374c dw l3793 dw l36ed dw l37ef dw l3817 l36cd: ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(hl) cp 9 jp z,l3839 ex de,hl ret l36d9: ex de,hl ld a,c and 00011111b ret z and 00001111b ld a,'!' jp nz,l384f ld a,c and a jp p,l3839 jp l3844 l36ed: ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(hl) cp 19h jp z,l3839 ex de,hl cp 11h ret c cp 17h ret nc call l3d1b ex de,hl ld (hl),a ld b,a ret l3705: ex de,hl push hl call l2def call push.AESTK ; Push onto stack ex de,hl inc hl inc hl ld a,(hl) inc hl ld h,(hl) ld l,a call push.AESTK ; Push onto stack ld a,0bh call l2e22 call pop.AESTK ; Get from stack call l3488 ex de,hl pop hl ld (hl),0ah ld bc,l0007 push hl add hl,bc inc b ld (hl),e inc hl ld (hl),d pop hl ret l3731: ld a,c and 7fh cp 'P' ex de,hl ret nz xor c jp p,l3839 jp l3844 l373f: ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(hl) cp 1 ex de,hl ret nz ex de,hl inc (hl) ld b,(hl) ret l374c: ld a,c and 60h ex de,hl jp z,l3839 xor 40h and 60h ret nz ex de,hl push bc inc hl inc hl ld a,(hl) inc hl ld h,(hl) ld l,a ld bc,l0005 add hl,bc ld a,(hl) inc hl ld h,(hl) ld l,a ld bc,l0006 add hl,bc pop bc ld a,(hl) inc hl ld h,(hl) ld l,a ld a,c and a call m,neg.hl ; -HL ld a,l cp 5 ex de,hl ret nc ld a,d and a ret nz ld b,e ld de,l0004 ex de,hl add hl,de dec (hl) inc hl inc hl inc hl ld (hl),b ex de,hl ld a,c rlca and 1 add a,1fh ld (hl),a ld b,a ret l3793: push bc push de inc hl inc hl ld e,(hl) inc hl ld d,(hl) ex (sp),hl ld a,(hl) ex (sp),hl cp 15h jp z,l37a7 cp 13h jp nz,l37e3 l37a7: ex de,hl call l2c21 ex de,hl jp c,l37e3 xor '@' and 60h jp nz,l37e3 ld hl,l0005 add hl,de ld bc,l0006 add hl,bc ld a,(hl) inc a jp nz,l37ca inc hl ld a,(hl) cp 7fh jp z,l37e3 l37ca: ex de,hl ld (l37ed),hl ld hl,l37e6 call l3999 ex de,hl pop bc ld hl,l0007 add hl,bc ld (hl),e inc hl ld (hl),d ld h,b ld l,c inc (hl) pop bc ld b,(hl) ret l37e3: pop hl pop bc ret l37e6: db 14,4 db 0,0 db 2 db 0f1h,12h l37ed: dw 0 l37ef: push de inc hl inc hl push hl ld a,(hl) inc hl ld h,(hl) ld l,a ld (l3815),hl inc de ld a,(de) dec de ld (l3811),a ld hl,l3810 call l3999 ex de,hl pop hl ld (hl),e inc hl ld (hl),d pop hl ld (hl),0eh ld b,(hl) ret l3810: db 9 l3811: db 0 db 0,0 db 1 l3815: dw 0 l3817: ld a,1ch ld (de),a ex de,hl call l3488 ex de,hl inc de ld a,(de) dec de push af ld bc,1*256+7 ld a,019h call ini.dat.0 ; Init NOT data ld (hl),e ; .. save address inc hl ld (hl),d ld de,-5 add hl,de ; Fix pointer pop af ld (hl),a ; Save byte dec hl ; Fix for start ld b,(hl) ; Get back entry (00011001b - 19h) ret ; ; ; l3837:: ;; inc hl inc hl l3839: ld de,l0005 add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a ld b,1 ret l3844: ld (hl),9 ld b,(hl) ld de,l0004 ex de,hl add hl,de dec (hl) ex de,hl ret l384f: ex de,hl ld (de),a ld b,a inc de ld a,(de) dec de ld (l3878),a ld hl,l0004 add hl,de dec (hl) inc hl inc hl inc hl ld a,c and 0fh ld (hl),a ex de,hl xor c ret p ex de,hl ld bc,1*256+7 ld a,009h call ini.dat.0 ; Init ??? data ld (hl),e ; Save value inc hl ld (hl),d ld de,-5 add hl,de ; Fix for byte ld (hl),$-$ ; .. save l3878 equ $-1 dec hl ; .. fix for start ret ; ; ; l387b: ld a,(hl) cp 4 ret c call l3d48 ld c,a add a,a ret c ret p add a,a jp p,l388d jp l38e2 l388d: push bc push hl push af and 80h jp z,l389a ld a,(hl) rra jp c,l38b1 l389a: ld de,l0005 add hl,de ld c,(hl) inc hl ld b,(hl) inc hl ld e,(hl) inc hl ld d,(hl) inc bc inc bc inc bc inc de inc de inc de ex de,hl ld a,(bc) cp (hl) jp c,l38b5 l38b1: pop af pop hl pop bc ret l38b5: dec bc dec bc dec bc dec hl dec hl dec hl ex de,hl ld (hl),b dec hl ld (hl),c dec hl ld (hl),d dec hl ld (hl),e pop af pop hl add a,a jp m,l38d4 inc hl inc hl ld a,8 xor (hl) ld (hl),a dec hl dec hl pop bc ld b,(hl) ret l38d4: ld a,(hl) ; Get ??? push hl ld hl,l1327 call cp.8.8 ; Find in table ld a,(hl) ; .. get new value pop hl ld (hl),a ; .. unpack pop bc ld b,(hl) ret l38e2: push bc push hl push af ld b,(hl) ld c,b and ' ' jp z,l38f0 ld a,c xor 1 ld c,a l38f0: ld de,l0005 add hl,de ld e,(hl) inc hl ld d,(hl) inc hl push hl ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(l33e3) and a jp nz,l390d ld a,(hl) cp b jp z,l396e cp c jp z,l396e l390d: ld a,(de) cp b jp z,l391d cp c jp z,l391d pop hl pop af pop hl pop bc jp l388d l391d: ld a,(l33e3) and a jp nz,l3930 ld a,b cp 0bh jp z,l3969 ld a,(de) cp 0bh jp z,l3948 l3930: ld b,h ld c,l ld hl,l0007 add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a inc hl inc hl inc hl inc bc inc bc inc bc ld a,(bc) cp (hl) jp c,l3969 jp z,l3969 l3948: ld hl,l0005 add hl,de pop bc dec bc dec bc ld a,(hl) ld (bc),a inc hl inc bc ld a,(hl) ld (bc),a push de push hl ld hl,-6 ;;Lfffa add hl,bc call l387b ex de,hl pop hl ld (hl),d dec hl ld (hl),e pop hl pop af pop af jp l3996 l3969: pop hl pop hl pop hl pop bc ret l396e: push bc ld bc,l0005 add hl,bc ld c,(hl) ld (hl),e inc hl ld b,(hl) ld (hl),d pop hl ex (sp),hl ld e,(hl) ld (hl),c inc hl ld d,(hl) ld (hl),b dec hl dec hl pop bc push hl ex de,hl ld a,b and 1 xor (hl) ld (hl),a call l387b ex de,hl pop hl ld (hl),d dec hl ld (hl),e pop af pop hl pop bc ld b,(hl) ret l3996: pop bc ld b,(hl) ret l3999: ld a,(hl) ld (l3a4d),a inc hl inc hl ld a,(hl) ld (l3a4e),a inc hl inc hl ld a,(hl) inc hl ld c,(hl) inc hl ld b,(hl) inc hl ld e,(hl) inc hl ld d,(hl) dec a jp nz,l39b4 ld d,b ld e,c l39b4: push de ld hl,l0005 add hl,bc ld c,(hl) inc hl ld b,(hl) ld hl,l0005 add hl,de ld e,(hl) inc hl ld d,(hl) ld a,(de) cp 0f0h jp z,l3a36 inc bc inc de ex de,hl ld a,(bc) ld de,l0005 add hl,de inc bc inc bc inc bc inc bc inc bc ex de,hl ld hl,l3a86 call cp.8.8 ; Position in table ld a,(hl) ; .. get value ld (l1375),a ld hl,l136c push bc push af ; Save length call move ; Move DE->HL pop af ; .. get back length pop de push af ld hl,l1366 cp 8 jp nz,l39f7 ld hl,l1362 l39f7: call move ; Move DE->HL ld a,(l3a4e) and 8 call nz,l3b6d ld a,(l3a4d) ; Get byte ld hl,l3a16 push hl ld hl,l3a4f call cp.8.16 ; Find in table ld e,(hl) ; .. fetch address inc hl ld d,(hl) push de jp l2273 l3a16: ld hl,l1375 pop af cp (hl) ld (hl),a ld a,9 call nz,prc.err ; .. math overflow ld a,(hl) call l2f2e ex de,hl pop bc ld hl,l0005 add hl,bc ld (hl),e inc hl ld (hl),d ld h,b ld l,c inc de ld a,(de) inc hl ld (hl),a dec hl ret l3a36: ld hl,l0006 add hl,bc ld c,(hl) inc hl ld b,(hl) pop de ld hl,l0007 add hl,de ld a,c add a,(hl) ld (hl),a inc hl ld a,b adc a,(hl) ld (hl),a ex de,hl ret ; ;l3a4b: dw 0 l3a4d: db 0 l3a4e: db 0 l3a4f: db 4 dw l3a8e db 5 dw l3a97 db 6 dw l3aa0 db 8 dw l3aa9 db 9 dw l3abe db 10 dw l3ac1 db 11 dw l3aca db 12 dw l3ad3 db 13 dw l3ad9 db 14 dw l3adf db 15 dw l3af1 db 16 dw l3b03 db 24 dw l3b09 db 25 dw l3b19 db 26 dw l3b23 db 28 dw l3b33 db 29 dw l3b43 db 0 call intern.err ; l3a86: db 5,4 db 6,8 db 4,2 db 8,1 ; ; ; l3a8e: call l5101 pop hl pop af ld a,2 push af jp (hl) l3a97: call l518c pop hl pop af ld a,4 push af jp (hl) l3aa0: call l51b8 pop hl pop af ld a,8 push af jp (hl) l3aa9: call l5101 ld a,(l1367) and a ld a,9 call nz,prc.err ; .. math overflow pop hl pop af ld a,1 ld (l1375),a push af jp (hl) l3abe: jp l4ff2 l3ac1: jp nc,l54fc call l3b5d jp l4e8a l3aca: jp nc,l55dc call l3b5d jp l4ef0 l3ad3: call l3b55 jp l52e9 l3ad9: call l3b55 jp l5340 l3adf: jp nc,l53be jp p,l3aeb call l3b55 jp l52c9 l3aeb: call l3b5d jp l4d7b l3af1: jp nc,l53b7 jp p,l3afd call l3b55 jp l52bd l3afd: call l3b5d jp l4d78 l3b03: call l3b55 jp l53a5 l3b09: ld hl,(l1366) ld a,(l136d) and h ld h,a ld a,(l136c) and l ld l,a jp l5174 l3b19: ld hl,(l1366) call neg.hl ; -HL dec hl jp l5174 l3b23: ld hl,(l1366) ld a,(l136d) or h ld h,a ld a,(l136c) or l ld l,a jp l5174 l3b33: ld hl,(l1366) ld a,(l136d) xor h ld h,a ld a,(l136c) xor l ld l,a jp l5174 l3b43: ld hl,(l136c) ld a,(l1367) cpl or h ld h,a ld a,(l1366) cpl or l ld l,a jp l5174 l3b55: ld hl,(l1366) ex de,hl ld hl,(l136c) ret l3b5d: call l503b ld hl,(l136c) ld (l1366),hl ld hl,(l136e) ld (l1368),hl ret l3b6d: ld a,(l1375) ld b,a ld de,l136c ld hl,l1366 cp 8 jp nz,l3b7f ld hl,l1362 l3b7f: ld c,(hl) ld a,(de) ld (hl),a ld a,c ld (de),a inc de inc hl dec b jp nz,l3b7f ret ; ; ; l3b8b: push hl call l3d55 l3b8f: call l3d69 jp z,l3ba8 call l3bb7 ld a,c and 2 jp z,l3b8f push de push hl call l3be8 pop hl pop de jp l3b8f l3ba8: dec c jp nz,l3bb5 pop hl push hl ld de,l0005 add hl,de call l3be4 l3bb5: pop hl ret ; ; ; l3bb7: push bc push de ld a,(hl) cp '4' call nc,intern.err ; .. error cp 4 inc hl inc hl inc hl ld (hl),1 dec hl ld a,(hl) dec hl dec hl jp c,l3bde push hl call l3d5d l3bd1: call l3d69 jp z,l3bdd call l3bb7 jp l3bd1 l3bdd: pop hl l3bde: call l3c40 pop de pop bc ret l3be4: ld a,(hl) inc hl ld h,(hl) ld l,a l3be8: ld e,1 ld a,(hl) cp 4 jp c,l3bfa ld de,l0007 add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a ld e,0 l3bfa: inc hl ld a,(hl) dec hl cp 7 ret z ld a,(hl) add a,e ld de,L0005 add hl,de ld e,(hl) inc hl ld d,(hl) ld (l3c23),a call l3d32 push hl l3c10: pop af push hl ld a,(hl) inc hl ld h,(hl) ld l,a or h jp z,l3347 push hl inc hl inc hl ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(hl) cp $-$ l3c23 equ $-1 jp nz,l3c30 inc hl inc hl inc hl inc hl inc hl ld a,(hl) cp e inc hl ld a,(hl) l3c30: pop hl jp nz,l3c10 cp d jp nz,l3c10 ld e,(hl) inc hl ld d,(hl) pop hl ld (hl),e inc hl ld (hl),d ret l3c40: ex de,hl inc de ld a,(de) ; Get byte dec de cp 7 ; Test ??? jp z,l3ce3 ld a,(de) ; Get next ld c,4 cp 4 ; Test range jp c,l3c69 ld c,0 cp 1fh jp c,l3c69 ld hl,l3ce7 call cp.8.8 ; Find in table jp nz,l3c69 ; .. no match ld a,(hl) ; Get mask and a ; .. mask jp m,l3ce3 ; .. hi bit set and 00000111b ; .. mask lo ld c,a l3c69: ld a,(de) call l3d32 push hl l3c6e: pop af push hl ; Save pointer ld a,(hl) ; Get link inc hl ld h,(hl) ld l,a or h ; Test NIL jp z,l3cd2 ; .. yeap push hl inc hl inc hl ld a,(hl) inc hl ld h,(hl) ld l,a push hl push de push bc ld a,(de) cp (hl) jp nz,l3ca2 inc de inc hl push hl inc hl inc hl inc hl ld a,(hl) pop hl add a,a add a,c add a,1 ld c,a ld b,0 push bc ld c,2 call cmp.str ; Compare start of string pop bc inc de inc hl call z,cmp.str ; .. compare entire string on match l3ca2: pop bc pop de jp z,l3cac ; .. match pop hl pop hl jp l3c6e l3cac: ld hl,l0004 add hl,de ld b,(hl) l3cb1: dec b jp m,l3cc2 inc hl ld e,(hl) inc hl ld d,(hl) inc de inc de inc de ex de,hl dec (hl) ex de,hl jp l3cb1 l3cc2: pop hl pop af pop de push hl inc hl inc hl inc hl inc (hl) ld a,5 call z,prc.err ; Too complex pop hl xor a ret l3cd2: ld bc,4 ;;l0004 call alloc.dwn ; Allocate BC bytes push hl ; .. save inc hl inc hl ld (hl),e ; .. save address inc hl ld (hl),d pop bc ; Get new pointer pop hl ; .. and old pointer ld (hl),c ; .. set link inc hl ld (hl),b l3ce3: ex de,hl or 1 ret ; ; ; l3ce7: db 1fh,00000001b db 20h,00000001b db 21h,00000001b db 23h,10000000b db 27h,10000000b db 28h,10000000b db 29h,10000000b db 2bh,10000000b db 2ch,10000000b db 2dh,10000000b db 2eh,10000000b db 30h,10000000b db null ; ; ; l3d00: push af ld (hl),0eh inc hl ld a,(hl) push af ld (hl),4 dec hl call l3545 inc hl pop af ld (hl),a dec hl ld a,(hl) cp 0eh jp nz,l3d19 pop af ld (hl),a ret l3d19: pop af ret ; ; Swap ??? ; ENTRY Accu holds byte to be swapped ; EXIT Accu holds swapped byte ; Zero set on match ; l3d1b: push hl ld hl,l3d25 call cp.8.8 ld a,(hl) pop hl ret ; ; ; l3d25: db 11h,12h db 12h,11h db 15h,13h db 16h,14h db 14h,16h db 13h,15h db null ; ; ; l3d32: ld h,a and 00000011b ld l,a xor h rra rra add a,l cp 0dh jp c,l3d41 sub 0dh l3d41: add a,a ld hl,(l12e2) jp adda ; .. HL+ACCU l3d48: push hl ld hl,l5b5e add a,l ld l,a jp nc,l3d52 inc h l3d52: ld a,(hl) pop hl ret l3d55: inc hl inc hl ld a,(hl) and 3 ld c,a dec hl dec hl l3d5d: inc hl inc hl inc hl ld e,(hl) inc hl ld d,(hl) ld b,d inc b ex de,hl jp chk.mem ; .. test enough memory ; ; ; l3d69: ex de,hl ld (hl),d dec hl ld (hl),e ld a,b dec b inc hl inc hl ld e,(hl) inc hl ld d,(hl) ex de,hl ret ; l3d76: dw 0 l3d78: db 0 ; REL file flag [0x80 is empty] l3d79: dw 0 ext.dot: db 0 ; Extension dot flag [0 is extension given] l3d7c: db 0 l3d7d: db 0 ; LST file flag [0 is none] l3d7e: db 0 l3d7f: db 0 enaLST: db 0 ; /L flag [0 is not] l3d81: db 0 enaOBJ: db 0 ; REL flag [0 is not] l3d83: db 0 ; List file flag [0 is PRN else CRF] - ** NOT USED IN BASC ** l3d84: db 0 ; CCP line indicator [0 is not] l3d85: db 0 l3d86: db 0 l3d87: db 0 l3d88: db 0 F$OBJ: ds FCBlen ; REL file F$LST: ds FCBlen ; List file F$SRC: ds FCBlen ; Source file l3dec: ;; ** ds 54 ll3e22: l3e22 equ $ ds .drv+.nam+.ext l3e2e: db 'REL' l3e31: db 'CRF' l3e34: db 'PRN' owrptr: dw 0 ; REL buffer pointer BF$OBJ: ds RELlen*reclng lwrptr: dw 0 ; List buffer pointer BF$LST: ds LSTlen*reclng rdptr: dw 0 ; Source buffer pointer BF$SRC: ds SRClen*reclng l433d: db CMDLEN,0 ds CMDLEN conptr: dw 0 ; Current command pointer l4391: db '?Command error',null l43a0: db '?File not found',null l43b0: db '?Can''t enter file',null ; ; Print string from ^HL to console ; l43c2: ld a,(hl) ; Get next and NoMSB ; .. less hi bit ret z ; Zero is end call conout ; .. print inc hl jp l43c2 ; ; -> Command error ; l43cd: ld hl,l4391 jp l43dc ; ; -> File not found ; l43d3: ld hl,l43a0 jp l43dc ; ; -> File not to be entered ; l43d9: ld hl,l43b0 l43dc: call l43c2 ; Give message jp l444e ; Restart ; l43e2: ;; *** db 'COM' db 'SCN' l43e8: ds 24 l4400: dw l43e8 ; ; The initializer ; l4402:: ld (ll3e22),hl ; Save address ld de,l43e8 ld a,(de) or a jp z,l4432 ld a,(l4400+1) ld b,a l4411: ld a,(l4400) ld c,a ld hl,(BDOS+1) ; Get top of memory ld l,0 ; .. page boundary l441a: ld a,(de) cp (hl) ; Compare jp nz,l4428 inc hl inc de dec c jp nz,l441a jp l4432 l4428: inc de dec c jp nz,l4428 dec b ret z jp l4411 l4432: xor a ld (l43e8),a ld hl,(BDOS+1) ; Get to of memory dec hl ld sp,hl ; .. for stack dec hl dec hl ld (l3d79),hl ld hl,(ll3e22) push hl ; Set return address ld a,(l3d84) ; Get CCP line flag or a ; Test if from CCP jp nz,OS ; .. yeap, exit ld (l3d7c),a l444e: ld hl,(l3d79) ; Reload stack ld sp,hl call l4709 ; Prepare command line ld a,(l433d+2) ; Get 1st command character cp cr ; Test empty line jp z,l444e ; .. yeap, retry xor a ; Init a bit ld (l3d88),a ld (enaLST),a ; Clear /L ld (l3d86),a ld (l3d85),a ld (l3d83),a ; Clear list file flag ld (enaOBJ),a ; Clear REL file flag ld (l3d87),a inc a ld (l3d81),a ld (l3d7f),a ld bc,l43cd push bc ; Set error return xor a ld (l3d78),a ; Set REL file found call parse.file ; Parse file ret c ; Error ld de,l3e2e ; Set .REL call set.ext ; .. set as extension ld de,l3e22+1 ; Point to name ld a,(de) cp ' ' ; .. test name given jp nz,l449a ; .. yeap ld a,10000000b ld (l3d78),a ; Set no REL file l449a: push hl ld hl,F$OBJ call l45ab ; Unpack REL file pop hl ld a,' ' ld (l3e22+.drv),a ; Clear name and extension ld (l3e22+.drv+.nam),a xor a ld (l3e22),a ; .. and drive ld a,c sub ',' ; Test delimiter given or a ld (enaOBJ),a ; .. set REL file flag jp nz,l44c4 ; .. nope ld a,(l3d78) ; Get REL file flag xor 10000000b ; Toggle bit ld (enaOBJ),a ; 0x00 if REL file empty call parse.file ; Parse file ret c ; Error l44c4: ld de,l3e34 ; Take .PRN ld a,(l3d83) ; Get list file flag or a ; Test type jp z,l44d1 ld de,l3e31 ; Take .CRF l44d1: call set.ext ; .. set as extension ld de,l3e22+.drv ; Point to name ld a,(l3e22) ld (l3d7e),a ; Save drive ld a,(de) sub ' ' ; Test empty file ld (l3d7d),a jp nz,l44ee ; Nope ld a,(l3d78) ; Get REL file flag add a,01000000b ; Insert bit ld (l3d78),a l44ee: push hl ld hl,F$LST call l45ab ; Unpack list file pop hl ld a,c ; Get last character cp '=' ; Must be assignment scf ret nz call parse.file ; Parse file cp cr ; Must be last entry scf ret nz ld de,l2260 ; Get .BAS call set.ext ; .. set as extension ld de,l3e22 ld a,(de) ; Get drive inc de or a ; Test character I/O jp m,l4516 ; Yeap ld a,(de) cp ' ' ; Verify not empty source file scf ret z l4516: push hl ld hl,F$SRC call l45ab ; Unpack source file pop hl ld a,(l3d78) ; Get REL file flag add a,a ; Test REL file empty ld hl,F$OBJ ; Point to REL file call c,l458b ; Empty REL file, ^HL=Parsed FCB add a,a ld hl,F$LST ; Point to list file push af ld a,(l3d83) ; Get list file flag or a ; Test type jp z,l4546 ; Got .PRN ld de,F$LST+.drv+.nam ld bc,l3e31 ; .. .CRF ld a,.ext l453c: push af ld a,(bc) ; Set extension ld (de),a inc de inc bc pop af dec a jp nz,l453c l4546: pop af ; Test list file selected call c,l458b ; Empty list file, ^HL=Parsed FCB ld a,(enaLST) or a ; Test /L jp nz,l455b ; .. yeap ld a,(l3d7d) or a ; Test list file selected jp nz,l455b ; Yeap ld a,(l3d7e) l455b: ld (enaLST),a ; Set /L ld c,.retdsk call BDOS ; Get current disk push af ld c,.resdsk call BDOS ; Reset entire disk system pop af ld e,a ld c,.seldsk call BDOS ; .. log original one only xor a ld (CCP),a ; Force empty line call sreset ; Open source file call lrewrite ; Create list file call orewrite ; Create REL file pop hl ld hl,(l3d79) inc hl inc hl ld a,(l3d81) ld (l3d7c),a ld b,a ret ; ; Unpack ^HL with parsed FCB ; l458b: push af ld de,l3e22 ; Point to FCB ld c,.drv+.nam ld a,(hl) ; Get drive or a ; Test empty jp nz,l45a5 ; Nope, go copy ld a,(de) or a ; Get parsed device jp m,l45a5 ; Got not a file l459b: ld a,(de) ld (hl),a ; Unpack FCB inc hl inc de dec c jp nz,l459b l45a3: pop af ret l45a5: dec c ; Fix parameters inc hl inc de jp l459b ; ; Unpack file D:NAME.EXT from ^DE to ^HL ; l45ab: dec de ; .. fix for drive ld b,.drv+.nam+.ext l45ae: ld a,(de) ; .. unpack it ld (hl),a inc hl inc de dec b jp nz,l45ae ret ; ; Set extension of file ; ENTRY Reg DE points to extension ; set.ext: ld a,(ext.dot) ; Test dot given or a ret z ; .. yeap push hl ld hl,l3e22+.drv+.nam ld a,(hl) ; .. test any extension here cp ' ' jp nz,l45d2 ; .. yeap ld b,.ext ; Set length l45c8: ld a,(de) ; .. unpack extension and NoMSB ld (hl),a inc hl inc de dec b jp nz,l45c8 l45d2: pop hl ret ; ; Parse file - Accu holds delimiter character on exit ; Carry set indicates error ; parse.file: call l46e8 ; Check string cp ':' ; Test drive/device delimiter scf ld a,0 jp nz,l45f8 ; .. nope, set default drive ld a,b ; Get length or a ; Test empty jp z,parse.file ; .. yeap, get next ex de,hl ; .. set pointer call l4772 ; Get next char ld c,a ld a,b ; Get back count dec a ; Test one character for drive ld a,c jp nz,l4619 ; Nope, must be device cp 'Z'+1 ; Verify valid drive ** WHY Z AND NOT P ??? ret nc cp 'A' ret c sub 'A'-1 ex de,hl l45f8: ld (l3e22),a ; Save drive call nc,l46e8 ; Check string ld a,b cp .nam+.ext ; Test length jp c,l4606 ; In range ld b,.nam+.ext ; .. truncate l4606: push bc ex de,hl push de ld de,l3e22+1 ; Point to name inc b l460d: dec b jp z,l4662 call l4772 ; Get next char ld (de),a ; Unpack name of file inc de jp l460d ; ; Test devices ; ; 1 - Test TTY ; l4619: cp 'T' ; Test TTY jp nz,l4632 ; .. nope call l4772 ; Get next char cp 'T' ; Verify TTY scf ret nz call l4772 cp 'Y' scf ret nz sbc a,a ; Return 0xFF ex de,hl or a jp l45f8 ; ; 2 - Test LST ; l4632: cp 'L' ; Test LST jp nz,l464c ; .. nope call l4772 ; Get next char cp 'S' ; Verify LST scf ret nz call l4772 cp 'T' scf ret nz ld a,0feh ; Return 0xFE ex de,hl or a jp l45f8 ; ; 3 - Test RDR ; l464c: cp 'R' ; Test RDR scf ret nz ; .. nope call l4772 ; Get next char cp 'D' ; Verify RDR scf ret nz cp 'R' scf ret nz ld a,0feh ; Return 0xFE ex de,hl or a jp l45f8 ; ; End of parse ; l4662: pop hl pop bc ld a,.nam+.ext-1 sub b ; Test length jp c,l4673 ex de,hl l466b: ld (hl),' ' ; Blank remainder inc hl dec a jp p,l466b ex de,hl l4673: ld a,c ; Get back last character ld b,0 sub '.' ; Test dot ld (ext.dot),a ; Set dot flag call z,l46e8 ; Check string if dot ex de,hl ; .. get back start push de ld de,l3e22+1+8 ; Point to extension ld a,b cp .ext+1 ; Test length jp c,l468b ld b,.ext ; .. truncate l468b: inc b l468c: dec b jp z,l4698 call l4772 ; Get next char ld (de),a inc de jp l468c l4698: pop hl l4699: ld a,c sub '/' ; Test option prefix or a ld a,c ret nz call l4772 ; Get option char cp 'L' ; Test /L jp nz,l46b1 ld (enaLST),a ; Enable list file l46aa: call l4772 ; Get next char ld c,a jp l4699 ; .. test more options l46b1: call l46b7 ; Decode options jp l46aa ; ; Decode option found - Set status ; l46b7: push hl ld hl,l46d3 ; Point to table call cp.8.8 ; Find option jp z,l46c4 ; .. got it pop hl scf ; Not found - BUT CY NOT REQUESTED ret l46c4: ld a,(hl) ; Get control pattern and 00000010b ; Test MS 4.51 or OBSLIB ld a,(hl) ld hl,_stat1 jp z,l46cf ; .. nope, got 1st one inc hl ; .. fix mode pointer l46cf: or (hl) ; Combine bits ld (hl),a pop hl ret ; l46d3: db 'E',40h ; Program contains ON ERROR GOTO with RESUME db '4',42h ; Use MS 4.51 lexical conventions db 'X',60h ; Program contains ON ERROR GOTO with RESUME, RESUME 0 or RESUME NEXT db 'Z',08h ; Use Z80 opcodes db 'N',80h ; Suppress listing of disassembled object code db 'D',01h ; Generate debug code db 'S',10h ; Write quoted strings to REL file db 'C',82h ; Relax line numbering constraints (not with /4) db 'T',22h ; Use MS 4.51 execution conventions db 'O',12h ; Substitutes library db null ; ; Get length of substring ^HL into reg B ; EXIT Reg DE holds start of substring ; l46e8: ld b,0 ; Clear length push hl l46eb: call l4772 ; Get next char cp 'Z'+1 ; Test range jp nc,l4706 ; Must be A..Z cp '0' ; Or 0..9 jp c,l4706 cp 'A' jp nc,l4702 cp '9'+1 jp nc,l4706 l4702: inc b ; Bump count jp l46eb l4706: ld c,a ; Save last character pop de ; Get back pointer ret ; ; Prepare command line ; l4709:: push bc push de ld hl,CCP ; Init command line ld a,(hl) ; Get length ld (hl),null ; .. clear for later or a ld b,a l4713: jp z,l4738 ; .. end of input inc hl ld a,(hl) cp ' ' ; Skip blanks jp nz,l4721 dec b jp l4713 l4721: ld de,l433d+1 ; Init line ld a,b ; Get back remaining length dec hl inc b l4727: ld (de),a ; Unpack CCP line inc de inc hl dec b jp z,l4732 ld a,(hl) jp l4727 l4732: ld (l3d84),a ; Indicate CCP line jp l4758 l4738: xor a ld (l3d84),a ; Indicate empty CCP line ld a,(l3d7c) or a jp nz,l474b call l47b4 ; Close console line ld a,'*' call conout ; Indicate input l474b: ld c,.rdcon ld de,l433d call BDOS ; Read line from keyboard ld a,lf call conout ; .. close line l4758: pop de pop bc ld a,(l433d+1) ; Get length of command ld hl,l433d+2 ; Init command pointer push hl ld (conptr),hl ; .. init console pointer add a,l ld l,a ld a,0 adc a,h ld h,a ld (hl),cr ; Close end inc hl ld a,lf ld (hl),a pop hl ret ; ; Get next character from buffer ^HL ; l4772: ld a,(hl) ; .. get it inc hl cp ' ' ; Skip blanks jp z,l4772 cp lf ; .. or line feeds jp z,l4772 cp cr ; Test return jp nz,l47ae inc hl ld (conptr),hl ; .. set pointer ret ; ; Put character to console ; l4788: pop af ; Get character back ; ; Put character in Accu to console ; conout: push hl push de push bc push af ld c,.conout ld e,a call BDOS ; Put to console pop af pop bc pop de pop hl or a ret ; ; Get character from command buffer ; getchr: push hl ld hl,(conptr) ; Get command pointer dec hl ld a,(hl) ; Get from buffer and NoMSB cp lf ; Test end of line inc hl call z,l4709 ; Get new command line if end inc hl ld (conptr),hl dec hl l47ac: ld a,(hl) ; Get character pop hl l47ae: cp eof ; Test end of file scf ret z ; .. yeap or a ret ; ; Close console line ; l47b4: ld a,cr call conout ; Put new line to console ld a,lf jp conout ; ; Create list file ; lrewrite: push af push bc push de push hl ld de,BF$LST ; Get FCB ld hl,0 ld (lwrptr),hl ; Init buffer pointer ld hl,F$LST ; .. get list file ld a,(enaLST) ; .. enable flag /L jp l47e7 ; ; Create REL file ; orewrite: push af push bc push de push hl ld de,BF$OBJ ; Get FCB ld hl,0 ld (owrptr),hl ; Init pointer ld hl,F$OBJ ; .. get REL file ld a,(enaOBJ) ; .. enable flag ; ; Create file ; ENTRY Reg DE points to file buffer ; Reg HL points to FCB ; Accu holds enable flag ; l47e7: or a ; Test file enabled jp z,l4818 ; .. nope push hl ld c,.setdma call BDOS ; Set disk buffer pop hl ld a,(hl) ; Test character device or a jp m,l4818 ; .. yeap call clr.FCB ; Prepare FCB push de ld c,.delete call BDOS ; Delete existent file pop de push de ld c,.make call BDOS ; Create new one inc a jp z,l43d9 ; .. error pop hl l480c: call clr.FCB ; Clear parts of FCB ld c,.open call BDOS ; Reopen file inc a jp z,l43d3 ; .. error l4818: pop hl pop de pop bc pop af ret ; ; Open source file ; sreset: push af push bc push de push hl ld hl,SRClen*reclng ld (rdptr),hl ; Force read ld de,BF$SRC ld c,.setdma call BDOS ; Set disk buffer ld hl,F$SRC ; Point to source device ld a,(hl) ; Test char device or a jp m,l4818 ; .. yeap jp l480c ; Open file ; ; Clear parts of FCB in ^HL ; clr.FCB: push hl push de ld de,_EX add hl,de ; Point to extent xor a ld d,4 l4843: ld (hl),a ; .. clear next bytes inc hl dec d jp nz,l4843 ld de,_CR-_EX-4 add hl,de ld (hl),a ; Clear current record pop hl pop de ret ; ; Close source file ; sclose:: push af push de ld de,F$SRC ; Point to source device ld a,(de) ; Test char device or a jp m,l4871 ; .. yeap push bc push hl push de ld de,BF$SRC ld c,.setdma call BDOS ; Set disk buffer pop de $LD.BC l4868: push bc push hl ld c,.close call BDOS ; .. close file pop hl pop bc l4871: pop de pop af ret ; ; Close list file ; lclose:: push af ld a,(enaLST) ; Test list file /L or a jp z,l45a3 ; .. nope push de ld a,(F$LST) ; Get list device inc a ; Test console jp z,l4871 ; .. yeap jp m,l48fd ; .. skip if other ld a,cr call lput ; Give new line ld a,lf call lput ld a,eof call lput ; .. close file push hl ld hl,(lwrptr) ; Get buffer pointer ld de,BF$LST push bc ld bc,F$LST ; Point to list file call l48e7 ld de,BF$LST ld c,.setdma call BDOS ; Set disk buffer pop bc pop hl ld de,F$LST ; Point to list file jp l4868 ; ; Close REL file ; oclose:: push af ld a,(enaOBJ) ; Test REL file enabled or a jp z,l45a3 ; .. no REL file push de ld a,(F$OBJ) ; Get REL file device or a ; Test file jp m,l4871 ; .. nope ld a,eof call oput ; .. give end of file push hl ld hl,(owrptr) ; Get REL buffer pointer ld de,BF$OBJ push bc ld bc,F$OBJ ; Point to REL file call l48e7 ld de,BF$OBJ ld c,.setdma call BDOS ; Set disk buffer pop bc pop hl ld de,F$OBJ ; Point to REL file jp l4868 ; ; Calculate number of records ; l48e7: ld a,h or l ; Test any there ret z ; Nope ld a,l and 7fh jp z,l48f2 add a,80h l48f2: rla rla and 3 add hl,hl add a,h ld h,b ld l,c jp l4946 ; Write buffer ; ; ; l48fd: ld a,cr ; Close line call lput ld a,lf call lput ld a,ff ; .. give form feed call lput pop de pop af ret ; ; Put character to list device ; lput: push af ; Save character ld a,(enaLST) or a ; Test list file enabled /L jp z,l45a3 ; .. nope ld a,(F$LST) ; Get list device inc a jp z,l4788 ; 0xFF is to console jp m,l49ee ; 0xFF is to console ex (sp),hl push hl push de ld hl,(lwrptr) ; Get list buffer pointer ld a,h cp HIGH (LSTlen*reclng) call z,lwrrec ; .. write record if filled inc hl ld (lwrptr),hl ld de,BF$LST-1 add hl,de ; Build address pop de pop af push af and NoMSB ld (hl),a ; .. store character pop af pop hl ret ; ; Write buffer to list file ; lwrrec: ld de,BF$LST ; Init parameters ld hl,F$LST ld a,LSTlen ; ; Write A records to file ^HL with buffer ^DE ; l4946: push af push bc push de push hl ld c,.setdma call BDOS ; Set disk buffer pop de push de ld c,.wrseq call BDOS ; Write record or a ; Test success jp nz,l4a38 ; Nope, disk full pop de pop hl ld bc,reclng add hl,bc ; Advance to next address ex de,hl pop bc pop af dec a jp nz,l4946 ld hl,0 ; Init pointer ret ; ; Write buffer to REL file ; owrrec: ld de,BF$OBJ ; Init parameters ld a,RELlen ld hl,F$OBJ jp l4946 ; .. write ; ; Put byte to REL file ; oput: push af ; Save byte ld a,(enaOBJ) ; Test REL file enabled or a jp z,l45a3 ; .. nope ld a,(F$OBJ) ; Test character device or a jp m,l4788 ; .. yeap, put character to console ex (sp),hl push hl push de ld hl,(owrptr) ; Get ut character to console ld a,h dec a ; Test buffer filled call z,owrrec ; .. write buffer if so inc hl ld (owrptr),hl ; Update pointer ld de,BF$OBJ-1 add hl,de ; Get address pop de pop af ld (hl),a ; Store byte pop hl ret ; ; Get character from source file ; Carry set indicates end of file ; sget: ld a,(F$SRC) ; Test char device inc a jp z,getchr ; 0xFF is from console jp m,getio ; 0xFE is from auxiliary device push hl push de ld hl,(rdptr) ; Get source buffer pointer ld a,h ; Test buffer done cp HIGH (SRClen*reclng) call z,rdrec ; .. yeap, read new record inc hl ld (rdptr),hl ; Update pointer ld de,BF$SRC-1 add hl,de ; Position buffer pop de jp l47ac ; Get character ; ; Read buffer from source file ; rdrec: ld de,BF$SRC ; Init file read ld a,SRClen l49c3: push af push de push bc ld c,.setdma call BDOS ; Set buffer ld de,F$SRC ld c,.rdseq call BDOS ; Read from source file pop bc pop de dec a jp z,l49e7 ; .. end of file ld hl,reclng add hl,de ; .. bump ex de,hl pop af dec a jp nz,l49c3 l49e3: ld hl,0 ; .. return pointer ret l49e7: pop af ld a,eof ld (de),a ; Set end of file jp l49e3 ; ; ; l49ee: pop af push hl push de push bc push af ld c,.lstout ld e,a ld hl,l3d88 cp ' ' jp nc,l4a0a sub cr jp z,l4a08 inc a jp z,l4a08 ld a,(hl) l4a08: dec a ld (hl),a l4a0a: inc (hl) ld a,e cp tab jp nz,l4a1f l4a11: ld a,' ' call lput ld a,(hl) and 7 jp nz,l4a11 jp l4a22 l4a1f: call BDOS l4a22: pop af pop bc pop de pop hl ret ; ; Get character from paper tape reader (auxiliary device) ; getio: push hl push de push bc ld c,.rdr call BDOS ; Get character pop bc pop de pop hl cp eof ; Test end of file scf ret z or a ret ; ; ; l4a38: ld hl,l4a58 call l43c2 ; Give error message pop de ld a,(de) add a,'A'-1 cp 'A'-1 jp nz,l4a49 ld a,' ' l4a49: call conout ; Print drive ld hl,l4a5e call l43c2 call l47b4 jp OS ; l4a58: db 'DISK ',null l4a5e: db ' FULL',null F$INC: ds FCBlen l4a85: db 0 l4a86: db 0,0 BF$INC: ds reclng ; ; ; l4b08: push hl push de push bc ex de,hl ld hl,F$INC ; Point to include FCB inc de ld a,(de) dec de cp ':' ; Test drive delimiter ld a,0 jp nz,l4b23 ; .. nope ld a,(de) inc de sub 'A'-1 cp 'Z'-'A'+2 jp nc,l4b87 inc de l4b23: ld (hl),a ; Set drive inc hl ld b,.nam l4b27: ld a,(de) inc de ld (ext.dot),a ; .. disable dot in name.ext cp '.' jp z,l4b4e cp ' '+1 jp c,l4b4e ld (hl),a ; .. unpack name inc hl dec b jp nz,l4b27 l4b3c: ld a,(de) inc de ld (ext.dot),a ; Disable dot in name.ext cp '.' jp z,l4b55 cp ' '+1 jp nc,l4b3c jp l4b55 l4b4e: ld (hl),' ' ; Clear remainder inc hl dec b jp nz,l4b4e l4b55: ld b,.ext ld a,(ext.dot) ; Test dot found cp '.' jp z,l4b62 ; .. yeap ld de,l2260 l4b62: ld a,(de) ; Unpack extension inc de ld (hl),a inc hl dec b jp nz,l4b62 ld (hl),b ld de,BF$INC ld c,.setdma ; Set include buffer call BDOS ld de,F$INC ld c,.open call BDOS ; Find file cp OSerr jp z,l4b87 ; .. not on disk xor a ld (F$INC+_CR),a ld (l4a85),a l4b87: pop bc pop de pop hl ret ; ; Get character from include file ; Carry set indicates end of file ; iget: push hl push de push bc ld a,(l4a85) ; Test any in buffer dec a jp p,l4bb2 ; .. yeap ld de,BF$INC ld c,.setdma ; Set include buffer call BDOS ld de,F$INC ld c,.rdseq call BDOS ; Read record add a,OSerr jp c,l4bc7 ; .. end of file ld hl,BF$INC ; Init address ld (l4a86),hl ld a,reclng-1 ; .. and pointer l4bb2: ld (l4a85),a ld hl,(l4a86) ld a,(hl) ; Get character cp eof ; Test end of file jp nz,l4bc2 ; .. nope scf ; Indicate it jp l4bc7 l4bc2: inc hl ld (l4a86),hl or a l4bc7: pop bc pop de pop hl ret ; ; ; l4bcb: ret ; ; HL+ACCU ; adda: add a,l ; Add low ld l,a ret nc inc h ; .. remember carry ret ; ; Move A bytes from ^DE to ^HL ; move: and a ret z ; .. reject zero length push bc ld b,a l4bd5: ld a,(de) ; .. unpack ld (hl),a inc de inc hl dec b jp nz,l4bd5 pop bc ret ; ; Compare from list db/db ; ENTRY Reg HL points to list ; Accu holds element in list ; EXIT Zero set on match ; Reg HL points to corresponding element ; cp.8.8: push bc ld b,a l4be1: ld a,(hl) inc hl cp b ; Compare jp z,l4bef ; .. match and a inc hl ; .. skip next byte jp nz,l4be1 ; .. loop on dec hl ; .. fix pointer dec hl or h ; Set no match l4bef: pop bc ret ; ; Compare from list db/dw ; ENTRY Reg HL points to list ; Accu holds element in list ; EXIT Zero set on match ; Reg HL points to corresponding word ; cp.8.16: push bc ld b,a l4bf3: ld a,(hl) inc hl cp b ; Compare jp z,l4c03 ; .. match and a inc hl inc hl jp nz,l4bf3 ; .. still more dec hl ; .. fix pointer dec hl dec hl or h ; Set no match l4c03: pop bc ret ; ; Context switch from list followed call by Accu ; caseswitch: rlca ; Index *2 ex (sp),hl push af call adda ; .. HL+ACCU ld a,(hl) ; .. fetch list address inc hl ld h,(hl) ld l,a pop af ex (sp),hl ret ; ; Compare HL:DE - Zero set if equal ; cmp.r: ld a,e xor l ; .. compare ret nz ld a,d xor h ret ; ; Negate HL ; neg.hl: ld a,h cpl ; .. do it ld h,a ld a,l cpl ld l,a inc hl ret ; ; Compare strings ^HL:^DE with length in C ; cmp.str: ld a,(de) cp (hl) ; Compare ret nz ; .. no match inc de inc hl dec c ; Count down jp nz,cmp.str ret ; ; Give new line ; prnl: call ilstrg db cr,.lf ret ; ; Convert character in Accu to upper case ; toupp: cp 'a' ; Test range ret c cp 'z'+1 ret nc sub 'a'-'A' ; .. convert ret ; ; Print number in DE as decimal number ; prdec: ld a,5 ; Set digit count push hl l4c3c: push af ld hl,l4c62-2 rlca call adda ; .. HL+ACCU ld a,(hl) ; .. fetch divisor inc hl ld h,(hl) ld l,a ex de,hl ld a,-1 ; Init digit l4c4b: add hl,de ; .. subtract inc a jp c,l4c4b add a,'0' ; Make real ASCII call putchr ; .. print ld a,l ; Get remainder sub e ld e,a ld a,h sbc a,d ld d,a pop af dec a jp nz,l4c3c pop hl ret l4c62: dw -1 dw -10 dw -100 dw -1000 dw -10000 l4c6c: ex de,hl add hl,hl ret c ld d,h ld e,l add hl,hl ret c add hl,hl ret c add hl,de ret l4c77: xor a push af ld hl,l0000 l4c7c: ld a,b rra ld b,a ld a,c rra ld c,a jp nc,l4c8c add hl,de jp nc,l4c8c pop af inc a push af l4c8c: ld a,b or c jp z,l4c9d ex de,hl add hl,hl ex de,hl jp nc,l4c7c pop af inc a push af jp l4c7c l4c9d: pop af ret ; ; ; l4c9f: ex (sp),hl ; Get caller push de ld e,a ld d,0 add hl,de ; .. add for index ld e,(hl) ; .. fetch index add hl,de ; .. fix new address pop de ex (sp),hl ret ; ; ; l4caa: push bc ld c,l ex de,hl ld hl,l0000 call l4cbc ex de,hl jp c,l4cba ld a,l sub c and a l4cba: pop bc ret l4cbc: ld a,(de) sub '0' ccf ret nc cp 7+1 ret nc add hl,hl ret c add hl,hl ret c add hl,hl ret c or l ld l,a inc de jp l4cbc l4cd0: push bc ld c,l ex de,hl ld hl,l0000 call l4ce2 ex de,hl jp c,l4ce0 ld a,l sub c and a l4ce0: pop bc ret l4ce2: ld a,(de) call toupp ; Get upper case sub '0' ccf ret nc cp 9+1 jp c,l4cf8 sub 'A'-'0' ccf ret nc cp 'F'-'A'+1 ret nc add a,10 l4cf8: add hl,hl ret c add hl,hl ret c add hl,hl ret c add hl,hl ret c or l ld l,a inc de jp l4ce2 ; ; Print string at ^HL with fix length in Accu ; prfxstr: and a ; .. reject empty string ret z l4d08: push af ld a,(hl) and NoMSB call putchr ; .. print pop af inc hl dec a jp nz,l4d08 ret ; ; Print string followed call ; ilstrg: ex (sp),hl ; .. fetch address call prstrg ; .. print ex (sp),hl ret ; ; Print string in ^HL ; prstrg: ld a,(hl) ; Get character and NoMSB ; .. less MSB call putchr ; .. print cp (hl) ; Test end inc hl ret nz ; .. yeap jp prstrg ; ; Convert hex byte in Accu to ASCII, store into ^HL ; l4d28: push af rra ; Get hi bits rra rra rra call l4d31 pop af ; ; Convert hex nibble in Accu to ASCII, store into ^HL ; l4d31: and 00001111b ; Get low bits add a,'0' cp '9'+1 ; Test hex jp c,l4d3c ; .. nope add a,'A'-'9'-1 ; .. fix for hex l4d3c: ld (hl),a ; .. store digit inc hl ret ; ; Convert hex word in DE to ASCII in ^HL ; sthex: ld a,d ; Get hi call l4d28 ; .. as hex ld a,e ; .. then low jp l4d28 ; ; Print hex byte in Accu ; l4d47: push hl ld hl,l4d59 call l4d28 ; Get hex dec hl ld a,(hl) ; Get last character or MSB ; .. indicate end of string ld (hl),a dec hl call prstrg ; .. print hex byte pop hl ret ; l4d59: ds 2 ; ; Print hex word in HL ; prhex: ld a,h ; ..print hi call l4d47 ld a,l ; .. then low jp l4d47 ; ; Clear memory at ^HL, length in Accu ; l4d63: ld (hl),0 ; .. clear it inc hl clrmem: sub 1 ; Count down jp nc,l4d63 ret ; ; ; l4d6c: ld hl,l58ae call l503e jp l4d7b call l503e l4d78: call l4ffb l4d7b: ld a,b or a ret z ld a,(l1369) or a jp z,l5030 sub b jp nc,l4d95 cpl inc a ex de,hl call l5020 ex de,hl call l5030 pop bc pop de l4d95: cp 19h ret nc push af call l505d ld h,a pop af call l4e55 ld a,h or a ld hl,l1366 jp p,l4dbc call l4e35 jp nc,l4e16 inc hl inc (hl) jp z,l5820 ld l,1 call l4e7c jp l4e16 l4dbc: xor a sub b ld b,a ld a,(hl) sbc a,e ld e,a inc hl ld a,(hl) sbc a,d ld d,a inc hl ld a,(hl) sbc a,c ld c,a l4dca: call c,l4e41 l4dcd: ld l,b ld h,e xor a l4dd0: ld b,a ld a,c or a jp nz,l4e01 ld c,d ld d,h ld h,l ld l,a ld a,b sub 8 cp 0e0h jp nz,l4dd0 l4de2: xor a ld (l1369),a ret l4de7: ld a,h or l or d jp nz,l4df9 ld a,c l4dee: dec b rla jp nc,l4dee inc b rra ld c,a jp l4e04 l4df9: dec b add hl,hl ld a,d rla ld d,a ld a,c adc a,a ld c,a l4e01: jp p,l4de7 l4e04: ld a,b ld e,h ld b,l or a jp z,l4e16 ld hl,l1369 add a,(hl) ld (hl),a jp nc,l4de2 jp z,l4de2 l4e16: ld a,b l4e17: ld hl,l1369 or a call m,l4e28 ld b,(hl) inc hl ld a,(hl) and 80h xor c ld c,a jp l5030 l4e28: inc e ret nz inc d ret nz inc c ret nz ld c,80h inc (hl) ret nz jp l581f l4e35: ld a,(hl) add a,e ld e,a inc hl ld a,(hl) adc a,d ld d,a inc hl ld a,(hl) adc a,c ld c,a ret l4e41: ld hl,l136a ld a,(hl) cpl ld (hl),a xor a ld l,a sub b ld b,a ld a,l sbc a,e ld e,a ld a,l sbc a,d ld d,a ld a,l sbc a,c ld c,a ret l4e55: ld b,0 l4e57: sub 8 jp c,l4e64 ld b,e ld e,d ld d,c ld c,0 jp l4e57 l4e64: add a,9 ld l,a ld a,d or e or b jp nz,l4e78 ld a,c l4e6e: dec l ret z rra ld c,a jp nc,l4e6e jp l4e7e l4e78: xor a dec l ret z ld a,c l4e7c: rra ld c,a l4e7e: ld a,d rra ld d,a ld a,e rra ld e,a ld a,b rra ld b,a jp l4e78 l4e8a: call l4fcc ret z ld l,0 call l4f8a ld a,c ld (l4ec3),a ex de,hl ld (l4ebe),hl ld bc,l0000 ld d,b ld e,b ld hl,l4dcd push hl ld hl,l4eac push hl push hl ld hl,l1366 l4eac: ld a,(hl) inc hl or a jp z,l4ee0 push hl ex de,hl ld e,8 l4eb6: rra ld d,a ld a,c jp nc,l4ec4 push de ld de,$-$ l4ebe equ $-2 add hl,de pop de adc a,$-$ l4ec3 equ $-1 l4ec4: rra ld c,a ld a,h rra ld h,a ld a,l rra ld l,a ld a,b rra ld b,a and 10h jp z,l4ed8 ld a,b or ' ' ld b,a l4ed8: dec e ld a,d jp nz,l4eb6 ex de,hl l4ede: pop hl ret l4ee0: ld b,e ld e,d ld d,c ld c,a ret l4ee5: call l5020 ld hl,l5546 call l502d pop bc pop de l4ef0: call l4fcc jp z,l5828 ld l,0ffh call l4f8a inc (hl) jp z,l57ff inc (hl) jp z,l57ff dec hl ld a,(hl) ld (l4f27),a dec hl ld a,(hl) ld (l4f23),a dec hl ld a,(hl) ld (l4f1f),a ld b,c ex de,hl xor a ld c,a ld d,a ld e,a ld (l4f2a),a l4f1b: push hl push bc ld a,l sub $-$ l4f1f equ $-1 ld l,a ld a,h sbc a,$-$ l4f23 equ $-1 ld h,a ld a,b sbc a,$-$ l4f27 equ $-1 ld b,a ld a,$-$ l4f2a equ $-1 sbc a,0 ccf jp nc,l4f38 ld (l4f2a),a pop af pop af scf _JP.NC l4f38: pop bc pop hl ld a,c inc a dec a rra jp p,l4f56 rla ld a,(l4f2a) rra and 0c0h push af ld a,b or h or l jp z,l4f51 ld a,' ' l4f51: pop hl or h jp l4e17 l4f56: rla ld a,e rla ld e,a ld a,d rla ld d,a ld a,c rla ld c,a add hl,hl ld a,b rla ld b,a ld a,(l4f2a) rla ld (l4f2a),a ld a,c or d or e jp nz,l4f1b push hl ld hl,l1369 dec (hl) pop hl jp nz,l4f1b jp l4de2 l4f7d: ld a,0ffh _LD.L l4f80: xor a ld hl,l1372 ld c,(hl) inc hl xor (hl) ld b,a ld l,0 l4f8a: ld a,b or a jp z,l4fae ld a,l ld hl,l1369 xor (hl) add a,b ld b,a rra xor b ld a,b jp p,l4fad add a,80h ld (hl),a jp z,l4ede call l505d ld (hl),a dec hl ret call l4fcc cpl pop hl l4fad: or a l4fae: pop hl jp p,l4de2 jp l57ff l4fb5: call l503b ld a,b or a ret z add a,2 jp c,l5818 ld b,a call l4d7b ld hl,l1369 inc (hl) ret nz jp l5818 ; ; ; l4fcc: ld a,(l1369) or a ret z ld a,(l1368) _CP l4fd5: cpl l4fd6: rla l4fd7: sbc a,a ret nz inc a ret ; ; ; l4fdb: ld b,88h ld de,l0000 l4fe0: ld hl,l1369 ld c,a ld (hl),b ld b,0 inc hl ld (hl),80h rla jp l4dca call l500d ret p l4ff2: call l2273 jp m,l5390 jp z,l1377 ; .. error l4ffb: ld hl,l1368 ld a,(hl) xor 80h ld (hl),a ret call l500d ld l,a rla sbc a,a ld h,a jp l5174 l500d: call l2273 jp z,l1377 ; .. error jp p,l4fcc ld hl,(l1366) ld a,h or l ret z ld a,h jp l4fd6 l5020: ex de,hl ld hl,(l1366) ex (sp),hl push hl ld hl,(l1368) ex (sp),hl push hl ex de,hl ret l502d: call l503e l5030: ex de,hl ld (l1366),hl ld h,b ld l,c ld (l1368),hl ex de,hl ret l503b: ld hl,l1366 l503e: ld e,(hl) inc hl ld d,(hl) inc hl ld c,(hl) inc hl ld b,(hl) inc hl ret ld de,l1366 l504a: ld b,4 jp l5054 l504f: ex de,hl l5050: ld a,(l1375) ld b,a l5054: ld a,(de) ld (hl),a inc de inc hl dec b jp nz,l5054 ret l505d: ld hl,l1368 ld a,(hl) rlca scf rra ld (hl),a ccf rra inc hl inc hl ld (hl),a ld a,c rlca scf rra ld c,a rra xor (hl) ret l5072: ld hl,l136c l5075: ld de,l504f jp l5081 l507b: ld hl,l136c ld de,l5050 l5081: push de ld de,l1366 call l2273 ret c ld de,l1362 ret ; ; ENTRY Reg B holds ??? ; Reg C holds ??? ; Reg D holds ??? ; Reg E holds ??? ; l508d: ld a,b ; Test ??? or a jp z,l4fcc ld hl,l4fd5 push hl call l4fcc ld a,c ; Return ??? ret z ld hl,l1368 xor (hl) ld a,c ret m call l50a7 ; .. compare l50a4: rra xor c ret ; ; ; l50a7: inc hl ld a,b cp (hl) ; Compare 1st ret nz dec hl ld a,c cp (hl) ; .. 2nd ret nz dec hl ld a,d cp (hl) ; .. 3rd ret nz dec hl ld a,e sub (hl) ; .. 4th ret nz pop hl pop hl ret ; ; ; ;l50ba: ld a,d xor h ld a,h jp m,l4fd6 cp d jp nz,l50c7 ld a,l sub e ret z l50c7: jp l4fd7 ld hl,l136c call l5050 l50d0: ld de,l1373 ld a,(de) or a jp z,l4fcc ld hl,l4fd5 push hl call l4fcc dec de ld a,(de) ld c,a ret z ld hl,l1368 xor (hl) ld a,c ret m inc de inc hl ld b,8 l50ed: ld a,(de) sub (hl) jp nz,l50a4 dec de dec hl dec b jp nz,l50ed pop bc ret l50fa: call l50d0 jp nz,l4fd5 ret l5101: call l2273 ld hl,(l1366) ret m jp z,l1377 ; .. error push af ld a,(_stat2) ; Get status and 00100000b ; .. test MS 4.51 exec jp z,l511b ; .. nope pop af call nc,l5196 jp l5163 l511b: pop af jp po,l5131 call l507b ld hl,l58aa call l5075 call l53be call l5196 jp l5134 l5131: call l4d6c l5134: ld a,(l1368) or a push af and 7fh ld (l1368),a ld a,(l1369) cp 90h jp nc,l22be call l51da ld a,(l1369) or a jp nz,l5155 pop af ex de,hl jp l515a l5155: pop af ex de,hl jp p,l5160 l515a: ld a,h cpl ld h,a ld a,l cpl ld l,a l5160: jp l5174 l5163: ld hl,l22be push hl l5167: ld a,(l1369) cp 90h jp nc,l517d call l51da ex de,hl l5173: pop de l5174: ld (l1366),hl l5177: ld a,2 l5179: ld (l1375),a ret l517d: ld bc,90h*256+80h ;;l9080 ld de,null*256+null call l508d ret nz ld h,c ld l,d jp l5173 l518c: call l2273 ret po jp m,l51a9 jp z,l1377 ; .. error l5196: call l503b call l51ce ld a,b or a ret z call l505d ld hl,l1365 ld b,(hl) jp l4e16 l51a9: ld hl,(l1366) l51ac: call l51ce ld a,h ld d,l ld e,0 ld b,90h jp l4fe0 l51b8: call l2273 ret nc jp z,l1377 ; .. error call m,l51a9 l51c2: ld hl,l0000 ld (l1362),hl ld (l1364),hl l51cb: ld a,8 _LD.BC l51ce: ld a,4 jp l5179 call l2273 ret z jp l1377 ; .. error l51da: ld b,a ld c,a ld d,a ld e,a or a ret z push hl call l503b call l505d xor (hl) ld h,a call m,l51fe ld a,98h sub b call l4e55 ld a,h rla call c,l4e28 ld b,0 call c,l4e41 pop hl ret l51fe: dec de ld a,d and e inc a ret nz dec bc ret call l2273 ret m call l4fcc jp p,l5218 call l4ffb call l5218 jp l4ff2 l5218: call l2273 ret m jp nc,l523e jp z,l1377 ; .. error call l5167 ld hl,l1369 ld a,(hl) cp 98h ld a,(l1366) ret nc ld a,(hl) call l51da ld (hl),98h ld a,e push af ld a,c rla call l4dca pop af ret l523e: ld hl,l1369 ld a,(hl) cp 90h jp nz,l5262 ld c,a dec hl ld a,(hl) xor 80h ld b,6 l524e: dec hl or (hl) dec b jp nz,l524e or a ld hl,l8000 jp nz,l5261 call l5174 jp l51b8 l5261: ld a,c l5262: or a ret z cp 0b8h ret nc push af call l503b call l505d xor (hl) dec hl ld (hl),0b8h push af dec hl ld (hl),c call m,l5292 ld a,(l1368) ld c,a ld hl,l1368 ld a,0b8h sub b call l54bd pop af call m,l5475 xor a ld (l1361),a pop af ret nc jp l5429 l5292: ld hl,l1362 l5295: ld a,(hl) dec (hl) or a inc hl jp z,l5295 ret push hl ld hl,l0000 ld a,b or c jp z,l52ba ld a,10h l52a8: add hl,hl jp c,l1377 ; .. error ex de,hl add hl,hl ex de,hl jp nc,l52b6 add hl,bc jp c,l1377 ; .. error l52b6: dec a jp nz,l52a8 l52ba: ex de,hl pop hl ret l52bd: ld a,h rla sbc a,a ld b,a call l5386 ld a,c sbc a,b jp l52cc l52c9: ld a,h rla sbc a,a l52cc: ld b,a push hl ld a,d rla sbc a,a add hl,de adc a,b rrca xor h jp p,l5173 push bc ex de,hl call l51ac pop af pop hl call l5020 ex de,hl call l53a0 jp l57e6 l52e9: ld a,h or l jp z,l5174 push hl push de call l537a push bc ld b,h ld c,l ld hl,l0000 ld a,10h l52fb: add hl,hl jp c,l5321 ex de,hl add hl,hl ex de,hl jp nc,l5309 add hl,bc jp c,l5321 l5309: dec a jp nz,l52fb pop bc pop de l530f: ld a,h or a jp m,l5319 pop de ld a,b jp l5382 l5319: xor 80h or l jp z,l5332 ex de,hl _LD.BC l5321: pop bc pop hl call l51ac pop hl call l5020 call l51ac pop bc pop de jp l4e8a l5332: ld a,b or a pop bc jp m,l5174 push de call l51ac pop de jp l4ffb l5340: ld a,h or l jp z,l1377 ; .. error call l537a push bc ex de,hl call l5386 ld b,h ld c,l ld hl,l0000 ld a,11h push af or a jp l5363 l5359: push af push hl add hl,bc jp nc,l5362 pop af scf _LD.A l5362: pop hl l5363: ld a,e rla ld e,a ld a,d rla ld d,a ld a,l rla ld l,a ld a,h rla ld h,a pop af dec a jp nz,l5359 ex de,hl pop bc push de jp l530f l537a: ld a,h xor d ld b,a call l5381 ex de,hl l5381: ld a,h l5382: or a jp p,l5174 l5386: xor a ld c,a sub l ld l,a ld a,c sbc a,h ld h,a jp l5174 l5390: ld hl,(l1366) call l5386 ld a,h xor 80h or l ret nz ex de,hl call l51ce xor a l53a0: ld b,98h jp l4fe0 l53a5: push de call l5340 xor a add a,d rra ld h,a ld a,e rra ld l,a call l5177 pop af jp l5382 l53b7: ld hl,l1372 ld a,(hl) xor 80h ld (hl),a l53be: ld hl,l1373 ld a,(hl) or a ret z ld b,a dec hl ld c,(hl) ld de,l1369 ld a,(de) or a jp z,l5072 sub b jp nc,l53ea cpl inc a push af ld c,8 inc hl push hl l53da: ld a,(de) ld b,(hl) ld (hl),a ld a,b ld (de),a dec de dec hl dec c jp nz,l53da pop hl ld b,(hl) dec hl ld c,(hl) pop af l53ea: cp '9' ret nc push af call l505d ld hl,l136b ld b,a ld a,0 ld (hl),a ld (l1361),a pop af ld hl,l1372 call l54bd ld a,b or a jp p,l541e ld a,(l136b) ld (l1361),a call l5492 jp nc,l5463 ex de,hl inc (hl) jp z,l5820 call l54e9 jp l5463 l541e: ld a,9eh call l5494 ld hl,l136a call c,l54aa l5429: xor a l542a: ld b,a ld a,(l1368) or a jp nz,l5452 ld hl,l1361 ld c,8 l5437: ld d,(hl) ld (hl),a ld a,d inc hl dec c jp nz,l5437 ld a,b sub 8 cp 0c0h jp nz,l542a jp l4de2 l544a: dec b ld hl,l1361 call l54f1 or a l5452: jp p,l544a ld a,b or a jp z,l5463 ld hl,l1369 add a,(hl) ld (hl),a jp nc,l4de2 ret z l5463: ld a,(l1361) l5466: or a call m,l5475 ld hl,l136a ld a,(hl) and 80h dec hl dec hl xor (hl) ld (hl),a ret l5475: ld hl,l1362 ld b,7 l547a: inc (hl) ret nz inc hl dec b jp nz,l547a inc (hl) jp z,l5820 dec hl ld (hl),80h ret l5489: ld de,l2611 ld hl,l136c jp l549a l5492: ld a,8eh l5494: ld hl,l136c ld de,l1362 l549a: ld c,7 ld (l54a1),a xor a l54a0: ld a,(de) l54a1: adc a,(hl) ld (de),a inc de inc hl dec c jp nz,l54a0 ret l54aa: ld a,(hl) cpl ld (hl),a ld hl,l1361 ld b,8 xor a ld c,a l54b4: ld a,c sbc a,(hl) ld (hl),a inc hl dec b jp nz,l54b4 ret l54bd: ld (hl),c push hl l54bf: sub 8 jp c,l54d4 pop hl l54c5: push hl ld de,8*256+0 l54c9: ld c,(hl) ld (hl),e ld e,c dec hl dec d jp nz,l54c9 jp l54bf l54d4: add a,9 ld d,a l54d7: xor a pop hl dec d ret z l54db: push hl ld e,8 l54de: ld a,(hl) rra ld (hl),a dec hl dec e jp nz,l54de jp l54d7 l54e9: ld hl,l1368 ld d,1 jp l54db l54f1: ld c,8 l54f3: ld a,(hl) rla ld (hl),a inc hl dec c jp nz,l54f3 ret l54fc: call l4fcc ret z ld a,(l1373) or a jp z,l4de2 call l4f80 call l5635 ld (hl),c inc de ld b,7 l5511: ld a,(de) inc de or a push de jp z,l5531 ld c,8 l551a: push bc rra ld b,a call c,l5492 call l54e9 ld a,b pop bc dec c jp nz,l551a l5529: pop de dec b jp nz,l5511 jp l5429 l5531: ld hl,l1368 call l54c5 jp l5529 l553a: db 0cdh,0cch,0cch,0cch,0cch,0cch,04ch,07dh ; db 000h,000h,000h,000h l5546: db 000h,000h,020h,084h l554a: ld a,(l1369) cp 'A' jp nc,l555e ld de,l553a ld hl,l136c call l5050 jp l54fc l555e: ld a,(l1368) or a jp p,l556e and 7fh ld (l1368),a ld hl,l4ffb push hl l556e: call l55a6 ld de,l1362 ld hl,l136c call l5050 call l55a6 call l53be ld de,l1362 ld hl,l136c call l5050 ld a,0fh l558b: push af call l55ae call l55ba call l53be ld hl,l1372 call l55cb pop af dec a jp nz,l558b call l55a6 call l55a6 l55a6: ld hl,l1369 dec (hl) ret nz jp l4de2 l55ae: ld hl,l1373 ld a,4 l55b3: dec (hl) ret z dec a jp nz,l55b3 ret l55ba: pop de ld a,4 ld hl,l136c l55c0: ld c,(hl) inc hl ld b,(hl) inc hl push bc dec a jp nz,l55c0 push de ret l55cb: pop de ld a,4 ld hl,l1373 l55d1: pop bc ld (hl),b dec hl ld (hl),c dec hl dec a jp nz,l55d1 push de ret l55dc: ld a,(l1373) or a jp z,l582c ld a,(l1369) or a jp z,l4de2 call l4f7d inc (hl) inc (hl) jp z,l5820 call l5635 ld hl,l2618 ld (hl),c ld b,c l55fa: ld a,9eh call l5489 ld a,(de) sbc a,c ccf jp c,l560c ld a,8eh call l5489 xor a _JP.C l560c: ld (de),a inc b ld a,(l1368) inc a dec a rra jp m,l5466 rla ld hl,l1362 ld c,7 call l54f3 ld hl,l2611 call l54f1 ld a,b or a jp nz,l55fa ld hl,l1369 dec (hl) jp nz,l55fa jp l4de2 l5635: ld a,c ld (l1372),a dec hl ld de,l2617 ld bc,7*256+0 ;;l0700 l5640: ld a,(hl) ld (de),a ; .. unpack ld (hl),c ; .. and clear dec de dec hl dec b jp nz,l5640 ret l564a: call l507b ex de,hl dec hl ld a,(hl) or a ret z add a,2 jp c,l5820 ld (hl),a push hl call l53be pop hl inc (hl) ret nz jp l5820 call l4de2 call l51cb _OR l5669: xor a ld bc,l228e push bc push af ld a,1 ld (l137f),a pop af ex de,hl ld bc,l00ff ld h,b ld l,b call z,l5174 ex de,hl ld a,(hl) cp '&' jp z,l228f cp '-' push af jp z,l5691 cp '+' jp z,l5691 dec hl l5691: call l2263 jp c,l5778 cp '.' jp z,l571e cp 65h jp z,l56a3 cp 'E' l56a3: jp nz,l56cd push hl call l2263 cp 6ch jp z,l56bb cp 'L' jp z,l56bb cp 71h jp z,l56bb cp 'Q' l56bb: pop hl jp z,l56cc ld a,(l1375) cp 8 jp z,l56e6 ld a,0 jp l56e6 l56cc: ld a,(hl) l56cd: cp '%' jp z,l572b cp '#' jp z,l573c cp '!' jp z,l573d cp 64h jp z,l56e6 cp 'D' jp nz,l56fd l56e6: or a call l5746 call l2263 call l2284 l56f0: call l2263 jp c,l57eb inc d jp nz,l56fd xor a sub e ld e,a l56fd: push hl ld a,e sub b ld e,a l5701: call p,l5755 call m,l5765 jp nz,l5701 pop hl pop af push hl call z,l4ff2 pop hl call l2273 ret pe push hl ld hl,l4ede push hl call l517d ret l571e: call l2273 inc c jp nz,l56fd call c,l5746 jp l5691 l572b: call l2263 pop af push hl ld hl,l4ede push hl ld hl,l5101 push hl push af jp l56fd l573c: or a l573d: call l5746 call l2263 jp l56fd l5746: push hl push de push bc push af call z,l518c pop af call nz,l51b8 pop bc pop de pop hl ret l5755: ret z push af call l2273 push af call po,l4fb5 pop af call pe,l564a pop af dec a ret l5765: push de push hl push af call l2273 push af call po,l4ee5 pop af call pe,l554a pop af pop hl pop de inc a ret l5778: push de ld a,b adc a,c ld b,a push bc push hl ld a,(hl) sub '0' push af call l2273 jp p,l57b1 ld hl,(l1366) ld de,l0ccd call l2375 jp nc,l57ad ld d,h ld e,l add hl,hl add hl,hl add hl,de add hl,hl pop af ld c,a add hl,bc ld a,h or a jp m,l57ab ld (l1366),hl l57a5: pop hl pop bc pop de jp l5691 l57ab: ld a,c push af l57ad: call l51a9 scf l57b1: jp nc,l57cd ld bc,94h*256+74h ;;l9474 ld de,24h*256+00h ;;l2400 call l508d jp p,l57ca call l4fb5 pop af call l57e0 jp l57a5 l57ca: call l51c2 l57cd: call l564a call l507b pop af call l4fdb call l51c2 call l53be jp l57a5 l57e0: call l5020 call l4fdb l57e6: pop bc pop de jp l4d7b l57eb: ld a,e cp 0ah jp nc,l57fa rlca rlca add a,e rlca add a,(hl) sub '0' ld e,a _JP.M l57fa: ld e,7fh jp l56f0 l57ff: push hl ld hl,l1368 call l2273 jp po,l580f ld a,(l1372) jp l5810 l580f: ld a,c l5810: xor (hl) rla pop hl jp l5836 pop af pop af l5818: ld a,(l1368) rla jp l5836 l581f: pop af l5820: ld a,(l136a) cpl rla jp l5836 l5828: ld a,c jp l582f l582c: ld a,(l1372) l582f: rla ld hl,l1381 ld (l1383),hl l5836: push hl push bc push de push af push af ld hl,(l137d) ld a,h or l jp nz,l5863 ld hl,l137f ld a,(hl) or a jp z,l5850 dec a jp nz,l5863 inc (hl) l5850: ld hl,(l1383) call l22c4 ld (l1380),a ld a,0dh call l22d6 ld a,0ah call l22d6 l5863: pop af ld hl,l1366 ld de,l58a2 jp nc,l5870 ld de,l58a6 l5870: call l504a call l2273 jp c,l5882 ld hl,l1362 ld de,l58a6 call l504a l5882: ld hl,(l137d) ld a,h or l ld hl,(l1383) ld de,l1382 ex de,hl ld (l1383),hl jp z,l589d call l2375 jp z,l22be jp l1377 ; .. error l589d: pop af pop de pop bc pop hl ret ; l58a2: db 0ffh,0ffh,07fh,0ffh l58a6: db 0ffh,0ffh,0ffh,0ffh l58aa: db 000h,000h,000h,000h l58ae: db 000h,000h,000h,080h ; ; Token : RESET ; l58b2:: ld hl,l17bb ld (hl),'R' inc hl ld (hl),'S' inc hl ld (hl),0b2h inc hl ex de,hl jp l0395 ; ; Invalid Tokens ; l58c2: jp l02df ; ; Keworad pointer table ; l58c5: dw l5902 ; A.. dw l5915 dw l591a dw l5954 dw l597d dw l59a2 dw l59b6 dw l59c5 dw l59ca dw l5b5d ; ## No J.. dw l59ec dw l59f1 dw l5a25 dw l5a3e dw l5a51 dw l5a67 dw l5b5d ; ## No Q.. dw l5a7b dw l5ab9 dw l5af0 dw l5b06 dw l5b37 dw l5b41 dw l5b59 dw l5b5d ; ## No Y.. dw l5b5d ; ## No Z.. ; ; %... ; l58f9: dc 'INCLUDE' db 70h db 0 ; ; A... ; l5902: dc 'ND' db 018h dc 'BS' db 0c0h dc 'SC' db 0a9h dc 'S' db 097h dc 'TN' db 0c1h dc 'UTO' db 096h db 0 ; ; B... ; l5915: dc 'ASE' db 98h db 0 ; ; C... ; l591a: dc 'LEAR' db 08bh dc 'ALL' db 069h dc 'LOSE' db 07eh dc 'INT' db 0a4h dc 'SNG' db 0a5h dc 'DBL' db 0a6h dc 'HR$' db 0c2h dc 'OS' db 0c3h dc 'VI' db 0d9h dc 'VS' db 0dah dc 'VD' db 0dbh dc 'ONT' db 096h dc 'HAIN' db 8dh dc 'OMMON' db 072h db 0 ; ; D... ; l5954: dc 'ATA' db 056h dc 'IM' db 071h dc 'EFDBL' db 06ah dc 'EFINT' db 06bh dc 'EFSNG' db 06ch dc 'EFSTR' db 06dh dc 'ELETE' db 096h dc 'EF' db 060h db 0 ; ; E... ; l597d: dc 'ND' db 089h dc 'QV' db 01bh dc 'LSE' db 0a0h dc 'RROR' db 82h dc 'RL' db 0deh dc 'RR' db 0ddh dc 'DIT' db 96h dc 'RASE' db 95h dc 'XP' db 0c4h dc 'OF' db 0d3h db 0 ; ; F... ; l59a2: dc 'OR' db 08ah dc 'IELD' db 066h dc 'ILES' db 08eh dc 'IX' db 0c5h dc 'RE' db 0a7h db 0 ; ; G... ; l59b6: dc 'OSUB' db 057h dc 'OTO' db 058h dc 'ET' db 07fh dc 'O' db 085h db 0 ; ; H... ; l59c5: dc 'EX$' db 0c6h db 0 ; ; I... ; l59ca: dc 'F' db 059h dc 'NPUT$' db 0bfh dc 'NPUT' db 05bh dc 'MP' db 01dh dc 'NSTR' db 0bbh dc 'NP' db 0a8h dc 'NT' db 0c8h dc 'NKEY$' db 0e0h db 0 ; ; K... ; l59ec: dc 'ILL' db 087h db 0 ; ; L... ; l59f1: dc 'ET' db 05ch dc 'IST' db 096h dc 'INE' db 063h dc 'LIST' db 096h dc 'PRINT' db 07ah dc 'OAD' db 096h dc 'EFT$' db 0c7h dc 'OG' db 0c9h dc 'EN' db 0aah dc 'SET' db 067h dc 'POS' db 0adh dc 'OC' db 0d4h dc 'OF' db 0d5h db 0 ; ; M... ; l5a25: dc 'OD' db 010h dc 'ERGE' db 096h dc 'ID$' db 0cah dc 'KI$' db 0d6h dc 'KS$' db 0d7h dc 'KD$' db 0d8h db 0 ; ; N... ; l5a3e: dc 'EW' db 096h dc 'EXT' db 073h dc 'OT' db 019h dc 'ULL' db 077h dc 'AME' db 088h db 0 ; ; O... ; l5a51: dc 'N' db 078h dc 'R' db 01ah dc 'UT' db 061h dc 'PEN' db 080h dc 'CT$' db 0cbh dc 'PTION' db 06eh db 0 ; ; P... ; l5a67: dc 'RINT' db 074h dc 'OKE' db 062h dc 'OS' db 0abh dc 'UT' db 081h dc 'EEK' db 0aeh db 0 ; ; R... ; l5a7b: dc 'EAD' db 05dh dc 'EM' db 06fh dc 'ETURN' db 05fh dc 'ESUME' db 064h dc 'ESTORE' db 05eh dc 'UN' db 08ch dc 'ENUM' db 096h dc 'ESET' db 08fh dc 'SET' db 068h dc 'ND' db 0cch dc 'IGHT$' db 0cdh dc 'ANDOMIZE' db 086h db 0 ; ; S... ; l5ab9: dc 'TOP' db 076h dc 'PC' db 09dh dc 'PACE$' db 0bch dc 'TRING$' db 0bdh dc 'TR$' db 0d0h dc 'WAP' db 065h dc 'GN' db 0afh dc 'IN' db 0ceh dc 'QR' db 0cfh dc 'TEP' db 09fh dc 'UB' db 09ah dc 'AVE' db 096h dc 'YSTEM' db 089h db 0 ; ; T... ; l5af0: dc 'O' db 09bh dc 'AB' db 09ch dc 'AN' db 0d1h dc 'HEN' db 09eh dc 'ROFF' db 07bh dc 'RON' db 07ch db 0 ; ; U... ; l5b06: dc 'SR0' db 0b1h dc 'SR1' db 0b2h dc 'SR2' db 0b3h dc 'SR3' db 0b4h dc 'SR4' db 0b5h dc 'SR5' db 0b6h dc 'SR6' db 0b7h dc 'SR7' db 0b8h dc 'SR8' db 0b9h dc 'SR9' db 0bah dc 'SR' db 0b1h dc 'SING' db 0a1h db 0 ; ; V... ; l5b37: dc 'ARPTR' db 099h dc 'AL' db 0d2h db 0 ; ; W... ; l5b41: dc 'AIT' db 079h dc 'IDTH' db 07dh dc 'HILE' db 083h dc 'END' db 084h dc 'RITE' db 075h db 0 ; ; X... ; l5b59: dc 'OR' db 01ch db 0 ; ; J.., Q.., Y.., Z.. ; l5b5d: db 0 ; l5b5e: db 00h,01h,01h,01h,80h,80h,80h db 81h,80h,80h,78h,68h,70h,40h db 78h,68h,40h,51h,51h,51h,51h db 51h,51h,41h,70h,80h,70h,41h db 70h,40h,41h,81h,81h,81h,81h db 01h,01h,81h,81h,01h,01h,81h db 81h,81h,01h,01h,01h,01h,01h db 01h,81h,81h l5b92: db 80h,80h,80h,80h,80h,00h,21h db 62h,21h,23h,25h,68h,80h,06h db 06h,06h,06h,06h,06h,80h,80h db 07h,80h,49h,80h,80h,80h,80h db 80h,80h,80h,80h,80h,80h,80h db 80h,80h,80h,80h,80h,80h,80h db 80h,80h,80h,80h,80h,04h ; ; ; l5bc2: sub 3 ld (hl),a ld (l6db1),hl ld (l6db3),hl ld a,(l6db7) ld (l6db5),a ld a,(l6dba) ld (l6db8),a ld hl,l6d99 ld a,8 call clrmem ; Clear double ld hl,l12db ; Init pointer l5be2: ld a,(hl) ; Get link inc hl ld h,(hl) ld l,a or h ; Test NIL jp z,l5bf8 ; .. yeap push hl inc hl inc hl ld a,(hl) inc hl ld h,(hl) ld l,a call l5bfb pop hl jp l5be2 l5bf8: jp l7482 ; ; ; l5bfb: push hl call chk.mem ; Test enough memory ld hl,(l6da9) ex (sp),hl ; .. change values ld (l6da9),hl push hl ld hl,(l6dab) ex (sp),hl push hl ld hl,(l6daf) ex (sp),hl push hl ld de,l0004 add hl,de ld a,(hl) add a,a ld hl,5*256+5 ;;l0505 add a,l ld l,a ld (l6dab),hl ld hl,(l6dad) ex (sp),hl xor a ld (l6db0),a ld de,l5c45 ; Set return address push de ld de,0 push de ld a,(hl) ; Get token ??? sub 4 ; Strip off offset cp 06bh-4 ; Test range call nc,intern.err ; .. error ld c,a ; Set index ld b,0 ld hl,l5c5a add hl,bc ; .. point into table add hl,bc ld c,(hl) ; .. fetch address inc hl ld b,(hl) jp l5d27 ; .. process it ; ; ; l5c45: pop hl ; Get back old stuff ld (l6dad),hl pop hl ld (l6daf),hl pop hl ld (l6dab),hl ld hl,(l6da9) ex (sp),hl ld (l6da9),hl pop hl ret ; l5c5a:: dw l6f5f dw l6f6f dw l6f84 dw intern.err dw l6f50 dw l6dbd dw l6e01 dw l6dfd dw l6df5 dw l6df2 dw l6e24 dw l6e06 dw l6ddc dw l70b2 dw l70ea dw l704e dw l6faa dw l7092 dw l7038 dw l6e46 dw l6e49 dw l6ee1 dw l6e6b dw intern.err dw l6eaf dw l6ed1 dw l6e3e dw l71b2 dw l71bf dw l71cc dw l6f5c dw l70fd dw l714a dw l71a5 dw l71aa dw l719f dw l71a2 dw l7175 dw l7160 dw l7188 dw l7199 dw l719c dw l7190 dw l7235 dw l7138 dw l71af dw l6f8d dw l6f97 dw l7324 dw l72b2 dw l72b8 dw l70fd dw l7430 dw l745f dw l73a9 dw l737e dw l73d2 dw l7390 dw l732e dw l7327 dw l7321 dw l7370 dw l736b dw l72ea dw l72ed dw l72f0 dw l72f3 dw l72f9 dw l72fe dw l7306 dw l730a dw l730e dw l7312 dw l731a dw l737a dw l7355 dw l733c dw l72e4 dw l7202 dw l6f3c dw l6f44 dw l7439 dw l71ff dw l72d3 dw l72cf dw l72bd dw l72c6 dw l729a dw l6eeb dw l7296 dw l7289 dw l728c dw l727a dw l725f dw l7209 dw l72ae dw l71fc dw l71f6 dw l72df dw l71f1 dw l71ec dw l711d ; ; ; l5d26: inc bc ; ; ; l5d27: ld hl,l5d26 push hl ; Set return address ld a,(bc) ; .. fetch control byte and 11111000b ; Mask bits jp m,l5d57 ; .. process >= 0x8X rra ; .. right justify rra rra call caseswitch dw l5dc7 ; 0x00 - 0x07 dw l5dc7 ; 0x08 - 0x0F dw l5dd7 ; 0x10 - 0x17 dw l5de4 ; 0x18 - 0x1F dw @push ; 0x20 - 0x27 dw @push ; 0x28 - 0x2F dw l5e42 ; 0x30 - 0x37 dw l5e63 ; 0x38 - 0x3F dw l5e7a ; 0x40 - 0x47 dw l5e88 ; 0x48 - 0x4F dw l5eaa ; 0x50 - 0x57 dw l5ebc ; 0x58 - 0x5F dw l5ed6 ; 0x60 - 0x67 dw intern.err ; 0x68 - 0x6F dw l5ef3 ; 0x70 - 0x77 dw l624d ; 0x78 - 0x7F l5d57: ld a,(bc) ; Get code cp 09eh+1 ; Test range jp nc,l5da0 and 01111111b ; .. mask bit call caseswitch dw @jr ; 0x80 dw l5f92 ; 0x81 dw l5f92 ; 0x82 dw @chn ; 0x83 dw l5ff2 ; 0x84 dw l6264 ; 0x85 dw l5e14 ; 0x86 dw l626c ; 0x87 dw l6271 ; 0x88 dw l629c ; 0x89 dw l62ae ; 0x8A dw l62b4 ; 0x8B dw l62c1 ; 0x8C dw l62f2 ; 0x8D dw l6300 ; 0x8E dw l5f18 ; 0x8F dw @jzi ; 0x90 dw l6328 ; 0x91 dw l630c ; 0x92 dw l633b ; 0x93 dw l6341 ; 0x94 dw l5f3f ; 0x95 dw l5e2a ; 0x96 dw l63c1 ; 0x97 dw l634d ; 0x98 dw l63e1 ; 0x99 dw @cal ; 0x9A dw @ret ; 0x9B dw l627b ; 0x9C dw l6286 ; 0x9D dw l5db2 ; 0x9E l5da0: cp 0a2h+1 ; Test range jp c,l5f00 cp 0a7h+1 jp c,l5f05 cp 0c4h+1 jp c,l5f0a jp @sav ; ; Code 0x9E 0xXX ; l5db2: inc bc ; .. skip to next ld a,(bc) ; .. get byte call caseswitch dw l6291 ; 0x9E 0x00 dw l62d2 ; 0x9E 0x01 dw l637f ; 0x9E 0x02 dw l6361 ; 0x9E 0x03 dw l63ca ; 0x9E 0x04 dw l63d4 ; 0x9E 0x05 dw l63f8 ; 0x9E 0x06 dw l6347 ; 0x9E 0x07 ; ; Code 0x00 - 0x0F ; l5dc7: ld a,(bc) ; Get code and 00001111b ; .. mask lower bits push af ld h,b ; .. copy pointer ld l,c inc hl call l65de ; .. process pop af add a,c ; Add value to pointer ld c,a ret nc inc b ret ; ; Code 0x10 - 0x17 ; l5dd7: ld a,(bc) ; Get code and 00000111b ; .. mask lower bits cp 00000100b ; Test range jp c,l5ff4 and 00000011b ; .. strip off bit jp l66a4 ; ; Code 0x18 - 0x1F ; l5de4: ld a,(bc) ; Get code and 00000011b ; Mask lower two bits ld hl,l6dad add a,(hl) ; .. add to code ld (hl),a ; .. save ld a,(bc) ; Get code again and 00000100b ; Test 0x1C - 0x1F ret z ; .. nope xor a jp l6582 ; ; Code 0x20 - 0x2F : Push code onto stack ; @push: ld a,(bc) ; Get code l5df5: ld e,a ; .. save rra ; Shift in bits rra and 00000011b ; .. mask bits ld d,a ld a,e and 00000011b ; .. next ones push bc push de call l67ff ld a,(hl) ; Get value cp 0f6h ; Test ??? jp z,l5e0f cp 004h ld a,d call nc,l5bfb l5e0f: pop de ; Get back old pop bc ex (sp),hl ; .. get back caller push de ; .. save parameter jp (hl) ; ; Code 0x86 ; l5e14: ld a,2 call l664d ex de,hl ld hl,(l6da9) ld a,5 call adda ; HL+ACCU ld (hl),e inc hl ld (hl),d ld a,8 jp l5df5 ; ; Code 0x96 ; l5e2a: ld hl,(l6da9) ld de,l000b add hl,de ld e,(hl) inc hl ld d,(hl) dec hl dec hl dec hl dec hl dec hl dec hl ld (hl),d dec hl ld (hl),e ld a,8 jp l5df5 ; ; Code 0x30 - 0x37 ; l5e42: push bc ld a,(bc) ; Get code and 00000011b ; .. mask lower bits call l67ff ld a,(hl) cp 0f6h ; Test ??? jp z,l5e54 ld a,3 call l5bfb l5e54: push hl call l68bb pop hl ld de,l0004 add hl,de ld a,(hl) ld (l6daf),a pop bc ret ; ; Code 0x38 - 0x3F ; l5e63: ld a,(bc) ; Get code and 00000011b ; .. lower bits call l67ff call l67b1 ld a,(bc) and 00000100b ; Test bit set jp nz,l5e76 ld a,l jp l6623 l5e76: ld a,h jp l6623 ; ; Code 0x40 - 0x47 ; l5e7a: ld a,03fh call l6653 ; Shift bit cp 3 call c,l67b1 ld a,l jp l6615 ; ; Code 0x48 - 0x4F ; l5e88: ld a,027h call l6653 ; Shift bit ld a,(bc) ; Get code and 00000111b ; .. get bits cp 5 ; Test 0x4D jp nz,l6629 ; .. nope push bc ex de,hl ld bc,0*256+9 ld a,001h call ini.dat.0 ; Init ??? data ld (hl),e ; Save address inc hl ld (hl),d ld de,-6 add hl,de ; .. fix pointer for start pop bc jp l6629 ; ; Code 0x50 - 0x57 ; l5eaa: ld a,03fh call l6653 ; Shift bit cp 3 call c,l67b1 ld a,l ld hl,(l6da9) inc hl inc hl ld (hl),a ret ; ; Code 0x58 - 0x5F ; l5ebc: ld a,03fh call l6653 ; Shift bit cp 2 jp nz,l5ecc ex de,hl ld hl,l6dac inc (hl) ex de,hl l5ecc: cp 3 call c,l67b1 ld a,0e2h jp l6637 ; ; Code 0x60 - 0x67 ; l5ed6: ld a,03fh call l6653 ; Shift bit cp 2 jp nz,l5ee6 ex de,hl ld hl,l6dac inc (hl) ex de,hl l5ee6: cp 3 call c,l67b1 call neg.hl ; -HL ld a,2 jp l6637 ; ; Code 0x70 - 0x77 ; l5ef3: ld a,(bc) ; Get code and 00000111b ; .. get bits ld hl,l6dad add a,(hl) ld (hl),a ld a,2 jp l6582 ; ; Code 0x9F - 0xA2 ; l5f00: ld h,2 jp l5f0d ; ; Code 0xA3 - 0xA7 ; l5f05: ld h,3 jp l5f0d ; ; Code 0xA8 - 0xC4 ; l5f0a: ld h,0 ld a,(bc) l5f0d: ld (l6dad+1),a ; .. set hi xor a ld (l6dad),a ; .. clear lo ld a,h jp l6582 ; ; Code 0x8F ; l5f18: call l6642 db 0cdh ld a,5 call l664d ld a,032h call l6637 ld hl,l6dab inc (hl) ret ; ; Code 0xC5 - 0xFF : Save code ; @sav: ld a,(bc) ; Get byte ld (l6dad+1),a ; .. save for fi xor a ld (l6dad),a ; Clear lo ret ; ; Code 0x80 0xJJ : Jump to pointer+0xBB ; @jr: inc bc ; Point to next ld a,(bc) ; .. get it ld l,a ; .. for index rla sbc a,a ; .. expand to 16 bit ld h,a add hl,bc ; .. fix pointer ld b,h ; .. copy ld c,l dec bc ret ; ; Code 0x95 0xXXXX ; l5f3f: inc bc ld a,(bc) ; Get next 16 bit ld l,a inc bc ld a,(bc) ld h,a add hl,bc ; .. add to pointer ld b,h ; .. get it ld c,l dec bc dec bc ret ; ; Skip next byte (Jump target) ; @skp: inc bc ret ; ; Code 0x9A 0xWWWW - Call routine ; @cal: inc bc ld a,(bc) ; Get offset ld l,a inc bc ld a,(bc) ld h,a add hl,bc ; .. set pointer dec hl dec hl push hl or a ld hl,l5f70 dec (hl) ; Count down stack depth ld a,5 call m,prc.err ; .. too complex call c,intern.err ; .. dtto. ld hl,(l5f71) ld (hl),c ; .. save onto stack inc hl ld (hl),b inc hl ld (l5f71),hl pop bc ret l5f70: db 8 l5f71: dw l5f73 l5f73: ds 2*8 ; ; Code 0x9B - Return from call ; @ret: ld hl,l5f70 inc (hl) ; .. bump stack depth ld hl,(l5f71) ; Get stack pointer dec hl ld b,(hl) ; .. get from stack dec hl ld c,(hl) ld (l5f71),hl ret ; ; Code 0x81, 0x82 ; l5f92: ld hl,(l5fba) ld a,h or l push af jp nz,l5fa1 call l2a03 ld (l5fba),hl l5fa1: ld a,(bc) ; Get code cp 081h ; .. test it ld a,092h jp z,l5fab ld a,022h l5fab: ld hl,l5fba call l65de pop af ret z ld hl,l0000 ld (l5fba),hl ret ; l5fba: dw 0 ; ; Code 0x83 0xMM 0xJJ : Chain thru code ; @chn: ld hl,(l6da9) ld de,l0004 add hl,de ; Position pointer ld d,(hl) ; .. get value inc hl dec d ; .. -1 call l654d ; .. get from linkage add a,a ; .. *16 add a,a add a,a add a,a push af ld a,00001111b ; Set default low inc hl ; .. skip to next inc hl dec d ; Count doen jp m,l5fd9 ; .. no more call l654d l5fd9: pop hl or h ; Insert bits ld d,a ; .. save inc bc ; Skip code l5fdd: ld a,(bc) ; Get next byte inc bc and d ; .. mask ld e,a and 11110000b ; Get only hi jp z,l5fe8 ; .. zero xor e ; Test same ret nz ; .. nope l5fe8: ld a,(bc) ; Get code add a,c ld c,a ; .. fix pointer ld a,0 adc a,b ld b,a jp l5fdd ; .. try next ; ; Code 0x84 ; l5ff2: ld a,0ffh l5ff4: ld (l602b),a push bc ld hl,l6da1 ld a,8 call clrmem ; Clear double ld hl,l0004 add hl,sp l6004: ld a,(hl) inc hl or (hl) ld a,(hl) inc hl jp z,l601f ld e,(hl) inc hl ld d,(hl) inc hl push hl add a,a ld hl,l6da1 call adda ; HL+ACCU ld (hl),e inc hl ld (hl),d pop hl jp l6004 l601f: call l6134 pop bc ld a,(l602b) and a call p,l66a4 ret l602b: db 0 l602c: ds 3 l602f: ld a,b cp 3 scf ret z call l67dd ld a,(hl) cp e jp nz,l6040 inc hl ld a,(hl) cp d ret z l6040: push bc ld c,0 ld hl,l6d99 l6046: ld a,(hl) cp e inc hl ld a,(hl) inc hl jp nz,l6052 cp d jp z,l605c l6052: inc c ld a,c cp 3 jp nz,l6046 pop bc scf ret l605c: ld a,b call l66a4 ld a,b add a,a add a,a add a,c ld b,a ld hl,(l6da3) push de ex de,hl ld hl,(l6da5) call cmp.r ; Test HL=DE pop de ld a,b pop bc jp nz,l670f ; .. nope jp l6715 l6079: push de push hl ld a,b cp 3 jp z,l60ad inc hl inc hl inc hl inc hl ld a,(hl) and a jp z,l60cc cp 80h jp nc,l60cc call l66a2 ld a,b call l66a4 call l66a2 ld a,0b1h call l65de ld a,2 pop hl pop de call l691a ld a,b add a,a add a,a add a,2 jp l670f l60ad: inc hl ld a,3 call l66a4 ld a,(hl) ld hl,l69f2 call l66f7 pop hl push hl ld de,l0004 add hl,de ld a,0e1h call l65de pop hl pop de ld a,3 jp l691a l60cc: ld a,b call l66a4 ld a,b call l6707 ld l,(hl) ld a,l and a jp nz,l6106 ld hl,(l6d9f) inc hl ld a,(hl) cp 5 ld de,l0000 ld hl,l1271 jp z,l60ed ld hl,l127e l60ed: call l611b ld a,b add a,a ld hl,l6da1 call adda ; HL+ACCU ld (hl),0 inc hl ld (hl),0 pop hl push hl inc hl inc hl inc hl dec (hl) pop hl pop de ret l6106: ld h,0 and 7fh ld l,a add hl,hl add hl,hl add hl,hl ex de,hl ld hl,l1262 call l611b pop hl pop de ld a,b jp l691a l611b: push bc ex de,hl push hl ld bc,4 ;;l0004 call alloc.dwn ; Allocate BC bytes ld (hl),e ; .. save entry inc hl ld (hl),d pop de inc hl ld (hl),e inc hl ld (hl),d ld de,-8 ;;Lfff8 add hl,de ; .. fix for previous pop bc jp l6629 l6134: ld a,(l6db0) and a jp z,l6151 ld a,9 call l655c jp nz,l6151 ld hl,(l6da3) ex de,hl ld hl,(l6da5) ld (l6da3),hl ex de,hl ld (l6da5),hl l6151: ld hl,(l6da1) ld a,h or l jp z,l615f ex de,hl ld b,0 call l602f l615f: ld hl,(l6da3) ld a,h or l jp z,l616d ex de,hl ld b,1 call l602f l616d: ld b,3 ld hl,l6da7 l6172: ld e,(hl) inc hl ld d,(hl) inc hl push hl ld a,d or e jp z,l61bf ld a,b call l67dd ld a,e cp (hl) jp nz,l618b ld a,d inc hl cp (hl) jp z,l61bf l618b: call l602f jp nc,l61bf ld a,(de) cp 0f6h jp z,l619f ex de,hl ld a,b call l6818 jp l61bf l619f: ld hl,l0004 add hl,de ex de,hl inc hl ld a,(hl) dec hl ld a,(de) inc a jp z,l61b2 call l6079 jp l61bf l61b2: call l6897 inc a ld c,a ld a,b ld hl,l602c call adda ; HL+ACCU ld (hl),c l61bf: pop hl inc b ld a,b cp 3 jp z,l61d4 cp 4 jp nz,l6172 ld b,0 ld hl,l6da1 jp l6172 l61d4: ld a,0ffh ld (l624a),a l61d9: ld hl,l602c ld b,3 xor a l61df: cp (hl) jp nc,l61e6 ld a,(hl) ld e,l ld d,h l61e6: inc hl dec b jp nz,l61df and a jp z,l6218 ex de,hl ld (hl),0 ld de,l602c ld d,a ld a,l sub e ld b,a ld a,d ld hl,l624a cp (hl) ld (hl),a jp z,l620b call l63fd ld (l624b),hl jp l61d9 l620b: ld hl,(l624b) ex de,hl call l602f jp nc,l61d9 call intern.err ; .. error l6218: ld a,4 ld hl,l6da1 ld de,l6d99 l6220: push af ld c,(hl) inc hl ld b,(hl) inc hl ld a,b or c jp z,l6242 push bc inc bc inc bc inc bc ld a,(bc) sub 1 ld (bc),a call c,intern.err ; Error pop bc ld a,(de) cp c call nz,intern.err inc de ld a,(de) dec de cp b call nz,intern.err l6242: inc de inc de pop af dec a jp nz,l6220 ret l624a: db 0 l624b: dw 0 ; ; Code 0x78 - 0x7F ; l624d: ld a,(bc) ; Get code and 00000011b ; .. bits ld hl,(l6da9) call l691a ld a,(hl) cp 4 jp c,l6264 ld (hl),0f6h ld de,l0004 add hl,de ld (hl),0 ; ; Code 0x85 ; l6264: pop hl l6265: pop hl ; Pull from stack ld a,h or l ; .. until NIL jp nz,l6265 ret ; ; Code 0x87 ; l626c: ld a,92h jp l632a ; ; Code 0x88 0xJJ ; l6271: ld a,(_stat1) ; Get status rra ; .. test debug jp nc,@skp ; .. nope jp @jr ; ; Code 0x9C 0xJJ ; l627b: ld a,(_stat1) ; Get status and 00001000b ; .. test Z80 codes jp z,@skp ; .. nope jp @jr ; ; Code 0x9D 0xJJ ; l6286: ld a,(_stat2) ; Get status and 00100000b ; .. test MS exec jp z,@skp ; .. nope jp @jr ; ; Code 0x9E 0x00 0xJJ ; l6291: ld a,(_stat1) ; Get status and 01000000b ; .. test ON ERROR jp z,@skp ; .. nope jp @jr ; ; Code 0x89 0xJJ ; l629c: ld hl,(l6da9) ; Get pointer l629f: inc hl ld a,(hl) ; Fetch value cp 5 ; .. jump if 5 jp z,@jr cp 6 ; .. or 6 jp nz,@skp jp @jr ; ; Code 0x8A 0xJJ ; l62ae: call l67cf ; Get pointer jp l629f ; .. jump or skip ; ; Code 0x8B 0xJJ ; l62b4: call l67cf inc hl ld a,(hl) cp 7 jp nz,@skp jp @jr ; ; Code 0x8C 0xJJ ; l62c1: call l67e4 call l2c21 jp c,@skp and 01100000b jp nz,@skp jp @jr ; ; Code 0x9E 0x01 0xJJ ; l62d2: call l67e4 call l2c21 jp c,@skp and a jp p,@skp jp @jr ; ; Code 0x90 0xXX 0xJJ - Jump if zero ; @jzi: inc bc ; Skip code ld a,(bc) ; Get next ld hl,(l6da9) ld de,l0004 add hl,de cp (hl) ; .. compare jp z,@jr ; .. hit it, so jump jp @skp ; ; Code 0x8D 0xJJ ; l62f2: ld hl,(l6da9) inc hl inc hl ld a,(hl) and 00001000b jp z,@jr jp @skp ; ; Code 0x8E 0xJJ ; l6300: ld hl,(l6da9) inc hl inc hl dec (hl) jp nz,@jr jp @skp ; ; Code 0x92 ; l630c: ld hl,(l6da9) inc hl inc hl ld a,(hl) xor 00001000b ; Toggle bit ld (hl),a inc hl inc hl inc hl ld e,(hl) inc hl ld d,(hl) inc hl ld a,(hl) ld (hl),e ld e,a inc hl ld a,(hl) ld (hl),d dec hl dec hl ld (hl),a dec hl ld (hl),e ret ; ; Code 0x91 0xXX ; l6328: inc bc ld a,(bc) ; Get code l632a: push af ld a,5 call l664d pop af or 00000010b ; .. set bit call l6637 ld hl,l6dab dec (hl) ret ; ; Code 0x93 ; l633b: ld a,(l6daf) jp l6615 ; ; Code 0x94 ; l6341: ld a,1 ld (l6db0),a ret ; ; Code 0x9E 0x07 ; l6347: ld a,0 ld (l6db0),a ret ; ; Code 0x98 ; l634d: ld a,(AESTK.base) ; Get stack base ld hl,AESTK.ptr cp (hl) ; .. test on base ret z ; .. yeap, that's it call pop.AESTK ; .. get result from stack call l64bf call l644d jp l634d ; ; Code 0x9E 0x03 ; l6361: ld hl,(l637d) ld a,h or l ld a,022h push af call nz,l6637 pop af call z,l7adf ld hl,(l5fba) ld (l637d),hl ld hl,l0000 ld (l5fba),hl ret l637d: dw 0 ; ; Code 0x9e 0x02 ; l637f: ld hl,(l63bd) push hl ld hl,(l63bf) push hl ld hl,l6dac ld a,(hl) inc (hl) inc (hl) inc (hl) inc (hl) ld hl,(l6da9) call adda ; HL+ACCU ex de,hl ld hl,l63bd ld a,4 call move ; Move 4 bytes DE->HL ld hl,l63b8 push bc call l5bfb pop bc ld hl,(l6da9) ld de,l0004 add hl,de dec (hl) dec (hl) pop hl ld (l63bf),hl pop hl ld (l63bd),hl ret l63b8: db 05ch,0,0,0,2 l63bd: dw 0 l63bf: dw 0 ; ; Code 0x97 ; l63c1: ld a,(l6dab) add a,2 ld (l6dab),a ret ; ; Code 0x9E 0x04 ; l63ca: pop de l63cb: pop hl ld a,h or l jp nz,l63cb push hl ex de,hl jp (hl) ; ; Code 0x9E 0x05 ; l63d4: ld a,(l6db5) ld (l6db7),a ld a,(l6db8) ld (l6dba),a ret ; ; Code 0x99 ; l63e1: ld a,0cdh call l6623 ld hl,(l6da9) ld de,l0004 add hl,de ld a,(hl) inc hl add a,a call adda ; HL+ACCU ld a,0f2h jp l65de ; ; Code 0x9E 0x06 0xXX ; l63f8: inc bc ld a,(bc) jp l6615 l63fd: ld c,a ld a,b call l66a4 l6402: call pop.AESTK ; Get from stack call l64bf ld a,(AESTK.base) ; Get stack pointer push de ld d,a ld a,(AESTK.ptr) ; Test against current inc a sub d pop de cp c jp z,l641d call l644d jp l6402 l641d: call l6435 ld a,b add a,a add a,a add a,a add a,a add a,0c1h call l6623 ld hl,l0004 add hl,de ld (hl),0 ex de,hl ld a,b jp l691a l6435: ld a,(hl) ld (hl),1 inc hl ld (hl),0e5h cp 'R' jp z,l6449 ld (hl),0c5h cp 82h jp z,l6449 ld (hl),0d5h l6449: inc hl ld (hl),0c0h ret l644d: push bc ld a,(hl) ld bc,040ah ;;l040a cp 82h jp z,l6468 ld bc,l0005 cp 62h jp c,l6468 ld bc,3*256+9 ;;l0309 jp z,l6468 ld bc,1*256+7 ;;l0107 l6468: push bc push hl ld b,0 call alloc.dwn ; Allocate BC bytes ex de,hl pop hl ld (hl),040h inc hl ld c,(hl) ld (hl),e inc hl ld b,(hl) ld (hl),d inc hl ex (sp),hl ex de,hl ld a,d cp 4 jp nz,l648b ld (hl),2 inc hl ld (hl),0c5h inc hl ld (hl),0e3h inc hl l648b: ld a,d rra call c,l64b8 ld (hl),0a1h inc hl call l6504 ld (hl),a inc hl inc bc inc bc inc bc inc bc ld (bc),a ld a,d cp 4 jp nz,l64a9 ld (hl),1 inc hl ld (hl),0e1h inc hl l64a9: ld a,d and 2 call nz,l64b8 ld (hl),040h inc hl pop de ld (hl),e inc hl ld (hl),d pop bc ret l64b8: ld (hl),1 inc hl ld (hl),0ebh inc hl ret ; ; ; l64bf: ex de,hl ld hl,(l6db3) l64c3: ld a,(hl) inc hl cp 040h jp nz,l64d1 ld a,(hl) inc hl ld h,(hl) ld l,a jp l64d6 l64d1: and 00001111b call adda ; HL+ACCU l64d6: ld a,(l6db1) cp l jp nz,l64e3 ld a,(l6db2) cp h scf ret z l64e3: ld a,(hl) cp 'P' jp c,l64c3 cp 90h jp nc,l64c3 inc hl ld a,e cp (hl) inc hl ld a,(hl) dec hl dec hl jp nz,l64c3 cp d jp nz,l64c3 ret l64fd: push hl ld hl,l6db5 jp l6508 l6504: push hl ld hl,l6db8 l6508: ld a,(hl) inc (hl) xor (hl) ld a,5 call m,prc.err ; .. to complex ld a,(hl) inc hl cp (hl) jp c,l6517 ld (hl),a l6517: pop hl ret l6519: ld de,l0005 add hl,de ld e,(hl) inc hl ld d,(hl) ex de,hl l6521: ld d,h ld e,l inc hl inc hl ld a,(hl) and '0' ret nz inc hl ld a,(hl) inc hl or (hl) scf ret nz ex de,hl inc hl ld d,(hl) inc hl ld a,(hl) and 1 ld c,2 jp nz,l6540 ld a,d call l2fb8 ld c,a l6540: ld b,0 ex de,hl call l2b15 ex de,hl inc hl ld (hl),e inc hl ld (hl),d or a ret ; ; ????????????????????????????????? ; ENTRY Reg HL points to link ; EXIT Accu holds 0,1,2,8 ; l654d: push hl ld a,(hl) ; Get link inc hl ld h,(hl) ld l,a ld a,(hl) ; .. get byte cp 3 ; Test range jp c,l655a ld a,8 ; .. map all above 3 to 8 l655a: pop hl ret ; ; ; l655c: push de push hl ld hl,l6da1 ld d,a rra rra and 3 add a,a call adda ; HL+ACCU ld a,d ex de,hl ld hl,l6d99 and 3 add a,a call adda ; HL+ACCU ld a,(de) cp (hl) jp nz,l657e inc de inc hl ld a,(de) cp (hl) l657e: pop hl pop de ret l6581: _LD.HL ; ; Accu holds ??? ; l6582: ld l,0 push hl push af call l67cf ex de,hl inc de ld hl,(l6dad) ld h,0 pop af and a jp z,l65ba cp 3 jp z,l65a5 add hl,hl ld a,(de) cp 5 jp z,l65ba inc hl jp l65ba l65a5: ld a,(de) add hl,hl add hl,hl cp 5 jp z,l65ba inc hl cp 6 jp z,l65ba inc hl cp 4 jp z,l65ba inc hl l65ba: add hl,hl push hl ld hl,(l6dad+1) ; .. get value ld h,0 ; .. clear hi add hl,hl ld de,l67ee add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a inc hl inc hl inc hl pop de add hl,de pop de ld a,e and a jp nz,l65d9 call l6642 db 0cdh l65d9: ld a,32h jp l6637 ; ; ENTRY Reg HL points to ??? ; Accu holds ??? ; l65de: push bc push de ld c,a ; Save value and 00001111b ; .. get lower bits ex de,hl ld hl,(l6db1) cp (hl) ; Test range jp c,l6602 ld (hl),64 inc hl push af push bc push de ex de,hl ld bc,64 ;;l0040 call alloc.dwn ; Allocate BC bytes ex de,hl ld (hl),e ; .. save pointer inc hl ld (hl),d ex de,hl pop de pop bc pop af ld (hl),03dh l6602: ld b,a ld a,(hl) sub b dec a push af ld (hl),c ; .. set code inc hl ld a,b call move ; Move BC bytes DE->HL pop af ld (hl),a ld (l6db1),hl pop de pop bc ret ; ; ; l6615: push af ld a,0e1h l6618: push hl ld hl,l0003 add hl,sp call l65de pop hl pop af ret ; ; ; l6623: push af ld a,1 jp l6618 ; ; ; l6629: push bc push de push hl call l6519 pop hl pop de pop bc ld a,12h jp l6637 ; ; ; l6637: ld (l6640),hl ld hl,l6640 jp l65de ; l6640: dw 0 ; ; Get immediate byte ; l6642: ex (sp),hl ; Get caller push hl ld a,1 call l65de pop hl inc hl ; Fix return ex (sp),hl ret ; ; ; l664d: push de ld l,0ffh jp l6656 ; ; ; l6653: push de ld l,a ; Save value ld a,(bc) ; Fetch code l6656: and 00000111b ; .. mask bits push af ld h,a ; .. for counter xor a ; Clear result scf ; .. set carry l665c: rla ; Position bit within byte dec h jp p,l665c ld hl,(l6da9) ; Get pointer ex de,hl ld hl,l0004 cp 00001000b ; Test bit jp z,l669a inc hl cp 00000001b jp z,l669a inc hl inc hl cp 00000010b jp z,l669a ld hl,(l6da9) ; Get pointer inc hl inc hl ld l,(hl) ld h,0 cp 00010000b jp z,l669f ld hl,l6dab cp 00100000b jp z,l6691 inc hl scf l6691: ld a,(hl) inc (hl) jp nc,l6697 inc (hl) l6697: ld l,a ld h,0 l669a: add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a l669f: pop af pop de ret ; ; ; l66a2: ld a,2 l66a4: push de push hl call l67dd ld e,(hl) inc hl ld d,(hl) ld a,d or e jp z,l66ef ld a,(de) cp 0f6h jp nz,l66ef push de inc de inc de inc de ld a,(de) pop de and a jp z,l66ef push bc push hl push de dec hl ld e,(hl) inc hl ld d,(hl) ld bc,l6d99 ld hl,l0004 l66ce: push hl ld a,(bc) ld l,a inc bc ld a,(bc) ld h,a inc bc call cmp.r ; Test HL=DE jp nz,l66de ; .. nope pop hl inc h _LD.A l66de: pop hl dec l jp nz,l66ce pop de dec h pop hl pop bc jp nz,l66ef ex de,hl call l68bb ex de,hl l66ef: ld (hl),0 dec hl ld (hl),0 pop hl pop de ret ; ; ; l66f7: cp 5 jp z,l66fe inc hl inc hl l66fe: call l6642 db 0cdh ld a,32h jp l6637 ; ; ; l6707: add a,a add a,a add a,a add a,a inc a jp l6623 ; ; ; l670f: push hl ld h,0 jp l6718 l6715: push hl ld h,0ffh l6718: push bc push de ld b,a and 3 ld c,a ld a,b rra rra and 3 ld b,a cp c jp z,l6770 add hl,hl jp c,l673e ld a,b cp 0 jp z,l673e ld a,c cp 0 jp z,l673e call l6787 jp l6770 l673e: ld a,b call l66a4 ld a,b add a,a ; Build value add a,a add a,c ld hl,l6774 call cp.8.16 ; .. get from table ld a,2 call l65de ld a,c call l67dd ld a,(hl) inc hl ld h,(hl) ld l,a push hl inc hl inc hl inc hl ld a,(hl) dec a jp nz,l676b ld a,c call l67dd ld (hl),0 inc hl ld (hl),0 l676b: pop hl ld a,b call l691a l6770: pop de pop bc pop hl ret ; l6774: db 1,42h,4bh ;;BK db 2,44h,4dh ;;DM db 4,50h,59h ;;PY db 8,60h,69h ;;`i db 9,62h,6bh ;;bk db 6,54h,5dh ;;T] db null ; ; ; l6787: push de push hl ld hl,(l6d9b) ex de,hl ld hl,(l6d9d) ld (l6d9b),hl ex de,hl ld (l6d9d),hl ld a,h or l jp z,l67a0 inc hl inc hl ld (hl),2 l67a0: ex de,hl ld a,h or l jp z,l67aa inc hl inc hl ld (hl),1 l67aa: call l6642 db 0ebh pop hl pop de ret ; ; ; l67b1: call l2c5e push de ld de,l0005 add hl,de ld e,(hl) inc hl ld d,(hl) inc de ld hl,l0005 add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(de) cp 4 jp z,l67cd ld h,0 l67cd: pop de ret ; ; ; l67cf: push de ld de,l0005 ld hl,(l6da9) add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a pop de ret ; ; ; l67dd: add a,a ld hl,l6d99 jp adda ; HL+ACCU ; ; ; l67e4: push de ld de,l0007 ld hl,(l6da9) add hl,de ld a,(hl) inc hl l67ee: ld h,(hl) ld l,a pop de ret ; ; ; l67f2: ld a,(hl) push af ld a,5 call adda ; HL+ACCU ld a,(hl) inc hl ld h,(hl) ld l,a pop af ret ; ; ENTRY Accu holds ??? ; EXIT Reg HL holds ??? ; l67ff: cp 3 ld hl,(l6da9) inc hl inc hl ld l,(hl) ld h,0 ret z add a,a ld hl,(l6da9) add a,5 call adda ; HL+ACCU ld a,(hl) inc hl ld h,(hl) ld l,a ret ; ; ; l6818: push hl ld b,a call l67f2 ld c,a dec a jp z,l6830 inc hl ld a,(hl) dec hl cp 4 jp z,l6830 cp 8 jp z,l6830 dec c l6830: ld a,c sub 2 jp z,l687c ld a,b call l66a4 ld a,b cp 3 jp z,l686c call l6707 ld a,(hl) cp 0eeh jp nz,l6874 inc hl ld a,(hl) cp 4 jp z,l6855 cp 8 jp nz,l6874 l6855: cp 8 ld de,l0005 add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a jp nz,l6864 ld h,0 l6864: ld a,2 call l6637 jp l6892 l686c: inc hl ld a,(hl) ld hl,l69f9 call l66f7 l6874: pop hl push hl call l6629 jp l6892 l687c: call l66a2 call l6642 db 2ah pop hl push hl ld (l6d9d),hl call l6629 pop de push de call l602f pop hl ret l6892: pop hl ld a,b jp l691a ; ; Find value in reg HL on stack ; Carry indicates whether found or not ; l6897: push bc push de ld b,h ; Copy value ld c,l ld hl,(AESTK.base) ; Get stack base ex de,hl ld hl,(AESTK.ptr) ; .. and current pointer l68a2: call cmp.r ; Test HL=DE jp z,l68b7 ; .. yeap dec hl ld a,b cp (hl) ; Compare dec hl jp nz,l68a2 ; .. nope, skip for next ld a,c cp (hl) jp nz,l68a2 ld a,l ; .. calculate position sub e scf l68b7: ccf pop de pop bc ret ; ; ; l68bb: push bc push de ex de,hl ld hl,l0004 add hl,de ld a,(hl) and a jp nz,l6917 inc de inc de ld a,(de) cp 3 jp z,l6905 ld (hl),0ffh ld a,(de) ld c,82h or a jp z,l68f3 ld c,'R' cp 2 jp z,l68f3 ld c,72h ld hl,(l6d9d) ld a,h or l jp z,l68f3 inc hl inc hl inc hl ld a,(hl) and a l68ee: jp z,l68f3 ld c,62h l68f3: dec de dec de push de ld hl,l0000 add hl,sp ld a,c call l65de pop hl call push.AESTK ; Push onto stack jp l6917 l6905: ld hl,l69eb dec de ld a,(de) call l66f7 call l64fd inc de inc de inc de ld (de),a call l6615 l6917: pop de pop bc ret ; ; ; l691a: inc hl inc hl ld (hl),a dec hl dec hl ex de,hl push hl push af call l67dd ld (hl),e inc hl ld (hl),d pop af pop hl ex de,hl ret ; l692c:: dw l69e8 l692e: dw l69ef,l69f6,l69fd,l6a04,l6a0f,l6a1a,l6a25 dw l6a30,l6a3b,l6a40,l6a45,l6a4a,l6a4f,l6a54 dw l6a59,l6a5e,l6a63,l6a68,l6a6d,l6a72,l6a77 dw l6a7c,l6a81,l6a86,l6a8b,l6a90,l6a95,l6a9a dw l6a9f,l6aa4,l6aa9,l6aae,l6ab3,l6ab8,l6abd dw l6ac2,l6ac7,l6acc,l6adb,l6aea,l6b05,l6b18 dw l6b2b,l6b3e,l6b51,l6b64,l6b6f,l6b7a,l6b85 dw l6b8c,l6b93,l6baa,l6bc1,l6bd8,l6bef,l6c06 dw l6c1d,l6c44,l6c5b,l6c72,l6c89,l6ca0,l6cb7 dw l6cce,l6cd9,l6cde,l6ce3,l6ce8,l6ced,l6cf2 dw l6cf7,l6cfc,l6d01,l6d06,l6d0b,l6d10,l6d15 dw l6d1c,l6d23,l6d2a,l6d31,l6d38,l6d3f,l6d46 dw l6d55,l6d5c,l6d67,l6d72,l6d7b,l6d84,l6d8b dw l6d92,l6d99 l69e8:: db 'STM' l69eb: ds 4 l69ef: db 'LTM' l69f2: ds 4 l69f6: db 'LFM' l69f9: ds 4 l69fd: db 'LFH' ds 4 l6a04: db 'SWP' ds 8 l6a0f: db 'REA' ds 8 l6a1a: db 'PV0' ds 8 l6a25: db 'PV1' ds 8 l6a30: db 'PV2' ds 8 l6a3b:: db 'LIP',0,0 l6a40: db 'UMI',0,0 l6a45: db 'IAD',0,0 l6a4a: db 'CIS',0,0 l6a4f: db 'CID',0,0 l6a54: db 'AEL',0,0 l6a59: db 'SGI',0,0 l6a5e: db 'INP',0,0 l6a63: db 'FRE',0,0 l6a68: db 'FR$',0,0 l6a6d: db 'RSE',0,0 l6a72: db 'LSE',0,0 l6a77: db 'RES',0,0 l6a7c: db 'OUT',0,0 l6a81: db 'OEG',0,0 l6a86: db 'OGT',0,0 l6a8b: db 'OGS',0,0 l6a90: db 'WAI',0,0 l6a95: db 'WA0',0,0 l6a9a: db 'MD$',0,0 l6a9f: db 'LIN',0,0 l6aa4: db 'AD$',0,0 l6aa9: db 'DEC',0,0 l6aae: db 'INC',0,0 l6ab3: db 'SHL',0,0 l6ab8: db 'V8I',0,0 l6abd: db 'GOS',0,0 l6ac2: db 'RET',0,0 l6ac7: db 'ISB',0,0 l6acc: db 'MOD',0,0,0,0,0,0,0,0,0,0,0 db 0 l6adb: db 'IDV',0,0,0,0,0,0,0,0,0,0,0 db 0 l6aea: db 'IMU',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0,0,0,0,0 l6b05: db 'DVD',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0 l6b18: db 'FMU',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0 l6b2b: db 'BSU',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0 l6b3e: db 'FAD',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0 l6b51: db 'BEX',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0 l6b64: db 'CNZ',0,0,0,0,0,0,0,0 l6b6f: db 'C8I',0,0,0,0,0,0,0,0 l6b7a: db 'CIN',0,0,0,0,0,0,0,0 l6b85: db 'CSP',0,0,0,0 l6b8c: db 'CDP',0,0,0,0 l6b93: db 'LTC',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0 l6baa: db 'GEC',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0 l6bc1: db 'LEC',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0 l6bd8: db 'GTC',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0 l6bef: db 'NEC',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0 l6c06: db 'EQC',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0 l6c1d: db 'FAS',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0,0,0 l6c44: db 'LTJ',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0 l6c5b: db 'GEJ',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0 l6c72: db 'LEJ',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0 l6c89: db 'GTJ',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0 l6ca0: db 'NEJ',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0 l6cb7: db 'EQJ',0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0 l6cce: db 'FSL',0,0,0,0,0,0,0,0 l6cd9: db 'LTS',0,0 l6cde: db 'GES',0,0 l6ce3: db 'LES',0,0 l6ce8: db 'GTS',0,0 l6ced: db 'NES',0,0 l6cf2: db 'EQS',0,0 l6cf7: db 'LTT',0,0 l6cfc: db 'GET',0,0 l6d01: db 'LET',0,0 l6d06: db 'GTT',0,0 l6d0b: db 'NET',0,0 l6d10: db 'EQT',0,0 l6d15: db 'SAS',0,0,0,0 l6d1c: db 'POS',0,0,0,0 l6d23: db 'ROW',0,0,0,0 l6d2a: db 'LPO',0,0,0,0 l6d31: db 'TAB',0,0,0,0 l6d38: db 'SPC',0,0,0,0 l6d3f: db 'IN0',0,0,0,0 l6d46: db 'PR0',0,0,0,0,0,0,0,0,0,0,0 db 0 l6d55: db 'IPU',0,0,0,0 l6d5c: db 'UMF',0,0,0,0,0,0,0,0 l6d67: db 'SGF',0,0,0,0,0,0,0,0 l6d72: db 'PEK',0,0,0,0,0,0 l6d7b: db 'POK',0,0,0,0,0,0 l6d84: db 'RST',0,0,0,0 l6d8b: db 'FLD',0,0,0,0 l6d92: db 'LEN',0,0,0,0 l6d99:: dw 0 l6d9b: dw 0 l6d9d: dw 0 l6d9f: dw 0 l6da1: dw 0 l6da3: dw 0 l6da5: dw 0 l6da7: dw 0 l6da9: dw 0 l6dab: db 0 l6dac: db 0 l6dad: db 0 ;;l6dae: db 0 l6daf: db 0 l6db0: db 0 l6db1: db 0 l6db2: db 0 l6db3: dw 0 l6db5: db 80h l6db6: db 80h l6db7: db 80h l6db8: db 0 l6db9: db 0 l6dba: db 0 l6dbb: dw 0 ; ; === >>> START OF VIRTUAL MACHINE CODE <<< === ; _push macro val db 020h+val endm _jr macro adr db 080h db LOW (adr-$) endm _chn macro val,adr db 083h,val db LOW (adr-$) endm __chn macro val,adr db val db LOW (adr-$) endm _jzi macro val,adr db 090h,val db LOW (adr-$) endm _cal macro adr db 09ah dw adr-$+1 endm _ret macro db 09bh endm _sav macro val db 0c5h+val endm l6dbd:: db 8ah ;; db 0fh db LOW (l6dcd-$) ;; db 28h _push 8 db 12h db 88h ;; db 09h db LOW (l6dcb-$) ;; db 06h db LOW (l6dc9-$) db 0afh,095h,06fh,09ch,095h l6dc9: db 67h db 7ah l6dcb: db 0a9h db 7ah l6dcd: ;; db 0f5h _sav 30h ;; db 83h,7fh,05h _chn 7fh,l6dd5 db 13h,70h db 48h,7bh l6dd5: db 8fh,05h db 2ch,13h db 71h,7bh db 00h l6ddc: ;; db 0c5h _sav 0 l6ddd:: db 8dh,02h db 1bh,83h,0f1h,08h db 9eh,07h db 28h,12h,1ch,59h,7ah db 0ffh,06h,24h,29h,12h,1dh,7ah db 00h l6df2: db 0c6h _jr l6ddd l6df5: db 0c7h,94h db 88h,0e5h db 1bh,1bh _jr l6ddd l6dfd: db 0c8h,95h db 8eh,00h l6e01: db 0c9h,94h,95h db 89h,00h l6e06: db 8ah,1ah db 8dh,02h db 92h,28h,25h db 12h db 88h,10h db 9ch,09h db 06h,7dh db 93h,6fh,7ch,9ah,67h,7ah,03h db 0a7h,0edh,52h,7ah,0c4h,7ah,0cah _jr l6e8d l6e24: db 94h,8ah,15h,83h,0e1h,05h,28h db 25h,80h,05h,0ffh,0bh,24h,29h db 12h db 88h,04h db 01h,19h,7ah,0aah db 7ah,00h,0cbh _jr l6e8d l6e3e: db 8dh,02h db 92h,24h,29h,12h,0bdh db 7ah l6e46: db 0cch _jr l6e8d l6e49: db 94h,83h,0f1h,11h db 9eh,07h db 28h db 12h,02h,7dh,0e6h,39h,03h,6fh db 7ch,0e6h,3dh,01h,67h,7ah,0ffh db 0ch,24h,29h,12h,06h,7ch,0a2h db 67h,7dh,0a3h,6fh,7ah,00h l6e6b: db 94h,83h,0f1h,11h db 9eh,07h db 28h db 12h,02h,7dh,0f6h,39h,03h,6fh db 7ch,0f6h,3dh,01h,67h,7ah,0ffh db 0ch,24h,29h,12h,06h,7ch,0b2h db 67h,7dh,0b3h,6fh,7ah,00h l6e8d: db 8dh,02h db 92h,83h,33h,06h,17h,70h db 48h,49h,7bh,83h,06h,2ch,13h db 71h,49h,7bh db 88h,07h db 30h,2dh db 13h,72h,93h,7bh,38h,06h,2dh db 13h,73h,48h,7bh,00h l6eaf: db 94h,83h,0f1h,11h db 9eh,07h db 28h db 12h,02h,7dh,0eeh,39h,03h,6fh db 7ch,0eeh,3dh,01h,67h,7ah,0ffh db 0ch,24h,29h,12h,06h,7ch,0aah db 67h,7dh,0abh,6fh,7ah,00h l6ed1: db 8dh,02h db 92h,25h,28h,12h,08h db 7ch,2fh,0b2h,67h,7dh,2fh,0b3h db 6fh,7ah l6ee1: db 28h,12h,06h,7ch,2fh,67h,7dh db 2fh,6fh,7ah l6eeb: db 8ah,28h db 8bh,15h db 83h,1fh,07h db 29h,84h,01h,22h,48h,85h,0afh db 09h,25h,28h,12h,03h,73h,23h db 72h,85h,00h,0ech,83h,1fh,06h db 29h,24h,84h,1ch,85h,0afh,06h db 28h,25h,84h,1dh,85h,00h,0d8h db 83h,13h,05h,70h,48h,49h,85h db 21h,04h,19h,80h,0f8h,83h,06h db 28h,84h,74h,49h,85h db 88h,06h db 2dh,28h,84h,76h,85h,18h,03h db 80h,04h,28h,07h,19h,2dh,84h db 77h,48h,85h,00h l6f3c: db 8ah,04h,28h,84h,85h,2ch,84h db 85h l6f44: db 8ah,06h,84h,01h,22h,48h,85h db 0d8h,84h,77h,48h,85h l6f50: db 8ah,08h,28h,12h db 88h,02h db 7ah db 0c1h,7ah,0ceh _jr l6f60 l6f5c: db 0cdh _jr l6f60 l6f5f: ;; db 0cfh _sav 10 l6f60: _chn 07fh,l6f66 _push 8 _jr l6f6a l6f66: ;; db 8fh,07h __chn 08fh,l6f6e db 2ch,19h l6f6a: db 12h,17h,70h db 7ah l6f6e: db 0 l6f6f: db 8ah,05h,28h,13h,0abh,7bh,0d0h l6f76: db 83h,7fh,04h,28h,80h,05h,8fh db 06h,2ch,19h,13h,1ch,7bh,00h l6f84: db 8ah,05h,28h,13h,0ach,7bh,0d1h _jr l6f76 l6f8d: db 15h,28h,15h,12h,01h,11h,49h db 01h,19h,7ah l6f97: db 8ah,0eh db 8bh,09h db 28h,15h,12h db 03h,5eh,23h,56h,79h,28h,12h db 7ah,28h,13h,0a2h,7bh l6faa: db 8ah,67h db 8bh,07h _cal l6fb7 db 95h,97h,00h,0e0h,95h,0b8h l6fb7: db 00h db 83h,0f1h,31h,28h,15h,12h db 8ch,29h db 01h,11h,61h db 9ch,13h db 02h db 7ch,17h db 9eh,01h,05h db 01h,0dah db 80h,03h,01h,0d2h,81h,02h,19h db 29h,82h,9bh,02h,7ch,17h db 9eh,01h,05h db 01h,38h,80h,03h,01h db 30h,03h,02h,19h,29h,9bh,01h db 29h,9bh,0ffh,25h db 9ch,13h db 24h db 29h,12h,04h,7ah,0ach,7ah,0fah db 81h,04h,7bh,95h,7ah db 9ch,82h db 01h,17h,9bh,25h,28h,12h,04h db 0a7h,0edh,52h,0e2h,81h db 9eh,06h db 3eh,82h,01h,29h,9bh,00h,0d2h l7013: db 83h,33h,08h,16h db 8ch,17h db 70h db 48h,49h,7ah,83h,08h,2ch,12h db 8ch,10h db 71h,49h,7ah db 88h,07h db 30h,2dh,12h,72h,93h,7ah,00h db 73h,48h,7ah,74h,7ah,80h,14h _jr l7013 l7038: db 8ah,0dh db 8bh,08h _cal l6fb7 db 01h,3fh,80h,07h,0e1h,80h,29h db 0d3h l7047: db 80h,0eeh,03h,9fh,67h,6fh db 7ah l704e: db 8ah,1ch db 8bh,17h db 83h,0f1h,0ah db 8ch,03h db 80h,08h _cal l7072 db 80h,0ech,0ffh,08h _cal l707f db 01h,3fh,80h,0e3h,00h,0e2h,80h db 04h,0d4h,80h,0dah,24h,29h,12h db 1ch l7072: db 7ah,28h,12h,03h,7ch,87h db 0dah,81h,03h,0b5h,0d6h,01h,82h l707f: db 9bh,24h,29h,12h,04h,7ah,0ach db 7ch,0fah,81h,04h,7dh,93h,7ch _cal l720f db 17h _ret l7092: db 8ah,1ch db 8bh,17h db 83h,0f1h,0ch db 8ch,03h db 80h,0ah _cal l7072 db 01h,3fh,80h,0a6h,0ffh,06h _cal l707f db 80h,9fh,00h,0e3h,80h db 0c0h,0d5h l70b0: _jr l7047 l70b2: db 8ah,0fh db 8bh,0ah _cal l70c5 db 02h,0d6h,01h,95h db 8ch,0ffh db 0e5h db 80h,0adh,0d7h,95h,4fh l70c5: db 0ffh,83h db 0f1h,13h,28h db 8ch,0bh db 15h,12h db 01h,11h,61h,02h,19h,7ch,80h db 11h,12h,01h,7ch,80h,0ch,0ffh db 0dh,24h,29h,12h,05h,7dh,0abh db 6fh,7ch,0aah,01h,0b5h _ret db 00h l70ea: db 8ah,0fh db 8bh,09h _cal l70c5 db 02h,0c6h,0ffh,80h,0b4h,0e4h,95h db 76h,0ffh,0d6h _jr l70b0 l70fd: _jzi 3,l7112 _jzi 2,l710e _jzi 1,l710b db 89h,13h db 16h,8fh db 7ah l710b: _push 8 _jr l7115 l710e: db 24h,29h,80h,04h l7112: db 20h,25h,2ah l7115: db 89h,04h db 12h,8fh db 7ah,13h,8fh,7bh l711d: _jzi 3,l7133 _jzi 2,l712f _jzi 1,l712c l7126: db 16h,15h,14h,13h,99h db 85h l712c: db 28h,80h,0f8h l712f: db 24h,29h,80h db 0f4h l7133: db 20h,25h,2ah _jr l7126 l7138: _jzi 0,l713f db 9eh,02h db 80h,0fah l713f: db 16h,15h,14h,17h,01h,0cdh,4dh db 89h,02h db 7ah,7bh l714a: db 53h,86h,12h,98h,01h,0e5h db 9eh,04h db 8eh,01h db 8eh,0f6h db 53h,0adh db 45h,44h,4ah db 8eh,01h db 8eh,0fch db 7ah l7160: db 8ah,05h,28h,12h,0aeh,7ah,0f6h db 83h,7fh,05h,13h,70h,48h,7bh db 8fh,05h,2ch,13h,71h,7bh,00h l7175: db 83h,1fh,0ah,16h,01h,0dbh,38h db 03h,6fh,26h,00h,7ah,0efh,05h db 28h,12h,0afh,7ah,00h l7188: db 14h,15h,17h,16h,01h,0cdh,48h db 7ah l7190: db 0efh l7191: db 9dh,04h l7193: db 16h,1ch,7ah,19h _jr l7193 l7199: db 0edh _jr l7191 l719c: db 0eeh _jr l7193 l719f: db 17h,0b0h,7bh l71a2: db 17h,0b1h,7bh l71a5: db 28h,12h,0fbh,1dh,7ah l71aa: db 28h,12h,0fbh,1ch,7ah l71af: db 28h,12h,7ah l71b2: db 28h,12h db 88h,07h db 55h,01h,23h db 8eh,0fdh db 7ah,0bfh,45h,7ah l71bf: db 28h,12h db 88h,07h db 55h,01h,2bh db 8eh,0fdh db 7ah,0beh,45h,7ah l71cc: db 8ah,0eh,28h,12h db 88h,07h db 55h db 01h,29h db 8eh,0fdh db 7ah,0c0h,45h db 7ah,0dfh,83h,7fh,06h,13h,70h db 48h,45h,7bh,8fh,06h,2ch,13h db 71h,45h,7bh,00h l71ec: db 24h,29h,84h,0b2h,85h l71f1: db 24h,29h,84h,0b3h,85h l71f6: db 24h,29h,15h,12h,0a3h,85h l71fc: db 0b4h,87h,85h l71ff: db 81h db 9eh,03h l7202: db 55h l7203: db 8eh,02h db 85h,45h _jr l7203 l7209: db 8ah,27h,83h,11h,09h,01h l720f: db 3eh db 39h,01h,32h,38h,3ch,85h,1eh db 09h,29h,84h,02h,7dh,32h,38h db 3ch,85h,0e1h,07h,28h,84h,01h db 36h,39h,85h,0ffh,07h,25h,28h db 84h,01h,73h,85h,00h,0f8h,29h _jr l724f l7235: db 8ah,18h,83h,1fh,0bh,16h,01h db 3ah,38h,3ch db 03h,6fh,26h,00h db 7ah,0efh,08h,28h,12h,03h,6eh db 26h,00h,7ah,00h,0f7h l724f: db 83h db 3fh db 06h,12h,17h,1ch,48h,7ah,8fh db 06h,2ch,12h,17h,1eh,7ah,00h l725f: db 83h,11h,08h,01h,3eh,38h,01h db 0d3h,39h,85h,0e1h,08h,28h,84h db 02h,7dh,0d3h,39h,85h,0ffh,06h db 24h,29h,84h,0b5h,85h,00h l727a: db 91h,0d0h,8ah,05h,28h,12h,80h db 03h,2ch,13h,01h,0c9h db 9eh,05h db 85h l7289: db 0f9h,1ch,85h l728c: db 9eh,00h,06h db 88h,04h db 01h,0c9h db 85h,0c3h,85h l7296: db 28h,84h,0a4h,85h l729a: db 0f4h,53h,1ch,44h,45h db 8eh,0feh db 53h,19h,86h,14h,15h,12h,98h db 1ch db 9eh,04h db 8eh,0f7h db 85h l72ae: db 28h,84h,0a8h,85h l72b2: db 0f2h,29h,84h,1ch,40h,85h l72b8: db 28h,12h,0f2h,1dh,85h l72bd: db 28h,84h,98h,03h,7ch,0b5h,0c2h db 87h,85h l72c6: db 28h,84h,98h,03h,7ch,0b5h,0cah db 87h,85h l72cf: db 01h,0c3h,87h,85h l72d3: db 9eh,00h,07h db 88h,05h db 01h,0cdh db 87h,85h,0c2h,87h,85h l72df: db 28h,84h,0fah,1ch,85h l72e4: db 29h,24h,84h,0fah,1dh,85h l72ea: db 0f3h _jr l7304 l72ed: db 0f3h _jr l7301 l72f0: db 0f3h _jr l7300 l72f3: db 24h,29h,0f3h,1bh _jr l7303 l72f9: db 0f3h,1bh,19h _jr l7304 l72fe: db 0f3h,1bh l7300: db 19h l7301: db 19h,28h l7303: db 84h l7304: db 01ch,085h l7306: db 28h,13h,0a5h,85h l730a: db 28h,13h,0a6h,85h l730e: db 28h,13h,0a7h,85h l7312: db 0f0h db 9dh,03h db 80h,07h,19h _jr l731d l731a: db 0f1h db 9dh,0fbh l731d: db 28h,84h,1ch,85h l7321: db 0b6h,87h,85h l7324: db 91h,20h,85h l7327: db 91h,20h db 88h,02h db 85h,0bch,85h l732e: db 29h,12h,98h,01h,0e5h db 9eh,04h db 20h,26h,96h,84h,98h,0bbh,85h l733c: db 83h,1fh,0eh,26h,29h,84h,82h db 01h,0dbh,38h,03h,0abh,0a5h,0cah db 81h,85h,0efh,07h,22h,25h,28h db 84h,0b9h,85h,00h l7355: db 83h,1fh,0ch,29h,84h,82h,01h db 0dbh,38h,02h,0a5h,0cah,81h,85h db 0efh,06h,25h,28h,84h,0bah,85h db 00h l736b: db 28h,84h,0b7h _jr l7373 l7370: db 28h,84h,0b8h l7373: db 55h,44h,87h,97h db 8eh,0fdh db 85h l737a: db 0f9h,1dh,87h,85h l737e: db 8ah,0eh db 8bh,09h _cal l6fb7 db 98h,01h,0dah,87h,85h,0e6h,80h db 16h,0d9h _jr l73a0 l7390: db 8ah,0eh db 8bh,09h _cal l6fb7 db 98h,01h,0d2h,87h,85h,0e7h,80h db 04h,0dah l73a0: db 80h,66h,24h,29h,84h db 98h,1ch,87h,85h l73a9: db 8ah,25h db 8bh,20h db 83h,0f1h,12h db 8ch,03h db 80h,10h,28h,84h,98h db 03h,7ch,87h,0dah,87h,02h,0b5h db 0cah,87h,85h,0ffh,09h _cal l707f db 98h,01h,0d2h,87h,85h,00h db 0e8h,80h,0d4h,0dbh _jr l7407 l73d2: db 8ah,33h db 8bh,2eh db 83h,0f1h,13h db 8ch,03h db 80h,11h,28h,12h,98h db 03h,7ch,87h,0dah,81h,02h,0b5h db 0c2h,87h,82h,85h,0ffh,16h,24h db 29h,84h,98h,04h,7ah,0ach,7ch db 0fah,81h,04h,7dh,93h,7ch db 9ah,82h,02h,17h,0dah,87h,85h,00h db 0e9h,80h db 9dh,0dch l7407: db 83h,33h,0ah db 84h,98h db 8ch,1ch db 70h,48h,49h db 87h,85h,83h,0ah,2ch,84h,98h db 8ch,14h db 71h,49h,87h,85h db 88h,09h db 30h,2dh,84h,98h,72h,93h db 87h,85h,00h,73h,48h,87h,85h db 74h,87h,85h l7430: db 8ah,1fh db 8bh,19h db 9ch,09h _cal l70c5 l7439: db 98h,01h,0cah,87h,85h db 8ch,0f7h _cal l7452 db 12h,98h,04h,0a7h db 0edh,52h,0cah,87h,85h,0ebh,95h db 54h,0ffh,0deh l7451: db 80h l7452: db 0b5h,83h,0f1h db 04h,28h,25h,9bh,0feh,04h,24h db 29h _ret db 00h l745f: db 8ah,1fh db 8bh,19h db 9ch,09h _cal l70c5 db 98h,01h,0c2h,87h,85h db 8ch,0f7h _cal l7452 db 12h,98h db 04h,0a7h,0edh,52h,0c2h,87h,85h db 0eah,95h,25h,0ffh,0ddh _jr l7451 ; ; === >>> END OF VIRTUAL MACHINE CODE <<< === ; ; ; l7482:: ld hl,(l6db3) ; Fetch pointer xor a ; Init increment ld (l7f1e),a ; .. and flag l7489: ex de,hl call add.CS ; Add accu to code pointer ld hl,(l6db1) ex de,hl call cmp.r ; Test HL=DE jp z,l74c8 ; .. yeap ld de,l7489 push de ; Set return address ld a,(hl) ; Get code and 11110000b ; Mask bits rra ; .. get lower case rra rra rra call l74d0 call caseswitch dw l7528 ; 0xh dw l781b ; 1xh dw l78dd ; 2xh dw l790c ; 3xh dw l79a2 ; 4xh dw l79a9 ; 5xh dw l79ac ; 6xh dw l79af ; 7xh dw l79b2 ; 8xh dw l79b5 ; 9xh dw l79e5 ; Axh dw l79fa ; Bxh dw l7a41 ; Cxh dw l7a4a ; Dxh dw l7a79 ; Exh dw l7aac ; Fxh ; ; ; l74c8: ld a,(l7f1e) ; Get flag rra ; Test bit set ret nc ; .. nope jp l7e44 ; ; ; l74d0: cp 040h SHR 4 ret z ; Filter state push hl push de push af ld hl,l7f20 call adda ; HL+ACCU ex de,hl ld hl,l7f1e ld a,(_stat1) ; Get status rla ; .. test disassembling jp c,l750a ; .. nope ld a,(hl) rra jp c,l750a inc (hl) call ilstrg db tab dc '** ' ld hl,(CSIZE) ; Get code address call prhex ; .. print call ilstrg dc '''' pop af ; Get back entry push af cp 020h SHR 4 ld a,tab call nz,putchr ; .. give tab ld hl,l7f1e ; Reset pointer l750a: ld a,(de) ; Get control rra jp c,l7523 ; .. skip rla ; .. bring back xor (hl) add a,a jp nc,l7522 ld a,(_stat1) ; Get status rla ; .. test disassembling jp c,l7522 ; .. nope call ilstrg db 'DW',.tab l7522: ld a,(de) ; ** WHY ?? l7523: ld a,(hl) ; ** WHY ?? pop af pop de pop hl ret ; ; Code 0xh -> ; l7528:: ld a,(hl) ; Get bits and 00001111b ; .. lower ones ld c,a push bc ex de,hl l752e: pop bc inc de ld a,c sub 1 ld c,a ex de,hl ld a,0 ret c ex de,hl ld a,(de) ld b,a call put.cons ; .. put to file ld hl,l7594 push bc push hl ld a,0 call l74d0 ld hl,l7f1f ld a,(hl) and a ld (hl),0 ret nz ld hl,l7f1e ld a,(hl) sub 40h jp c,l757e ld (hl),a ld a,(l7592) and a jp nz,l7570 ld a,(hl) add a,a ld a,(de) jp p,l7e57 ld (l7593),a ld a,1 ld (l7592),a ret l7570: xor a ld (l7592),a ld a,(de) call l7e57 ld a,(l7593) jp l7e57 l757e: ld a,(_stat1) ; Get status ld b,a ; .. save ld a,(de) rlca rlca and 00000011b call caseswitch dw l75fd dw l75b2 dw l75c6 dw l76ac ; l7592: db 0 l7593: db 0 ; ; ; l7594: ld a,1 call add.CS ; Add 1 to code pointer ld a,(l7f1e) and 0c0h jp nz,l752e call l7e44 jp l752e l75a7: ld a,40h _LD.BC l75aa: ld a,80h ld hl,l7f1e or (hl) ld (hl),a ret l75b2: ld a,b ; Get state rla ; Test disassembling ret c ; .. nope call ilstrg db 'MOV',.tab call l77f2 call ilstrg dc ',' jp l77fc l75c6: ld a,b ; Get state rla ; Test disassembling ret c ; .. nope ld a,(de) rra rra rra and 00000111b add a,a add a,a ld hl,l75dd call adda ; HL+ACCU call prstrg ; Print code jp l77fc l75dd: db 'ADD',.tab db 'ADC',.tab db 'SUB',.tab db 'SBB',.tab db 'ANA',.tab db 'XRA',.tab db 'ORA',.tab db 'CMP',.tab l75fd: ld a,(de) and 00000111b call caseswitch dw l76fa dw l7613 dw l7663 dw l7621 dw l7676 dw l7683 dw l7690 dw l76a6 l7613: ld hl,l7619 jp l7624 l7619: db 'LXI',.tab db 'DAD',.tab l7621: ld hl,l7656 l7624: ld a,b ; Get state rla ; Test disassembling jp c,l7645 ; .. nope ld a,(de) rra rra rra rra push af jp nc,l7636 inc hl inc hl inc hl inc hl l7636: call prstrg ; Print code pop af and 00000011b ld hl,l765e call adda ; HL+ACCU call prstrg ; Print code l7645: ld a,(de) and 0fh dec a ret nz ld a,b rla jp c,l75aa call ilstrg dc ',' jp l75aa l7656: db 'INX',.tab db 'DCX',.tab l765e: ;; jp nz,lc8c4 db 0c2h,0c4h,0c8h,053h,0d0h ; ; ; l7663: ld a,b rla call nc,l7702 ld a,(de) rra rra rra and 6 cp 4 jp c,l77fc jp l75aa l7676: ld a,b rla ret c call ilstrg db 'INR',.tab jp l77f2 l7683: ld a,b rla ret c call ilstrg db 'DCR',.tab jp l77f2 l7690: ld a,b rla jp c,l75a7 call ilstrg db 'MVI',.tab call l77f2 call ilstrg dc ',' jp l75a7 l76a6: ld a,b rla ret c jp l7702 l76ac: ld a,(de) and 00000111b call caseswitch dw l76c2 dw l76c2 dw l76c8 dw l76d0 dw l76c8 dw l76e6 dw l76fa dw l76c2 l76c2:: ld a,b ; Get state rla ; Test disassembling ret c ; .. nope jp l7702 l76c8: ld a,b rla call nc,l7702 jp l75aa l76d0: ld a,b rla call nc,l7702 ld a,(de) cp 0c3h jp z,l75aa cp 0d3h jp z,l75a7 cp 0dbh jp z,l75a7 ret l76e6:: ld a,b rla call nc,l7702 ld a,(de) cp 0edh jp nz,l76f4 ld (l7f1f),a l76f4: cp 0cdh ret nz jp l75aa l76fa: ld a,b rla call nc,l7702 jp l75a7 l7702: ld hl,l771d l7705: ld a,(de) cp (hl) jp z,l7719 l770a: inc hl ld a,(hl) and a jp p,l770a inc hl ld a,(hl) and a jp nz,l7705 call intern.err ; .. error l7719: inc hl jp prstrg ; .. print code l771d: db 02ah db 'LHLD',.tab db 022h db 'SHLD',.tab db 017h dc 'RAL' db 01fh dc 'RAR' db 02fh dc 'CMA' db 037h dc 'STC' db 03fh dc 'CMC' db 0c1h db 'POP',tab dc 'B' db 0c9h dc 'RET' db 0d1h db 'POP',tab dc 'D' db 0e1h db 'POP',tab dc 'H' db 0f1h db 'POP',tab dc 'PSW' db 0c2h db 'JNZ',.tab db 0e2h db 'JPO',.tab db 0cah db 'JZ',.tab db 0d2h db 'JNC',.tab db 0dah db 'JC',.tab db 0f2h db 'JP',.tab db 0fah db 'JM',.tab db 0c3h db 'JMP',.tab db 0d3h db 'OUT',.tab db 0dbh db 'IN',.tab db 0e3h dc 'XTHL' db 0ebh dc 'XCHG' db 0c5h db 'PUSH',tab dc 'B' db 0cdh db 'CALL',.tab db 0d5h db 'PUSH',tab dc 'D' db 0e5h db 'PUSH',tab dc 'H' db 0d6h db 'SUI',.tab db 0deh db 'SBI',.tab db 0e6h db 'ANI',.tab db 0eeh db 'XRI',.tab db 0f6h db 'ORI',.tab db 0feh db 'CPI',.tab db 03ah db 'LDA',.tab db 032h db 'STA',.tab db 0c6h db 'ADI',.tab db 030h db 'JR',tab dc 'NC,' db 038h db 'JR',tab dc 'C,' db 0edh db 'SB' db 'C',tab dc 'HL,DE' db null l77f2:: ld a,b rla ret c ld a,(de) rra rra rra jp l7800 l77fc: ld a,b rla ret c ld a,(de) l7800: inc a and 00000111b add a,'A' cp 'F' jp c,l7818 cp 'G' ld a,'H' jp c,l7818 ld a,'L' jp z,l7818 ld a,'M' l7818: jp putchr ; .. print key ; ; Code 1xh -> ; l781b:: call l7dd9 ld hl,l0005 add hl,de ld c,(hl) inc hl ld b,(hl) inc hl ld e,(hl) inc hl ld d,(hl) call l787f ld a,(_stat1) ; Get status rla ; .. test disassembling jp c,l7870 ; .. nope ld a,(bc) cp 0eeh jp z,l7866 push bc dec bc dec bc dec bc l783d: ld a,(bc) and NoMSB call putchr ; .. print ld a,(bc) dec bc and a jp p,l783d pop bc inc bc ld a,(bc) ld hl,l7876 call cp.8.8 ; Map character ld a,(hl) call putchr ; .. print it ex de,hl ld a,h or l jp z,l7870 call ilstrg dc '+' call prhex ; Print hex address jp l7870 l7866: call ilstrg dc '' l7870: pop hl ld a,2 jp l7e44 ; l7876: db 5,'!' db 4,'%' db 7,'$' db 6,'#' db null ; ; ; l787f: push de push bc ld a,(bc) push af inc bc inc bc ld a,(bc) and '(' jp z,l789f pop af ld a,0f1h push af ld a,d or e jp z,l789f push bc ld bc,9 call RELITEM ; .. give external offset pop bc ld de,l0000 l789f: pop af ld hl,l77f2-8 call adda ; HL+ACCU push bc ld b,(hl) pop hl ld c,(hl) inc hl ld a,(hl) add a,e ld e,a inc hl ld a,0 adc a,(hl) add a,d ld d,a ld a,c and 10h jp z,l78c1 ld b,3 inc hl call l1982 ; Select COMMON block dec hl l78c1: call l7de0 dec hl dec hl ld a,(hl) and ' ' jp z,l78d5 inc hl ex de,hl ld hl,(CSIZE) ; Get code address ex de,hl ld (hl),e ; .. save inc hl ld (hl),d l78d5: pop bc pop de ret ; l78d8: db 2,2,2,1,1 ; ; Code 2xh -> ; l78dd:: call l7dd9 inc de ld hl,(CSIZE) ; Get code address ex de,hl ld a,(hl) ; .. unpack chainn ld (hl),e ld e,a inc hl ld a,(hl) ld (hl),d ld d,a ; Test end of chain or e jp z,l78f3 ; .. yeap call C.CHAIN ; .. else put to file l78f3: dec hl dec hl ld a,(hl) or 1 ld (hl),a ex de,hl ld a,(_stat1) ; Get status rla ; .. test disassembling jp c,l7909 ; .. nope call l7dfe call ilstrg db ':',.tab l7909: pop hl xor a ret ; ; Code 3xh -> ; l790c:: call l7dd9 ex de,hl ld e,(hl) inc hl ld d,(hl) ld b,1 call l7de0 ex de,hl ld hl,(CSIZE) ; Get code address ex de,hl ld (hl),d ; .. save dec hl ld (hl),e ld a,(_stat1) ; Get status rla ; .. test disassembling jp c,l798f ; .. nope dec hl dec hl dec hl ld de,l69e8 ld a,l sub e ld a,h sbc a,d jp c,l7980 ld de,l6d99 ld a,e sub l ld a,d sbc a,h jp c,l7980 inc hl inc hl inc hl ex de,hl ld bc,1f7ch ;;l1f7c l7945: ld a,c sub b jp z,l796d dec a jp z,l7964 ld a,b add a,c rra and 7fh push af call l7995 jp c,l795f pop af ld c,a jp l7945 l795f: pop af ld b,a jp l7945 l7964: ld a,c call l7995 ld a,c jp c,l796d ld a,b l796d: ld b,a call l7995 ld a,(hl) dec hl ld l,(hl) ld h,a ld a,e sub l sub 3 rra add a,'A' ld b,a jp l7982 l7980: ld b,' ' l7982: call ilstrg dc '$' ld a,3 call prfxstr ; .. print string ld a,b call putchr ; .. print l798f: pop hl ld a,2 jp l7e44 l7995: add a,a ld hl,l68ee call adda ; HL+ACCU ld a,(hl) sub e inc hl ld a,(hl) sbc a,d ret ; ; Code 4xh -> ; l79a2:: inc hl ld a,(hl) inc hl ld h,(hl) ld l,a xor a ret ; ; Code 5xh -> ; l79a9: call intern.err ; .. error ; ; Code 6xh -> ; l79ac: call intern.err ; ; Code 7xh -> ; l79af: call intern.err ; ; Code 8xh -> ; l79b2:: call intern.err ; ; Code 9xh -> ; l79b5: call l7dd9 ld hl,(CSIZE) ; Get code address ex de,hl ld a,(hl) rra inc hl jp nc,l79c6 ld e,(hl) inc hl ld d,(hl) dec hl l79c6: ld b,1 push de ld e,(hl) inc hl ld d,(hl) call l7de0 pop de ld (hl),d dec hl ld (hl),e dec hl ex de,hl ld a,(_stat1) ; Get status rla ; .. test disassembling jp c,l79df ; .. nope call l7dfe l79df: pop hl ld a,2 jp l7e44 ; ; Code Axh -> ; l79e5:: ld b,'"' call l7a19 jp c,l7a12 call ilstrg db 'SHLD',tab dc 'T:' jp l7a0c ; ; Code Bxh -> ; l79fa:: ld b,'*' call l7a19 jp c,l7a12 call ilstrg db 'LHLD',tab dc 'T:' l7a0c: inc hl ld a,(hl) dec hl call l7e57 l7a12: inc hl inc hl ld a,3 jp l7e44 l7a19: push hl call put.cons ; Put to file inc hl ld e,(hl) ld d,0 dec de ex de,hl add hl,hl ; .. double offset ex de,hl ld bc,9 call RELITEM ; Give external offset ld b,1 ld hl,(l6dbb) ex de,hl call l7de0 ld hl,(CSIZE) ; Get code address inc hl ld (l6dbb),hl pop hl ld a,(_stat1) ; Get status rla ; .. return CY if not disass ret ; ; Code Cxh -> ; l7a41:: ld a,(hl) and 00001111b ; Get lower bits inc a call adda ; HL+ACCU xor a ret ; ; Code Dxh -> ; l7a4a:: call l7dd9 ld hl,l0003 add hl,de inc hl push de ex de,hl ld hl,(CSIZE) ; Get code address ex de,hl ld (hl),d ; .. save dec hl ld (hl),e pop de ld a,(_stat1) ; Get status rla ; .. test disassembling jp c,l7a76 ; .. nope ld hl,-3 ;;Lfffd add hl,de l7a67: ld a,(hl) and NoMSB call putchr ; .. print cp (hl) dec hl jp z,l7a67 call ilstrg dc ':' l7a76: pop hl xor a ret ; ; Code Exh -> ; l7a79:: ld a,(hl) inc hl and 00001111b ; Get lower bits ld d,a ld e,a ld a,(_stat1) ; Get status rla ; .. test disassembling jp c,l7aa1 ; .. nope call ilstrg db 'DB',.tab l7a8c: ld b,(hl) call put.cons ; .. put to file ld a,(hl) inc hl call l7e57 dec d ld a,e jp z,l7e44 call ilstrg dc ',' jp l7a8c l7aa1: ld b,(hl) call put.cons ; Put to file inc hl dec d jp nz,l7aa1 ld a,e ret ; ; Code Fxh -> ; l7aac:: call l7dd9 ld hl,(CSIZE) ; Get code address ld b,0 call put.cons ; Give 0000 ld b,0 call put.cons ex de,hl ld (BFIELD),hl ; .. set address of string xor a ld (MSLINK),a ; Set no special link call l7bd3 ld a,(_stat1) ; Get status rla ; .. test disassembling jp c,l7ad9 ; .. nope l7ace: ld a,(hl) and NoMSB call putchr ; .. print cp (hl) inc hl jp z,l7ace l7ad9: pop hl ld a,2 jp l7e44 ; ; ; l7adf: push bc ld bc,01b*256+12 ;;010ch ;;l010c ld de,8 call RELITEM ; Give CSEG chain address 0008h pop bc ret ; ; Write final data to REL file ; relend:: call l7bdc call l7c9c ld a,(errcnt) ; Test error and a ret nz ; .. yeap, exit call l7b36 call l7bf1 xor a ld (MSLINK),a ; Set no special link ld hl,l7b30 ld (BFIELD),hl ; Set ??SLIB ld bc,3 call RELITEM ; Give lib request ld bc,01b*256+14 ld de,0 call RELITEM ; Set CSEG end module ld a,(obits) ; Get bit count cp -8 ; Test any bit set call nz,l7b2b ; .. yeap, clear remaining ld a,-8 ld (obits),a ; Clear bit count ld bc,15 call RELITEM ; Give end file call l7b2b ; .. give two zeroes l7b2b: ld b,0 jp put.byte ; .. give zero ; l7b30: dc 'BASLIB' ; ; ; l7b36: ld hl,(l637d) ld a,h or l jp z,l7b4b ld a,'"' call l6637 ld a,1 call l6615 call l7482 l7b4b: call l7d25 ld de,0 call DLOC ; Set location counter ld de,l000c call C.CHAIN ; .. set chain ld hl,(l1246) ld a,h or l jp z,l7b77 push hl ld bc,l001e call l2b15 ex de,hl call DLOC ; Set location counter pop de ; Get back chain address call C.CHAIN ; .. chain ld de,l0010 call C.CHAIN ; .. chain constant l7b77: ld a,(l6db6) and 7fh inc a ld l,a ld h,0 add hl,hl add hl,hl add hl,hl ld b,h ld c,l call l2b15 ex de,hl call DLOC ; Set location counter ld de,l000e call C.CHAIN ; .. chain constant ld hl,(l1265) ex de,hl ld a,d ; Test zero or e call nz,C.CHAIN ; .. chain if not ld hl,(l6db9) ld h,0 inc hl add hl,hl ld b,h ld c,l call l2b15 ex de,hl call DLOC ; Set location counter ld hl,(l6dbb) ex de,hl ld a,d ; Test zero or e call nz,C.CHAIN ; .. chain if not ld hl,(DSIZE) ; Get data address ex de,hl push de call DLOC ; Set location counter pop de ld bc,00b*256+10 call RELITEM ; Give ABS data size ld de,l0012 call C.CHAIN ; .. chain to address ld bc,01b*256+13 ld hl,(CSIZE) ; Get code address ex de,hl jp RELITEM ; .. for CSEG program size l7bd3: ld a,d or e ret z ld bc,01b*256+6 jp RELITEM ; .. give CSEG external chain l7bdc: ld hl,(FOR.NEXT) ld a,h or l ld a,12 call nz,prc.err ; .. FOR/NEXT error ld hl,(WHILE.WEND) ld a,h or l ld a,15 call nz,prc.err ; .. WHILE/WEND error ret ; ; ; l7bf1: ld a,'$' ld (MSLINK),a ; Set special link ld hl,l1518 l7bf9: ld (BFIELD),hl ; .. init string inc hl inc hl inc hl ld e,(hl) inc hl ld d,(hl) inc hl call l7bd3 ld a,(hl) inc hl call adda ; HL+ACCU inc hl ld de,l16f5 call cmp.r ; Test HL=DE jp nz,l7bf9 ; .. nope ld hl,l170c l7c18: ld (BFIELD),hl ; Init string inc hl inc hl inc hl ld e,(hl) inc hl ld d,(hl) inc hl call l7bd3 ld de,l17de call cmp.r ; Test HL=DE jp nz,l7c18 ; .. nope ld hl,l7c8d ld (BFIELD),hl ; .. set address ld hl,l692e push hl ld hl,l69e8 l7c3b: ld de,l7c8d ld a,3 ex de,hl call move ; Move 3 bytes DE->HL ex de,hl ld a,0c0h ld (l7c90),a ex (sp),hl ld e,(hl) inc hl ld d,(hl) inc hl ex (sp),hl l7c50: call cmp.r ; Test HL=DE jp z,l7c69 ; .. yeap ld a,(l7c90) inc a ld (l7c90),a push de ld e,(hl) inc hl ld d,(hl) inc hl call l7bd3 pop de jp l7c50 l7c69: ld de,l6d99 call cmp.r ; Test HL=DE jp nz,l7c3b ; .. nope pop hl ld hl,(l1274) ex de,hl ld hl,l7c91 ld (BFIELD),hl ; Set 'AC' call l7bd3 ld hl,(l1281) ex de,hl ld hl,l7c93 ld (BFIELD),hl ; .. set 'DAC' jp l7bd3 ; l7c8d: ds 3 l7c90: db 0 l7c91: dc 'AC' l7c93: dc 'DAC' ; ; Put chain address in DE to file ; C.CHAIN: ld bc,01b*256+12 jp RELITEM ; Give CSEG chain address ; ; ; l7c9c: ld hl,l1233 ; Init pointer l7c9f: ld de,l1233+10 ; Set end call cmp.r ; .. test end reached ret z ; .. yeap push hl ; .. save this pointer l7ca7: ld a,(hl) ; Get link inc hl ld h,(hl) ld l,a or h ; Test NIL jp z,l7d13 ; .. yeap, get next push hl ; Save address inc hl ; Skip entries inc hl inc hl ld b,(hl) ; Get byte inc hl ld a,(hl) ; .. next byte and 00100000b ; Test bit set jp z,l7d0f ; .. nope, chain to next inc hl ld e,(hl) ; Get address inc hl ld d,(hl) ld a,d ; Test zero or e jp z,l7d0f ; .. yeap, chain to next push bc ; Save parameter in reg B call C.CHAIN ; Give chain address pop af ; Get back parameter inc hl ; .. advance pointer inc hl ld e,2 ; Set length cp 4 jp z,l7d00 ; .. give two bytes ld e,4 cp 5 jp z,l7d00 ; .. give 4 bytes ld e,8 cp 6 jp z,l7d00 ; .. give 8 bytes dec hl ld b,(hl) ; Get constant call put.to.CS ; .. put to REL file push hl ld hl,(CSIZE) ; Get code address inc hl inc hl ld b,01b call put.code ; Set program relative ld b,l call put.byte ; .. put low ld b,h call put.byte ; .. and high ld a,2 call add.CS ; Add two to code pointer pop hl ld e,(hl) ; Get count inc hl l7d00: ld a,e sub 1 ; Count down length ld e,a jp c,l7d0f ld b,(hl) ; Get constant inc hl call put.to.CS ; .. put to REL file jp l7d00 l7d0f: pop hl ; Get back pointer jp l7ca7 ; .. try same one l7d13: pop hl ; Get back pointer inc hl ; .. advance it inc hl jp l7c9f ; ; Set data location counter to value in DE ; DLOC: ld bc,10b*256+11 jp RELITEM ; Give DSEG location counter ; ; ; l7d1f: ;;?? ld bc,01b*256+11 jp RELITEM ; Give CSEG location counter ; ; ; l7d25: ld de,l0006 call C.CHAIN ; Give chain address ld hl,l141e l7d2e: ld a,(hl) add a,a jp m,l7dbb jp nc,l7d3e inc hl ld a,(hl) inc hl ld h,(hl) ld l,a jp l7d2e l7d3e: ld a,(hl) rra jp c,l7d89 l7d43: call ilstrg dc 'Line ' push hl inc hl inc hl inc hl ld e,(hl) ; Get line number inc hl ld d,(hl) call prdec ; .. print it call ilstrg db ' is undefined',cr,.lf pop hl ld a,(F$LST) ; Test console inc a jp z,l7d7b ; .. yeap push hl ld hl,conflg ld a,(hl) ; Get old flag ld (hl),1 ; .. force console pop hl or a jp z,l7d43 ; .. was not the console l7d7b: xor a ld (conflg),a ; .. clear console push hl ld hl,errcnt inc (hl) ; Bump error jp nz,l7d88 dec (hl) ; Truncate to max 255 l7d88: pop hl l7d89: inc hl ld a,(_stat1) ; Get status and 01000001b ; .. test ON ERROR/Debug jp z,l7db4 ; .. nope ld b,01b call put.code ; Set program relative ld b,(hl) call put.byte ; Put byte inc hl ld b,(hl) call put.byte ; .. next inc hl ld b,(hl) call put.cons ; Put to file inc hl ld b,(hl) call put.cons push hl ld a,4 call add.CS ; Add 4 to code pointer pop hl jp l7db7 l7db4: inc hl inc hl inc hl l7db7: inc hl jp l7d2e l7dbb: ld b,0 ; Get zero call put.to.CS ; .. put to REL file ld b,0 jp put.to.CS ; .. as word ; ; Add Accu to code size ; add.CS: ld hl,(CSIZE) ; Get code address call add.r.ov ; .. add ld (CSIZE),hl ; .. set result ret ; ; Add Accu to HL - Process overflow ; add.r.ov: add a,l ; Add it ld l,a ret nc ; .. no carry inc h ; .. add carry ret nz ; Verify max 0xFFFF ld a,2 jp prc.err ; .. out of memory ; ; ; l7dd9: inc hl ld e,(hl) inc hl ld d,(hl) inc hl ex (sp),hl jp (hl) ; ; ; l7de0: ld a,b cp 11b ; Test common jp z,l7deb ld a,d or e jp z,l7df6 l7deb: call put.code ; .. give common ld b,e call put.byte ; Put low ld b,d jp put.byte ; .. and high l7df6: ld b,d call put.cons ; Put address to file ld b,d jp put.cons ; ; ; l7dfe: ex de,hl ld a,(hl) and 2 jp z,l7e12 inc hl inc hl inc hl call ilstrg dc 'L' ld e,(hl) ; Fetch value inc hl ld d,(hl) jp prdec ; .. print it l7e12: push bc ld bc,l0000 ex de,hl ld hl,l138c l7e1a: call cmp.r ; Test HL=DE jp z,l7e3a ; .. yeap ld a,(hl) and 0c0h jp nz,l7e2d inc bc inc hl inc hl inc hl jp l7e1a l7e2d: and 01000000b call nz,intern.err ; .. error inc hl ld a,(hl) inc hl ld h,(hl) ld l,a jp l7e1a l7e3a: ld d,b ; Copy value ld e,c call ilstrg dc 'I' pop bc jp prdec ; .. print it ; ; ; l7e44: push af push hl ld hl,l7f1e ld a,(hl) and 00111110b ; Mask value ld (hl),a ; .. save pop hl ld a,(_stat1) ; Get status rla ; .. test disassembling call nc,prnl ; .. yeap, close line pop af ret ; ; ; l7e57: push af ld a,(_stat1) ; Get status rla ; .. test disassembling jp nc,l7e61 ; .. yeap pop af ret l7e61: pop af jp l4d47 ; ; Give control field 100xxxx ; ENTRY Reg C holds xxxx ; Reg B holds address mode ; Reg DE holds ; RELITEM: push bc ld b,00b call put.code ; .. set special link item ld b,c ld a,4 call put.bits ; Put control pop bc ld a,c cp 0100b+1 ; Test name field only jp c,l7e8c ; .. yeap cp 15 ; Test end of file ret z ; ..yeap ld a,2 call put.bits ; Give address bits ld b,e call put.byte ; Put low ld b,d call put.byte ; .. and high ld a,c cp 1001b ; Test name field follows ret nc ; .. nope l7e8c: push hl ld hl,(BFIELD) ; Get string address push hl ld a,(MSLINK) ; Test special link and a ld b,1 ; Preset length jp nz,l7e9b ; .. yeap dec b ; .. set length to zero l7e9b: inc b ; .. count length ld a,(hl) ; Find end of string and a inc hl jp p,l7e9b pop hl ld d,b ld a,3 call put.bits ; Give length ld a,(MSLINK) and NoMSB ; .. srip off bit jp z,l7eb6 ld b,a call put.byte ; .. put MSLINK item dec d l7eb6: ld a,(hl) and NoMSB ld b,a inc hl call put.byte ; .. put name dec d jp nz,l7eb6 pop hl ret ; ; Put number of bits in Accu to REL file ; put.bits: push de ld d,a ; Get count ld a,8 sub d ; Calculate remaining bits jp z,l7ed4 ; .. boundary ld e,a ld a,b l7ece: add a,a ; Position bits dec e jp nz,l7ece ld b,a l7ed4: ld a,b ; Get value add a,a ; .. get carry ld b,a call put.bit ; Put bit dec d jp nz,l7ed4 pop de ret ; ; Put constant byte in reg B to REL file and bump pointer ; put.to.CS: push hl ld a,1 call add.CS ; Add 1 to code pointer pop hl ; ; Put constant byte in reg B to REL file ; put.cons: xor a call put.bit ; Put zero bit ; ; Put byte to REL file ; put.byte: push bc ld c,8 ; Set byte count l7eee: ld a,b rla ; .. get bit ld b,a call put.bit ; .. put it dec c jp nz,l7eee pop bc ret ; ; Give sequence 1xx - xx in lower bits of reg B ; put.code: scf call put.bit ; Put 1 ld a,b rra rra call put.bit ; Get 1st address bit ld a,b rra ; .. then 2nd bit ; ; Put bit (CY) to REL file ; put.bit: push hl ld hl,obyte ; Point to byte ld a,(hl) ; Get current value rla ; .. shift carry in ld (hl),a inc hl inc (hl) ; Test bits remaining jp nz,l7f1a ; .. yeap call oput ; Put byte to REL file ld a,-8 ld (obits),a ; Reset bit count l7f1a: pop hl ret ; obyte: db 0 obits: db -8 l7f1e: db 0 l7f1f: db 0 l7f20: db 0c1h,080h,000h,080h,001h,000h,000h,000h db 000h,080h,000h,000h,000h,000h,000h,080h BFIELD: dw 0 MSLINK: db 0 l7f33: ; ##################### END OF CODE ##################### db '0',0,0,0,0,0,0,0,0,0,0,0,0 ds 28 db 0,0,0,0,0,0 ds 28 db 0,0,80h,81h,82h,83h,84h,85h db 86h,87h,88h,89h,8ah,8bh,8ch db 8dh,8eh,8fh,90h,91h,92h,93h db 94h,95h,96h,97h,98h,99h,9ah db 9bh,9ch,9dh,9eh,9fh,0a0h,0a1h db 0a2h,0a3h,0a4h,0a5h,0a6h,0a7h,0a8h db 0a9h,0aah,0abh,0ach,0adh,0aeh,0afh db 0b0h,0b1h,0b2h,0b3h,0b4h,0b5h,0b6h db 0b7h,0b8h,0b9h,0bah,0bbh,0bch,0bdh db 0beh,0bfh,0c0h,0c1h,0c2h,0c3h,0c4h db 0c5h,0c6h,0c7h,0c8h,0c9h,0cah,0cbh db 0cch,0cdh,0ceh,0cfh,0d0h,0d1h,0d2h db 0d3h,0d4h,0d5h,0d6h,0d7h,0d8h,0d9h db 0dah,0dbh,0dch,0ddh,0deh,0dfh,0e0h db 0e1h,0e2h,0e3h,0e4h,0e5h,0e6h,0e7h db 0c3h,'E',1 db 'COPYRIGHT (C) DIGITAL' l8000: db ' RESEARCH, 1979 and Pickles & Trout, 19801',null db 0ch,0cdh db 0bbh,2,0cdh,'Z',4,0edh,'[W',1 db 0cdh,0cfh,5,18h db 'MY',1,0dh,0ah,'CP/M SYSTEM ' db 'RESIZER',0dh,0ah,0dh,0ah db 'Copyright PICKLES & TROUT 1980',cr,lf db 'Version 2.2e ',cr,.lf db 0edh,'[',0b9h,1,0cdh,0cfh,5 db '>P',0cdh,95h,4,0edh,'[',0dfh db 1,0cdh,0cfh,5,18h,'8',0bbh,1 dc 'System size must be in the range of ' db 0e1h,1 dc ' Kbytes through ' db ':"',2,0cdh,95h,4,'*',1 db 0,'"',15h,2,'#^#V>',0c3h,12h db 13h,'*',0bah,8,0ebh,'s#r',0edh db '[',17h,2,0cdh,0cfh,5,18h,10h db 0bah,8,19h l8top:: l8703 equ 8703h end