summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--ddt180.z80511
2 files changed, 255 insertions, 264 deletions
diff --git a/Makefile b/Makefile
index 44b6c27..6ac3191 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ ZIP := zip
AS_OPT := MFS
-.phony: all
+.PHONY: all
all: $(PROG).com
@@ -57,7 +57,7 @@ version.inc: autorevision.cache
db '$(VERS)'\r\n\
endm\r\n\032" > $@
-.phony: dist
+.PHONY: dist
dist: $(PROG).com version.inc
$(GIT) archive --format=zip --prefix=$(PREFIX)/ -9 -o $(DIST_NAME) HEAD^{tree}
@mkdir -p $(PREFIX)
@@ -65,7 +65,7 @@ dist: $(PROG).com version.inc
$(ZIP) -r -9 $(DIST_NAME) $(PREFIX) $(PROG).com
@$(RM) -r $(PREFIX)
-.phony: clean
+.PHONY: clean
clean:
rm -f $(PROG).com *.rel *.lst *.prl
@@ -76,7 +76,7 @@ clean:
define cpm-asm =
COMMAND="$(ASM) -$(basename $<)/$(AS_OPT)"; \
OUTPUT=$$(mktemp); echo $${COMMAND}; \
-$${COMMAND} > $${OUTPUT}; \
+$${COMMAND} > $${OUTPUT} < $<; \
grep -q '^ 0 Error(s) Detected' $${OUTPUT}; ERROR=$$? ; \
if [ "$${ERROR}" != "0" ]; then cat $${OUTPUT}; rm -f $@; fi ; \
exit $${ERROR}
diff --git a/ddt180.z80 b/ddt180.z80
index 220c074..c1a394b 100644
--- a/ddt180.z80
+++ b/ddt180.z80
@@ -7,31 +7,11 @@
; - Cut the .PRL header (first 256 byte) end rename the result to DDTZ.COM.
;-------------------------------------------------------------------------------
-; Relocation loader
-;
-TPA equ 0100h
- cseg
- .phase TPA
-
- jp start
- ds 3
-
-ldr_end:
-ldr_size equ $ - TPA
-current_phase defl $
-
- .dephase
-current_cseg defl $
-
-;-------------------------------------------------------------------------------
-; DDT/Z core
-;
-
; Some greneral definitions
-TAB equ 9
-LF equ 10
-CR equ 13
+TAB equ 09h
+CR equ 0dh
+LF equ 0ah
; CP/M memory layout
@@ -70,12 +50,32 @@ SYMCASE_CONV equ 1 ;Convert case when symbols are loaded
SYMCASE_LOWER equ 2 ;Convert to lower case if set, else to upper case
;-------------------------------------------------------------------------------
+; Relocation loader
+;
+TPA equ 0100h
+ cseg
+ .phase TPA
+
+ jp start
+ ds 3
+
+ldr_end:
+ldr_size equ $ - TPA
+current_phase defl $
+
+ .dephase
+current_cseg defl $
+
+;-------------------------------------------------------------------------------
+; DDT/Z core
+;
+
ddtz_base:
jp ddtz_bdos
l0003h:
- rst 30h
-di_or_ei:
+ rst 30h ;rst used by ddtz
+di_or_ei: ;ints enabled/disabled while ddtz is running
nop
ret
ddtz_bdos:
@@ -146,9 +146,7 @@ conbuf:
ld sp,stack
exx
ld de,ddtz_base
- or a
- sbc hl,de
- add hl,de
+ call cp_hl_de
jr c,l0079h
ex de,hl
l0079h:
@@ -214,6 +212,11 @@ CMDTAB:
dw cmd_Y ;examine [and substitute] Y variables
dw cmd_Z ;Zap (fill) memory with a byte string
+ERROR:
+ ld hl,(error_func)
+exe_hl:
+ call CALL_HL
+ ;fall thru
mainloop:
ld sp,stack
ld hl,p_msg_error
@@ -223,6 +226,7 @@ mainloop:
call bp_clr_temporary
ld hl,(cmd_rpt)
ld de,mainloop
+ ld (cmd_rpt),de
call cp_hl_de
ld a,'>'
call outchar
@@ -231,28 +235,19 @@ mainloop:
call get_line
call skipbl
jr z,exe_hl
- ld hl,mainloop
- ld (cmd_rpt),hl
inc de
sub '@'
jr c,ERROR
cp 'Z'+1-'@'
jr nc,ERROR
- add a,a
ld hl,CMDTAB
- call add_hl_a
+ call add_hl_a2
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
jr exe_hl
-ERROR:
- ld hl,(error_func)
-exe_hl:
- call CALL_HL
- jr mainloop
-
;-------------------------------------------------------------------------------
p_msg_error:
@@ -261,10 +256,10 @@ p_msg_error:
;fall thru
crlf:
call pstr_inl
- db CR,LF+80h
- call inchar
- ld a,0
+ dc CR,LF
+ xor a
ld (con_col),a
+ call inchar
jr c,mainloop
ret
@@ -290,8 +285,7 @@ l01bfh:
sub_01d9h:
call pstr_inl
dc '-'
- dec hl
- jp cpl.hl
+ jp neg.hl
out_hl_dec_neg:
push hl
@@ -358,9 +352,8 @@ out.bin.b:
l01c9h:
rlca
push af
- ld a,'0'/2
- adc a,a
- call outchar
+ and 1
+ call out_dgt
pop af
djnz l01c9h
ld a,'"'
@@ -373,7 +366,8 @@ out.ascii:
cp ' '
push af
call nc,outbl
- call outquote
+ call pstr_inl
+ dc ''''
pop af
jr nc,l0242h
sub 0c0h
@@ -385,7 +379,8 @@ l0242h:
call outchar
cp ''''
call z,outchar
- call outquote
+ call pstr_inl
+ dc ''''
sla c
pop bc
ret nc
@@ -400,10 +395,6 @@ outbl2:
call outbl
outbl:
ld a,' '
- jr outchar
-
-outquote:
- ld a,''''
outchar:
push ix
push iy
@@ -425,22 +416,6 @@ outchar:
pop ix
ret
-pstr:
- ld a,(hl)
- inc hl
- and a
- ret z
- call outchar
- and a
- ret m
- jr pstr
-
-pstr_inl:
- ex (sp),hl
- call pstr
- ex (sp),hl
- ret
-
p_align_@_sym:
push de
ld de,(var.@)
@@ -470,11 +445,11 @@ inchar:
ld c,BDOS_CSTAT
call ddtz_bdos
and a
- jr z,l0284h
+ jr z,inch1
ld c,BDOS_CIN
call ddtz_bdos
scf
-l0284h:
+inch1:
pop bc
pop de
pop hl
@@ -531,12 +506,13 @@ skipbl:
or a
ret
+;-------------------------------------------------------------------------------
+
next_arg:
call skipbl
cp ','
ret nz
- inc de
- call skipbl
+ call skipbl0
cp a
ret
@@ -562,6 +538,8 @@ chk_stack:
;-------------------------------------------------------------------------------
+add_hl_a2:
+ add a,a
add_hl_a:
add a,l
ld l,a
@@ -580,8 +558,8 @@ sub_hl_a1:
sub_hl_a:
push bc
ld c,a
- ld b,0
- or a
+ xor a
+ ld b,a
sbc hl,bc
pop bc
ret
@@ -693,7 +671,7 @@ l030ch:
sub_0318h:
push bc
res 7,b
- defb 03eh ;ld a,nn
+ defb 03eh ;ld a,nn: swallow push bc
sub_031ch:
push bc
push de
@@ -715,22 +693,23 @@ l031eh:
pop bc
ret
l0336h:
- call sub_0345h
+ call str_sel_next
l0339h:
pop de
and a
pop bc
ret
-sel_dc_string:
+str_sel:
inc b
-l033eh:
- dec b
- ret z
- call sub_0345h
- jr l033eh
+ jr str_sel2
+str_sel1:
+ call str_sel_next
+str_sel2:
+ djnz str_sel1
+ ret
-sub_0345h:
+str_sel_next:
ld a,(hl)
and a
ret z
@@ -741,12 +720,12 @@ l0348h:
ret m
jr l0348h
-sub_034eh:
+get_arg_range_target:
call get_arg_range
push hl
push bc
call next_arg
- call sub_0363h
+ call get_arg_final
ex de,hl
pop bc
pop hl
@@ -757,7 +736,7 @@ sub_035dh:
jr c,error0
ret
-sub_0363h:
+get_arg_final:
call sub_035dh
l0366h:
jp assert_eol
@@ -906,8 +885,7 @@ l0406h:
l0411h:
ld hl,tab_func_eqlege
ld a,b
- add a,a
- call add_hl_a
+ call add_hl_a2
ld c,(hl)
inc hl
ld b,(hl)
@@ -1061,8 +1039,7 @@ do_binary_op:
call lookupch
ld a,b
ld hl,tblf_opa
- add a,a
- call add_hl_a
+ call add_hl_a2
ld c,(hl)
inc hl
ld b,(hl)
@@ -1096,6 +1073,7 @@ do_factor:
ret nc
inc de
ld hl,(BDOS+1)
+ dec hl
cp 'T'
ret z
ld hl,(high_load)
@@ -1145,9 +1123,8 @@ fact_reg.Y:
jr c,error1
inc de
get_y_val:
- add a,a
ld hl,reg_Y
- call add_hl_a
+ call add_hl_a2
ld a,(hl)
inc hl
ld h,(hl)
@@ -1187,14 +1164,19 @@ fact_reg.CPU:
inc hl
ld h,(hl)
ld l,a
- and a
+ xor a ;clr cy, a=0
bit 0,c
ret nz
- ld h,000h
+ ld h,a
ret
+fact_factinv:
+ call fact_factor
+ jr cpl.hl
+
fact_factneg:
call fact_factor
+neg.hl:
dec hl
cpl.hl:
ld a,h
@@ -1205,10 +1187,6 @@ cpl.hl:
ld l,a
ret
-fact_factinv:
- call fact_factor
- jr cpl.hl
-
fact_mem:
call expr1
jr c,error1
@@ -1438,13 +1416,13 @@ p_f:
call p_flags
ld a,(reg.iff)
cp 0f3h
- jp z,outbl
+ jr z,outbl_1
ld a,'E'
jp outchar
p_f2:
ld a,(reg.f2)
call p_flags
- jp outbl
+ jr outbl_1
p_flags:
push hl
@@ -1499,10 +1477,10 @@ l06deh:
ld a,(de)
call out_hex
l06e2h:
- call outbl
pop de
pop hl
- ret
+outbl_1:
+ jp outbl
b_06e9_start:
DC 'A '
@@ -1923,18 +1901,18 @@ bp_tst_@pc:
call bpl_init
ld a,(ix+000h)
- and 003h
- jr z,bp_tst_e
+ and 003h ;User bp (temporary or permanent)?
+ jr z,bp_tst_e ;No, check next
ld e,(ix+002h)
ld d,(ix+003h)
ld hl,(reg.pc)
- call cp_hl_de
- ret z
+ call cp_hl_de ;Current PC is on a User bp
+ ret z ;Return zero
bp_tst_e:
call bpl_next
sub a
- inc a
- ret
+ inc a ;Not on a user bp
+ ret ;Return not zero
bp_trace_enter:
call bp_get_freeslot
@@ -1976,7 +1954,6 @@ bp_set_to_mem:
inc hl
ld (hl),d
l0a1dh:
-
call bpl_next
ret
@@ -2020,12 +1997,12 @@ l0a41h:
bp_clr_condition:
ld a,(ix+000h)
and 003h
- ret nz
+ ret nz ; No (user) bp set
ld e,(ix+006h)
ld d,(ix+007h)
ld a,d
or e
- ret z
+ ret z ; No conditional expression
push bc
ld h,d
ld l,e
@@ -2121,7 +2098,7 @@ sub_0bdch:
add hl,bc
ex de,hl
ld c,003h
- jp l0c33h
+ jr l0c33h
;-------------------------------------------------------------------------------
; > X
@@ -2137,15 +2114,15 @@ cmd_X:
jp nc,p_cpustat0
call assert_eol
ld a,b
- cp 01eh
+ cp 30
jr z,l0c5fh
- cp 01fh
+ cp 31
jr z,l0c4fh
- cp 01dh
+ cp 29
jp z,ERROR
ex de,hl
ld hl,t_reg_names
- call sel_dc_string
+ call str_sel
l0c12h:
call l0c33h
l0c15h:
@@ -2155,7 +2132,7 @@ l0c15h:
call get_line
call skipbl
jr z,l0c30h
- call sub_0363h
+ call get_arg_final
ex de,hl
pop bc
pop hl
@@ -2258,38 +2235,38 @@ sub_0caeh:
ret
t_reg_names:
- DC 'BC'''
- DC 'DE'''
- DC 'HL'''
- DC 'BC'
- DC 'DE'
- DC 'HL'
- DC 'A'''
- DC 'B'''
- DC 'C'''
- DC 'D'''
- DC 'E'''
- DC 'H'''
- DC 'L'''
- DC 'A'
- DC 'B'
- DC 'C'
- DC 'D'
- DC 'E'
- DC 'H'
- DC 'L'
- DC 'IX'
- DC 'IY'
- DC 'SP'
- DC 'PC'
- DC 'X'
- DC 'Y'
- DC 'S'
- DC 'P'
- DC 'I'
- DC 'IP'
- DC 'F'''
- DC 'F'
+ DC 'BC''' ;0
+ DC 'DE''' ;1
+ DC 'HL''' ;2
+ DC 'BC' ;3
+ DC 'DE' ;4
+ DC 'HL' ;5
+ DC 'A''' ;6
+ DC 'B''' ;7
+ DC 'C''' ;8
+ DC 'D''' ;9
+ DC 'E''' ;10
+ DC 'H''' ;11
+ DC 'L''' ;12
+ DC 'A' ;13
+ DC 'B' ;14
+ DC 'C' ;15
+ DC 'D' ;16
+ DC 'E' ;17
+ DC 'H' ;18
+ DC 'L' ;19
+ DC 'IX' ;20
+ DC 'IY' ;21
+ DC 'SP' ;22
+ DC 'PC' ;23
+ DC 'X' ;24
+ DC 'Y' ;25
+ DC 'S' ;26
+ DC 'P' ;27
+ DC 'I' ;28
+ DC 'IP' ;29
+ DC 'F''' ;30
+ DC 'F' ;31
DB 0
b_0cfa_start:
@@ -2417,7 +2394,6 @@ msg_@:
; Input a byte from port
cmd_I:
- ld hl,cmd_I
ld (cmd_rpt),hl
ld hl,(last_I)
call get_lastarg_def
@@ -2437,7 +2413,6 @@ cmd_I:
; Output a byte to a port
cmd_O:
- ld hl,cmd_O
ld (cmd_rpt),hl
ld hl,(last_O_val)
call get_arg_def
@@ -2459,7 +2434,7 @@ cmd_O:
; Verify (compare) two memory areas
cmd_V:
- call sub_034eh
+ call get_arg_range_target
l0dedh:
push bc
ld a,(de)
@@ -2481,12 +2456,9 @@ l0dedh:
call crlf
l0e10h:
pop bc
- inc hl
inc de
- dec bc
- ld a,b
- or c
- jr nz,l0dedh
+ cpi
+ jp pe,l0dedh
ret
;-------------------------------------------------------------------------------
@@ -2500,7 +2472,7 @@ cmd_M:
inc de
l0e1fh:
push af
- call sub_034eh
+ call get_arg_range_target
push hl
push de
push bc
@@ -2646,7 +2618,7 @@ l0e96h:
add hl,bc
l0ea7h:
ld bc,16
- and a
+ and a ;clear carry
call sub_0f58h
pop hl
pop bc
@@ -2714,9 +2686,9 @@ sub_0ee6h:
ret nz
jp ERROR
-sub_0ef7h:
+sub_0ef7h: ;from cmd_Q, cmd_Z
db 0e6h ; and 037h (clear carry)
-sub_0ef8h:
+sub_0ef8h: ;from cmd_S
scf
l0ef9h:
push af
@@ -2783,7 +2755,6 @@ l0f42h:
; Display memory in hex and ASCII
cmd_D:
- ld hl,cmd_D
ld (cmd_rpt),hl
ld hl,(last_D)
ld bc,128
@@ -3379,6 +3350,7 @@ p_max_high:
call pstr_inl
DC ' Top = '
ld hl,(BDOS+1)
+ dec hl
call out_hl
jp crlf
@@ -3771,7 +3743,7 @@ as.LD:
l1395h:
call assert_eol
ld a,(prefix_ixiy)
-l139bh:
+as_store_4:
ld (iy+000h),a
ld (iy+001h),b
ld (iy+002h),l
@@ -3786,7 +3758,7 @@ l13aah:
inc de
ld b,032h
-as.store_3:
+as_store_3:
call assert_eol
ld (iy+000h),b
ld (iy+001h),l
@@ -3802,10 +3774,10 @@ l13c2h:
l13c9h:
call assert_eol
ld a,0edh
- jr l139bh
+ jr as_store_4
l13d0h:
ld b,022h
- jr as.store_3
+ jr as_store_3
l13d4h:
ld b,a
@@ -3879,7 +3851,7 @@ l1432h:
add a,006h
l143fh:
ld b,a
-as.store_2:
+as_store_2:
call assert_eol
ld (iy+000h),b
ld (iy+001h),l
@@ -3906,7 +3878,7 @@ l1466h:
call test_expr
call test_paren_close
ld b,03ah
- jp as.store_3
+ jp as_store_3
l1471h:
call assert_comma
@@ -3970,7 +3942,7 @@ l14cch:
l14e3h:
ld b,02ah
- jp as.store_3
+ jp as_store_3
l14e8h:
call test_expr
@@ -3978,7 +3950,7 @@ l14e8h:
ld a,001h
add a,b
ld b,a
- jp as.store_3
+ jp as_store_3
l14f5h:
call assert_comma
call get_char_upper
@@ -4180,7 +4152,7 @@ l163ch:
l163eh:
pop af
call test_expr
- jp as.store_3
+ jp as_store_3
as.RET:
call arg.cc_ZCPS
@@ -4213,7 +4185,7 @@ l1666h:
pop af
l166eh:
call test_expr
- jp as.store_3
+ jp as_store_3
l1674h:
call assert_eol
ld a,b
@@ -4228,7 +4200,7 @@ l1680h:
ld b,0fdh
l1687h:
ld l,0e9h
- jp as.store_2
+ jp as_store_2
l168ch:
DC '(HL)'
@@ -4251,7 +4223,7 @@ l16a9h:
call assert_comma
l16aeh:
call arg.j_displ
- jp as.store_2
+ jp as_store_2
as.IM:
call arg.imm_8bit
@@ -4307,7 +4279,7 @@ as.IN:
jr c,l1715h
call arg.addr_8bit
ld b,0dbh
- jp as.store_2
+ jp as_store_2
l170fh:
call assert_comma
call sub_171bh
@@ -4341,7 +4313,7 @@ l1739h:
jr nz,error7
inc de
ld b,0d3h
- jp as.store_2
+ jp as_store_2
as.EX:
ld hl,b_176d_start
@@ -4469,7 +4441,7 @@ error8:
arg.zz:
push hl
- ld hl,t_BC.DE.HL.AF
+ ld hl,t_arg_rp2
jr l181fh
arg.reg_16bit:
@@ -4478,7 +4450,7 @@ arg.reg_16bit:
arg.ww:
push hl
- ld hl,t_BC.DE.HL.SP
+ ld hl,t_arg_rp
l181fh:
push bc
call sub_030ah
@@ -4498,7 +4470,7 @@ arg.r_HL_A:
call skipbl
push bc
push hl
- ld hl,t_BCDEHL_HL_A
+ ld hl,t_arg_r
call sub_030ah
ld a,b
pop hl
@@ -4586,7 +4558,7 @@ arg.cc_ZCPS:
jr l18b1h
arg.cc_ZC:
- ld hl,t_tstfl_ZC
+ ld hl,t_arg_cc
ld c,003h
l18b1h:
push bc
@@ -4619,7 +4591,6 @@ test_paren_close:
; List disassembled code
cmd_L:
- ld hl,cmd_L
ld (cmd_rpt),hl
call expr
jr nc,l18dbh
@@ -4709,10 +4680,10 @@ p_disas_instr:
ld a,(con_col)
add a,5
ld c,a
- call pstr
+ call pstr ;print mnemonic
call p_goto_col
ex de,hl
- call call_hl
+ call call_hl ;print arguments
pop bc
ld a,(disas_argtype)
ld hl,(disas_arg_16)
@@ -4761,6 +4732,65 @@ l19b1h:
;-------------------------------------------------------------------------------
+disas_nopfx:
+ ld hl,b_1b54_start ;2 byte opcodes
+ call lookup_op
+ ld b,2
+ ret c
+ ld hl,b_1ab6_start ;1 byte opcodes (no parameters)
+ call sub_1a72h
+ ld b,1
+ ret c
+ ld hl,b_1ad1_start ;1 byte opcodes
+ call lookup_op
+ ld b,1
+ ret c
+ ld hl,b_1b9b_start ;3 byte opcodes
+ call lookup_op
+ ret nc
+ ld b,3
+ ret
+
+;-------------------------------------------------------------------------------
+
+disas_pfx.ED:
+ inc iy
+ ld hl,b_1bc9_start ;1 byte opcode, no arguments
+ call sub_1a72h
+ ld b,2
+ ret c
+ ld hl,b_1bf4_start
+ call lookup_op
+ ld b,2
+ ret c
+
+ ld hl,l228bh
+ call lookup_op
+ ld b,3
+ ret c
+ ld hl,b_1c40_start
+ call lookup_op
+ ld b,4
+ ret
+
+;-------------------------------------------------------------------------------
+
+disas_pfx.CB:
+ push iy
+ inc iy
+ ld a,(isprefix_ixiy)
+ and a
+ jr z,l1a42h
+ inc iy
+l1a42h:
+ ld hl,b_1c55_start
+ call lookup_op
+ pop iy
+ ld b,2
+ ret
+
+;-------------------------------------------------------------------------------
+
disas_pfx.DDFD:
inc iy
ld hl,b_19ef_start
@@ -4837,65 +4867,6 @@ l1a0ah:
;-------------------------------------------------------------------------------
-disas_pfx.ED:
- inc iy
- ld hl,b_1bc9_start
- call sub_1a72h
- ld b,2
- ret c
- ld hl,b_1bf4_start
- call lookup_opc
- ld b,2
- ret c
-
- ld hl,l228bh
- call lookup_opc
- ld b,3
- ret c
- ld hl,b_1c40_start
- call lookup_opc
- ld b,4
- ret
-
-;-------------------------------------------------------------------------------
-
-disas_pfx.CB:
- push iy
- inc iy
- ld a,(isprefix_ixiy)
- and a
- jr z,l1a42h
- inc iy
-l1a42h:
- ld hl,b_1c55_start
- call lookup_opc
- pop iy
- ld b,2
- ret
-
-;-------------------------------------------------------------------------------
-
-disas_nopfx:
- ld hl,b_1b54_start
- call lookup_opc
- ld b,2
- ret c
- ld hl,b_1ab6_start
- call sub_1a72h
- ld b,1
- ret c
- ld hl,b_1ad1_start
- call lookup_opc
- ld b,1
- ret c
- ld hl,b_1b9b_start
- call lookup_opc
- ret nc
- ld b,3
- ret
-
-;-------------------------------------------------------------------------------
-
sub_1a72h:
ld a,(hl)
cp 0ffh
@@ -4922,7 +4893,7 @@ test_DDFD:
scf
ret
-lookup_opc:
+lookup_op:
ld a,(iy+000h)
and (hl)
inc hl
@@ -4934,7 +4905,7 @@ lookup_opc:
inc hl
ld a,(hl)
and a
- jr nz,lookup_opc
+ jr nz,lookup_op
ret
l1aa8h:
@@ -5029,7 +5000,7 @@ b_1ad1_start:
dw l1ce5h
db 0
-; 2 byte opdodes
+; 2 byte opcodes
b_1b54_start:
db 0c7h,006h,056h ;ld r,nn
dw l1cfah
@@ -5505,7 +5476,7 @@ l1e61h:
jp p_arg_nn_rp
p_arg_r1:
- ld hl,t_BCDEHL_HL_A
+ ld hl,t_arg_r
jr p_arg
b_1e78_start:
@@ -5518,10 +5489,10 @@ p_arg_hlixiy:
ld hl,t_HL.IX.IY
jr p_arg
p_arg_zz:
- ld hl,t_BC.DE.HL.AF
+ ld hl,t_arg_rp2
jr l1e8eh
p_arg_ww:
- ld hl,t_BC.DE.HL.SP
+ ld hl,t_arg_rp
l1e8eh:
ld a,(iy+000h)
rra
@@ -5543,8 +5514,24 @@ p_arg_cc0:
ld hl,t_tstfl_ZCPS
p_arg:
ld b,a
- call sel_dc_string
- jp pstr
+ ;fall thru
+pstr_sel:
+ call str_sel
+ ;fall thru
+pstr:
+ ld a,(hl)
+ inc hl
+ and a
+ ret z
+ call outchar
+ ret m
+ jr pstr
+
+pstr_inl:
+ ex (sp),hl
+ call pstr
+ ex (sp),hl
+ ret
;-------------------------------------------------------------------------------
@@ -5628,7 +5615,7 @@ t_MNEMONICS:
DC 'TSTIO'
DB 0
-t_BCDEHL_HL_A:
+t_arg_r:
DC 'B'
DC 'C'
DC 'D'
@@ -5638,13 +5625,13 @@ t_BCDEHL_HL_A:
DC '(HL)'
DC 'A'
DB 0
-t_BC.DE.HL.SP:
+t_arg_rp:
DC 'BC'
DC 'DE'
DC 'HL'
DC 'SP'
DB 0
-t_BC.DE.HL.AF:
+t_arg_rp2:
DC 'BC'
DC 'DE'
t_HL.AF:
@@ -5669,7 +5656,7 @@ t_IX.IY:
DC 'IX'
DC 'IY'
DB 0
-t_tstfl_ZC:
+t_arg_cc:
DC 'NZ'
DC 'Z'
DC 'NC'
@@ -5709,7 +5696,7 @@ tc_set_bp:
ld de,BDOS
and a
sbc hl,de
- ld hl,l20edh
+ ld hl,l20edh ;set break after BDOS call
jr z,l2031h
ld iy,(reg.pc)
call disas_get_instrlen
@@ -5721,7 +5708,7 @@ tc_set_bp:
call bp_trace_enter
ld iy,(reg.pc)
ld hl,b_2039_start
- call lookup_opc
+ call lookup_op
ccf
ret c
ex de,hl
@@ -5784,6 +5771,7 @@ l208bh:
scf
ret
+;jr, djnz
l2093h:
ld c,(iy+001h)
ld a,c
@@ -5827,6 +5815,8 @@ l20b8h:
jr z,l20dch
and a
ret
+
+;ret cc
l20c5h:
ld a,(iy+000h)
ld (l20d7h),a
@@ -5844,6 +5834,7 @@ l20d7h:
inc hl
jp (hl)
+;ret
l20dch:
ld a,(b_21e2_start)
and a
@@ -5855,16 +5846,18 @@ l20dch:
pop hl
ret
l20edh:
- ld hl,(reg_sp)
+ ld hl,(reg_sp) ;break on return address
ld e,(hl)
inc hl
ld d,(hl)
ex de,hl
call bp_trace_enter
+;rst 8
l2115h:
and a
ret
+;rst n
l20f9h:
ld a,(l0003h)
cp (iy+000h)
@@ -5890,7 +5883,6 @@ l2113h:
; trace over Calls [No list] [Jumps only] /.While./.Until.
cmd_C:
- ld hl,cmd_C
ld a,1
jr cmd_tc
@@ -5902,7 +5894,6 @@ cmd_C:
cmd_T:
xor a
- ld hl,cmd_T
cmd_tc:
ld (cmd_rpt),hl
ld (trace_call_flag),a
@@ -5939,7 +5930,7 @@ l2151h:
call sub_21c8h
jr z,l216bh
ld hl,b_2048_start
- call lookup_opc
+ call lookup_op
jr nc,l214ch
l216bh:
ld a,(trace_UW_flag) ;0 or 'U' or 'W'