outquote:\r
ld a,''''\r
outchar:\r
+ push ix\r
+ push iy\r
push hl\r
push de\r
push bc\r
pop bc\r
pop de\r
pop hl\r
+ pop iy\r
+ pop ix\r
ret\r
\r
pstr:\r
to_error:\r
jp ERROR\r
\r
-chk_sp:\r
+chk_stack:\r
push hl\r
push de\r
ld hl,0\r
inc de\r
l03a2h:\r
push hl\r
- push af\r
+ push af ;'S' flag\r
call expr\r
jr c,l03b8h\r
ld b,h\r
ld c,l\r
pop af\r
pop hl\r
- jr z,l03b6h\r
+ jr z,l03b6h ;'S'?\r
ld a,c\r
sub l\r
ld c,a\r
l03b8h:\r
pop af\r
pop hl\r
- jr z,error0\r
+ jr z,error0 ;'S', but no expression following\r
scf\r
ret\r
\r
jp ERROR\r
\r
do_factor:\r
- call chk_sp\r
+ call chk_stack\r
call get.number\r
ret nc\r
inc de\r
dec hl\r
inc de\r
cp '.'\r
+ jr nz,cmds_dash\r
+ ld a,(de)\r
+ or a\r
+ jr nz,l0d8ah\r
+ ret\r
+cmds_dash:\r
jp z,assert_eol\r
cp '-'\r
jr nz,l0d8ah\r
cmd_A:\r
ld hl,(last_A)\r
call get_lastarg_def\r
- push hl\r
- pop iy\r
- ld hl,l1259h\r
+ ld (last_A),hl\r
+ ld (cmd_A_prev),hl\r
+ ld hl,cmda_restart\r
ld (error_func),hl\r
ld (l1262h),sp\r
-l1211h:\r
- push iy\r
- pop hl\r
- ld (last_A),hl\r
+cmda_loop:\r
+ ld hl,(last_A)\r
ld (var.$),hl\r
push hl\r
call p_disas_line\r
- pop iy\r
ld de,(var.@)\r
ld a,d\r
or e\r
- ld c,17\r
+ ld c,19\r
jr z,l122dh\r
- ld c,25\r
+ ld c,19+7\r
l122dh:\r
call p_fill_space\r
ld c,b\r
push bc\r
call get_line\r
pop bc\r
+ pop hl\r
call skipbl\r
cp '.'\r
ret z\r
cp '-'\r
jr nz,l124bh\r
- ld iy,(cmd_A_prev)\r
- jr l1211h\r
+ ld hl,(cmd_A_prev)\r
+ jr cmda_lpend\r
l124bh:\r
+ push hl\r
+ pop iy\r
+ push hl\r
and a\r
- call nz,sub_1268h\r
- ld (cmd_A_prev),iy\r
+ call nz,asemble_line\r
ld b,0\r
- add iy,bc\r
- jr l1211h\r
+ pop hl\r
+ ld (cmd_A_prev),hl\r
+ add hl,bc\r
+cmda_lpend:\r
+ ld (last_A),hl\r
+ jr cmda_loop\r
\r
-l1259h:\r
+cmda_restart:\r
call l0146h\r
ld sp,(l1262h)\r
- jr l1211h\r
+ jr cmda_loop\r
\r
-sub_1268h:\r
+asemble_line:\r
call skipbl\r
ld hl,t_MNEMONICS\r
call sub_030ah\r
jr nc,l18dbh\r
ld hl,(last_L)\r
l18dbh:\r
- push hl\r
- pop iy\r
call next_arg\r
call get_range\r
jr nc,l1905h\r
ld b,16\r
l18ebh:\r
push bc\r
- push iy\r
- pop hl\r
- push hl\r
- call p_disas_line\r
- call crlf\r
- pop iy\r
- ld c,b\r
- ld b,0\r
- add iy,bc\r
- ld (last_L),iy\r
+ call cmdl_p_line\r
pop bc\r
djnz l18ebh\r
ret\r
+\r
l1905h:\r
call assert_eol\r
- ld h,b\r
- ld l,c\r
- ld a,b\r
- or c\r
- jr nz,l190fh\r
- dec hl\r
+ ld d,h\r
+ ld e,l\r
+ add hl,bc\r
+ ex de,hl\r
l190fh:\r
- push hl\r
- push iy\r
- pop hl\r
- push hl\r
- call p_disas_line\r
- call crlf\r
- pop iy\r
- ld e,b\r
- ld d,000h\r
- add iy,de\r
- ld (last_L),iy\r
- pop hl\r
- and a\r
- sbc hl,de\r
- ret z\r
- ret c\r
- jr l190fh\r
+ push de\r
+ call cmdl_p_line\r
+ pop de\r
+ call cp_hl_de\r
+ jr c,l190fh\r
+ ret\r
+\r
+cmdl_p_line:\r
+ push hl\r
+ call p_disas_line\r
+ call crlf\r
+ pop hl\r
+ ld c,b\r
+ ld b,0\r
+ add hl,bc\r
+ ld (last_L),hl\r
+ ret\r
\r
p_disas_line:\r
call p_label\r
call outbl\r
sub a\r
ld (con_col),a\r
+ push hl\r
+ pop iy\r
call p_disas_instr\r
and a\r
ret z\r
ld (l1ffdh),a\r
call disas_get_instrlen\r
jr nc,l197fh\r
- push bc\r
- call p_mnemonic\r
+ push bc\r
+ ld a,(con_col)\r
+ add a,5\r
+ ld c,a\r
+ call pstr\r
+ call p_fill_space\r
ex de,hl\r
call call_hl\r
pop bc\r
ld a,(l1ffdh)\r
- ld hl,(l1ffbh)\r
+ ld hl,(disas_arg_16)\r
scf\r
ret\r
\r
l197fh:\r
call pstr_inl\r
DC '???'\r
- ld b,001h\r
+ ld b,1\r
sub a\r
ret\r
\r
ld a,002h\r
sub_1d50h:\r
ld (l1ffdh),a\r
- ld (l1ffbh),hl\r
- call out_hl\r
- ret\r
+ ld (disas_arg_16),hl\r
+ jp out_hl\r
+\r
p_arg_ww_mn:\r
call p_arg_ww\r
call p_char_comma\r
call sub_1e13h\r
call p_char_comma\r
jp p_arg_hlixiy\r
+\r
p_arg_hl_addr:\r
call p_arg_hlixiy\r
call p_char_comma\r
call sel_dc_string\r
jp pstr\r
\r
-p_mnemonic:\r
- ld a,(con_col)\r
- add a,5\r
- ld c,a\r
- call pstr\r
- jp p_fill_space\r
-\r
t_MNEMONICS:\r
DC 'ADC'\r
DC 'ADD'\r
call disas_get_instrlen\r
jp nc,ERROR\r
ld c,b\r
- ld b,000h\r
+ ld b,0\r
ld hl,(reg.pc)\r
add hl,bc\r
call sub_09cah\r
db 0\r
last_L:\r
dw TPA\r
-l1ffbh:\r
+disas_arg_16:\r
dw 0\r
l1ffdh:\r
db 0\r