summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2016-08-11 16:25:49 +0200
committerLeo C2016-08-11 16:25:49 +0200
commit3f9577cdb9cd98760758b6318cfea767da850974 (patch)
treedb7bd871d1b915da53c31bb322005215e4930133
parentac35765efd1937a9ddb97405b06ce6d9052171ee (diff)
downloadddt180-3f9577cdb9cd98760758b6318cfea767da850974.zip
Command HS (H extension): print symbol table. Commands A,L: Print labels.
-rw-r--r--ddt180.z80103
1 files changed, 101 insertions, 2 deletions
diff --git a/ddt180.z80 b/ddt180.z80
index 0d78e82..85e3705 100644
--- a/ddt180.z80
+++ b/ddt180.z80
@@ -330,6 +330,7 @@ l01bfh:
pop hl
pop de
ret
+
out.bin.w:
ld a,h
call out.bin.b
@@ -2266,7 +2267,7 @@ l0e1fh:
push de
push bc
call cp_hl_de
- jr nc,$+11
+ jr nc,cmdm_up
add hl,bc
ex de,hl
add hl,bc
@@ -2274,7 +2275,9 @@ l0e1fh:
dec hl
dec de
lddr
- ld bc,0b0edh
+ db 01h ;swallow ldir instruction (ld bc,...)
+cmdm_up:
+ ldir
pop bc
pop de
pop hl
@@ -2283,6 +2286,10 @@ l0e1fh:
ret
cmd_H:
+ ld a,(de)
+ cp 'S'
+ jr z,p_symbols
+
call expr
jp c,p_max_high0
call next_arg
@@ -2317,6 +2324,96 @@ l0e5eh:
call out.ascii
jp crlf
+p_symbols:
+ inc de
+ call assert_eol
+ ld hl,ddtz_base+2
+psym_l:
+ ld d,(hl)
+ dec hl
+ ld e,(hl)
+ dec hl
+ ld b,(hl)
+ dec hl
+ ld a,b
+ cp 10h
+ ret nc
+
+ ex de,hl
+ call out_hl
+ ex de,hl
+ call outbl
+psymch_l:
+ ld a,(hl)
+ dec hl
+ call outchar
+ djnz psymch_l
+ call crlf
+ jr psym_l
+
+p_symstr:
+ ld b,(hl)
+pss_l:
+ dec hl
+ ld a,(hl)
+ call outchar
+ djnz pss_l
+ ret
+
+
+p_label:
+ if 0
+ ld a,(dash_flag)
+ or a
+ ret nz
+ endif
+ push hl
+ call sym_getname
+ jr z,pl_e
+ call p_symstr
+ ld a,':'
+ call outchar
+ call crlf
+pl_e:
+ pop hl
+ ret
+
+sym_getname:
+ push de
+ push hl
+ ld hl,ddtz_base+2
+sgn_l:
+ ld d,(hl)
+ dec hl
+ ld e,(hl)
+ dec hl
+ ld a,(hl)
+ cp 0c3h
+ jr z,sgn_e
+
+ ex (sp),hl
+ call cp_hl_de
+ jr z,sgn_e
+ ex (sp),hl
+ call sub_hl_a1
+ jr sgn_l
+sgn_e:
+ sub 0c3h
+ pop hl
+ pop de
+ ret
+
+sub_hl_a1:
+ dec hl
+sub_hl_a:
+ push bc
+ ld c,a
+ ld b,0
+ or a
+ sbc hl,bc
+ pop bc
+ ret
+
cmd_Q:
ld a,(de)
sub 'J'
@@ -4240,6 +4337,8 @@ l190fh:
jr l190fh
p_disas_line:
+ call p_label
+ call outbl2
call out.hl.@
call z,outbl
call outbl