ld a,(hl)\r
call outchar\r
djnz pss_l\r
+ dec hl\r
pop bc\r
ret\r
\r
inc de\r
call assert_eol\r
ld a,(symlen_max)\r
- add a,8\r
+ add a,7\r
ld b,a\r
- ld a,80 ;screen width\r
- ld c,-1\r
-psym_1:\r
- inc c\r
- sub a,b\r
- jr nc,psym_1\r
-\r
+ ld c,0\r
ld hl,ddtz_base+2\r
-psym_nxtline:\r
- ld b,c\r
-psym_nxtcol:\r
+psym_nxtsym:\r
ld d,(hl)\r
dec hl\r
ld e,(hl)\r
dec hl\r
ld a,(hl)\r
- call sub_hl_a1\r
cp 0c3h\r
jr z,psym_e\r
\r
ex de,hl\r
call out_hl\r
call outbl\r
- ld a,3\r
- call p_sym_space\r
ex de,hl\r
- djnz psym_nxtcol\r
+ call p_symstr\r
+\r
+ ld a,c\r
+ add b\r
+ ld c,a\r
+ ld a,80 ;screen width\r
+ sub b\r
+ cp c\r
+ jr c,psym_nxtline\r
+psym_fillcol:\r
+ call outbl\r
+ ld a,(con_col)\r
+ cp c\r
+ jr c,psym_fillcol\r
+ jr psym_nxtsym\r
+\r
+psym_nxtline:\r
+ ld c,0\r
call crlf\r
- jr psym_nxtline\r
+ jr psym_nxtsym\r
+\r
psym_e:\r
- ld a,b\r
- cp c\r
+ ld a,c\r
+ or a\r
ret z\r
jp crlf\r
\r
+\r
cmd_Q:\r
ld a,(de)\r
sub 'J'\r
cp 080h\r
jr nz,l1111h\r
call read_sector\r
+ ld a,01ah\r
ret z\r
sub a\r
l1111h:\r
ld de,(cur_fcb)\r
ld c,BDOS_READ\r
call ddtz_bdos\r
- dec a\r
+ sub a,1\r
jr z,l1132h\r
- jp p,ERROR\r
+ jr nc,error8\r
l1132h:\r
pop bc\r
pop de\r
push de\r
ld de,TPA\r
call cp_hl_de\r
- jp c,ERROR\r
+ jr c,error8\r
ld de,(BDOS+1)\r
call cp_hl_de\r
- jp nc,ERROR\r
+ jr nc,error8\r
ld de,(high_load)\r
call cp_hl_de\r
jr c,l1157h\r
pop hl\r
jr z,read_hexfile\r
ld de,TPA\r
- add hl,de\r
push hl\r
+ add hl,de\r
l108eh:\r
call read_sector\r
+ jr nz,read_file_nxt\r
pop hl\r
- jr z,read_symfile\r
+ jr read_symfile\r
+\r
+read_file_nxt:\r
ld de,DMA_BUF\r
ld b,080h\r
l109ah:\r
inc de\r
inc hl\r
djnz l109ah\r
- push hl\r
jr l108eh\r
\r
read_hexfile:\r
push hl\r
l10aeh:\r
- call read_byte\r
+ call read_byte ; RECORD MARK\r
jr z,rdhex_done\r
cp ':'\r
jr nz,l10aeh\r
ld c,0\r
- call read_hexchar\r
+ call read_hexchar ; RECLEN\r
ld b,a\r
- call read_hexchar\r
+ call read_hexchar ; LOAD ADDR H\r
ld h,a\r
- call read_hexchar\r
+ call read_hexchar ; LOAD ADDR L\r
ld l,a\r
ld a,b\r
and a\r
jr z,rdhex_done\r
- call read_hexchar\r
+ call read_hexchar ; RECTYP\r
l10cch:\r
- call read_hexchar\r
+ call read_hexchar ; DATA\r
pop de\r
push de\r
push hl\r
pop hl\r
inc hl\r
djnz l10cch\r
- call read_hexchar\r
+ call read_hexchar ; CHKSUM\r
ld a,c\r
and a\r
jr nz,error9\r
cp ' '\r
jp z,p_max_high\r
\r
+ push hl ; offset\r
call pstr_inl\r
db 'SYMBOLS',CR,LF+80h\r
\r
rs_1:\r
call read_byte\r
rs_2:\r
+ pop de ; offset\r
cp 1ah\r
jp z,p_max_high\r
+ push de ; offset\r
cp '!'\r
jr c,rs_1\r
- call read_hexbyte0\r
- ld d,a\r
- call read_hexbyte ; symval\r
- ld e,a\r
- push de ; symval\r
+ call read_hexbyte0 ; symval H\r
+ ld h,a\r
+ call read_hexbyte ; symval L\r
+ ld l,a\r
+ add hl,de\r
+ push hl ; symval\r
call read_byte\r
cp ' '\r
jr z,rs_4\r
cp ' '\r
jr c,rs_2\r
jr rs_3\r
-;\r
+\r
rs_4: ld hl,(BDOS+1) ;\r
ld e,0 ; setup symlen\r
rs_5: dec hl ;\r
- call read_byte ;\r
- cp TAB ;\r
+ call read_byte ; next char of symbol name\r
+ cp TAB ; symbol term?\r
jr z,rs_6 ;\r
cp CR ;\r
jr z,rs_6 ;\r
- cp '!' ;\r
- jr c,error9 ;\r
+ cp '!' ; TODO: check for valid symbol char instead\r
+ jr c,error9 ;\r
ld (hl),a ;\r
inc e ; symlen++\r
ld a,e ;\r
jr c,rs_5 ;\r
error9:\r
jp ERROR ;\r
-;\r
+\r
rs_6: push de ; symlen\r
push hl ;\r
ex de,hl ;\r