summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2016-08-12 22:39:45 +0200
committerLeo C2016-08-12 22:39:45 +0200
commit4903b8b8b349f34ab8b9a8667ccfe59d1862f428 (patch)
tree3ac3ad92c6d94ec8f00987a4d06c5e0d76d45a79
parent3a4deef923e7cdf53a61035bb58575f8da8045b0 (diff)
downloadddt180-4903b8b8b349f34ab8b9a8667ccfe59d1862f428.zip
Commands B,Y: Print symbols. Command HS: Tabulate symbols
-rw-r--r--Makefile2
-rw-r--r--ddt180.z80155
2 files changed, 116 insertions, 41 deletions
diff --git a/Makefile b/Makefile
index 43e9909..7694f5b 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ SRC := $(PROG).z80
OBJ := $(SRC:.z80=.rel)
-AS_OPT := MF
+AS_OPT := MFS
ASM := zxcc slrz80.com
LINK := zxcc link80.com
diff --git a/ddt180.z80 b/ddt180.z80
index 862dbc2..93df19a 100644
--- a/ddt180.z80
+++ b/ddt180.z80
@@ -1042,6 +1042,7 @@ fact_reg.Y:
call get.decdigit
jr c,error4
inc de
+get_y_val:
add a,a
ld hl,reg_Y
call add_hl_a
@@ -1485,24 +1486,24 @@ l075ah:
cmd_B:
call skipbl
- jr z,l07b7h
+ jr z,bp_print
inc de
cp 'X'
- jr z,l077dh
+ jr z,bp_clr0
dec de
ld a,001h
jp bp_enter
-l077dh:
+bp_clr0:
call skipbl
jr z,bp_clr_all
-l0782h:
+bp_clr_next:
call expr
jp c,assert_eol
push de
call bp_clr
pop de
call next_arg
- jr l0782h
+ jr bp_clr_next
bp_clr_all:
scf
@@ -1526,12 +1527,12 @@ l07aeh:
djnz l0799h
ret
-l07b7h:
+bp_print:
ld b,BP_CNT
ld ix,bp_tab
-l07bdh:
+bp_pr_l:
bit 0,(ix+000h)
- jr z,l0808h
+ jr z,bp_pr_cont
ld a,'R'
bit 4,(ix+000h)
jr nz,l07cdh
@@ -1542,9 +1543,10 @@ l07cdh:
ld l,(ix+002h)
ld h,(ix+003h)
call out.hl.@
- call outbl2
- ld a,':'
- call outchar
+ ld a,82h
+ call p_sym_space
+ call pstr_inl
+ dc ':'
ld l,(ix+004h)
ld h,(ix+005h)
call out_hl
@@ -1560,10 +1562,10 @@ l07cdh:
call pstr
l0805h:
call crlf
-l0808h:
+bp_pr_cont:
ld de,BP_SIZE
add ix,de
- djnz l07bdh
+ djnz bp_pr_l
ret
; Add break points to list
@@ -1575,10 +1577,10 @@ bp_enter:
call skipbl
ret z
cp 'R'
- jr nz,l081ch
+ jr nz,bp_e_1
inc de
set 4,b
-l081ch:
+bp_e_1:
push bc
call expr
jp c,ERROR
@@ -1608,7 +1610,7 @@ l081ch:
bp_get_freeslot:
ld b,BP_CNT
ld ix,bp_tab
-l085ah:
+bp_gf_l:
ld a,(ix+000h)
and 00fh
ret z
@@ -1616,7 +1618,7 @@ l085ah:
ld bc,BP_SIZE
add ix,bc
pop bc
- djnz l085ah
+ djnz bp_gf_l
jp ERROR
bp_get_count:
@@ -1958,7 +1960,11 @@ l0bc3h:
l0bc7h:
push af
call sub_0bdch
- call outbl4
+ pop af
+ push af
+ call get_y_val
+ ld a,82h
+ call p_sym_space
pop af
inc a
bit 0,a
@@ -2383,55 +2389,118 @@ l0e5eh:
call outbl
ld a,l
call out.ascii
- call outbl
- call p_symbol
+ ld a,80h
+ call p_sym_space
jp crlf
p_symbols:
inc de
call assert_eol
ld hl,ddtz_base+2
-psym_l:
+
+ ld a,(symlen_max)
+ add a,8
+ ld b,a
+ ld a,80 ;screen width
+ ld c,-1
+psym_1:
+ inc c
+ sub a,b
+ jr nc,psym_1
+
+psym_nxtline:
+ ld b,c
+psym_nxtcol:
ld d,(hl)
dec hl
ld e,(hl)
dec hl
- ld b,(hl)
- dec hl
- ld a,b
+ ld a,(hl)
+ call sub_hl_a1
cp 0c3h
- ret z
+ jr z,psym_e
ex de,hl
call out_hl
- ex de,hl
call outbl
-psymch_l:
- ld a,(hl)
- dec hl
- call outchar
- djnz psymch_l
+ ld a,3
+ call p_sym_space
+ ex de,hl
+ djnz psym_nxtcol
call crlf
- jr psym_l
+ jr psym_nxtline
+psym_e:
+ ld a,b
+ cp c
+ ret z
+ jp crlf
-p_symbol:
+p_sym_space:
if 0
ld a,(dash_flag)
or a
ret nz
endif
+
+ push hl
+ push bc
+ ld c,a
+ ld a,(con_col)
+ ld b,a
call sym_getname
- ret z
+ jr z,psb_align
+ bit 7,c
+ jr z,psb_nd
+ ld a,' '
+ call outchar
ld a,'.'
call outchar
+psb_nd:
+ call p_symstr
+
+psb_align:
+ ld a,(con_col)
+ sub b
+ ld b,a
+ ld a,(symlen_max)
+ bit 7,c
+ jr z,$+4
+ add a,2
+ res 7,c
+ add c
+ sub b
+ ld b,a
+ jr z,psb_e
+psb_a_l:
+ call outbl
+ djnz psb_a_l
+psb_e:
+ pop bc
+ pop hl
+ ret
+
+
+p_symbol:
+ if 0
+ ld a,(dash_flag)
+ or a
+ ret nz
+ endif
+ call sym_getname
+ ret z
+ call pstr_inl
+ dc ' .'
+
p_symstr:
+ push bc
ld b,(hl)
pss_l:
dec hl
ld a,(hl)
call outchar
djnz pss_l
+ pop bc
ret
p_label:
@@ -2451,6 +2520,7 @@ pl_e:
pop hl
ret
+
sym_getname:
push de
push hl
@@ -3057,12 +3127,11 @@ read_symfile:
dec de
call file_open
-;------------------------------------------------------------------------
rs_1:
call read_byte
rs_2:
cp 1ah
- jr z,p_max_high
+ jp z,p_max_high
cp '!'
jr c,rs_1
call read_hexbyte0
@@ -3127,13 +3196,18 @@ rs_61:
ex de,hl ;
pop de ;
ld (hl),e ; symlen
+ ld a,e
inc hl ;
pop de ; symval
ld (hl),e ;
inc hl ;
ld (hl),d ;
+ ld hl,symlen_max
+ cp (hl)
+ jr c,$+3
+ ld (hl),a
jp rs_1 ;
-;------------------------------------------------------------------------
+
p_max_high0:
call assert_eol
@@ -3233,9 +3307,9 @@ l1211h:
ld de,(var.@)
ld a,d
or e
- ld b,011h
+ ld b,17
jr z,l122dh
- ld b,019h
+ ld b,25
l122dh:
call outbl
ld a,(con_col)
@@ -4424,7 +4498,6 @@ p_disas_line:
call p_disas_instr
and a
ret z
-
l193fh:
call outbl
ld a,(con_col)
@@ -5883,6 +5956,8 @@ l1ffbh:
l1ffdh:
db 0
+symlen_max: ;max length of symbols read so far
+ db 0
cur_fcb:
dw 0
fcbsym: