summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2016-08-21 00:06:42 +0200
committerLeo C2016-08-21 00:06:42 +0200
commit1bfdbe14f09905742a60bd9b7cdca9a711535512 (patch)
tree5acea20f8d01602f15e0458b0676578d19698199
parent1d3941c8ac130b6dcf7951cb13c0b8c8e46a8e11 (diff)
downloadddt180-1bfdbe14f09905742a60bd9b7cdca9a711535512.zip
Save some bytes in breakpoint handling routines
-rw-r--r--ddt180.z80115
1 files changed, 60 insertions, 55 deletions
diff --git a/ddt180.z80 b/ddt180.z80
index 8e3ad31..3222ea6 100644
--- a/ddt180.z80
+++ b/ddt180.z80
@@ -1315,7 +1315,7 @@ l05dbh:
jr next_bindigit
l05e4h:
cp '"'
- jp nz,ERROR
+ jr nz,error11
call get.bindigit
jr nc,l05dbh
or a
@@ -1340,6 +1340,7 @@ next_decdigit:
decnum_done:
cp '.'
ret z
+error11:
jp ERROR
sub_060ch:
@@ -1540,17 +1541,35 @@ l0740h:
call bp_enter
jp user_go
+
+bpl_init:
+ ld b,BP_CNT
+ ld ix,bp_tab
+ ex (sp),hl
+ ld (pbl_loop_adr),hl
+ ex (sp),hl
+ ret
+
+bpl_next:
+ ld de,BP_SIZE
+ add ix,de
+ dec b
+ ret z
+
+ ex (sp),hl
+ ld hl,(pbl_loop_adr)
+ ex (sp),hl
+ ret
+
bp_clr_temporary:
- ld b,BP_CNT
- ld ix,bp_tab
-l075ah:
+ call bpl_init
+
ld a,(ix+000h)
and 0f1h
ld (ix+000h),a
call bp_clr_condition
- ld de,BP_SIZE
- add ix,de
- djnz l075ah
+
+ call bpl_next
ret
cmd_B:
@@ -1577,9 +1596,8 @@ bp_clr_next:
bp_clr_all:
scf
bp_clr:
- ld b,BP_CNT
- ld ix,bp_tab
-l0799h:
+ call bpl_init
+
push af
jr c,l07a7h
ld e,(ix+002h)
@@ -1590,16 +1608,13 @@ l07a7h:
ld (ix+000h),000h
call bp_clr_condition
l07aeh:
- ld de,BP_SIZE
- add ix,de
pop af
- djnz l0799h
+ call bpl_next
ret
bp_print:
- ld b,BP_CNT
- ld ix,bp_tab
-bp_pr_l:
+ call bpl_init
+
bit 0,(ix+000h)
jr z,bp_pr_cont
ld a,'R'
@@ -1633,9 +1648,7 @@ l07cdh:
l0805h:
call crlf
bp_pr_cont:
- ld de,BP_SIZE
- add ix,de
- djnz bp_pr_l
+ call bpl_next
ret
; Add break points to list
@@ -1653,7 +1666,7 @@ bp_enter:
bp_e_1:
push bc
call expr
- jp c,ERROR
+ jr c,error12
pop bc
bit 0,b
push bc
@@ -1678,17 +1691,14 @@ bp_e_1:
jr bp_enter
bp_get_freeslot:
- ld b,BP_CNT
- ld ix,bp_tab
-bp_gf_l:
+ call bpl_init
+
ld a,(ix+000h)
and 00fh
ret z
- push bc
- ld bc,BP_SIZE
- add ix,bc
- pop bc
- djnz bp_gf_l
+
+ call bpl_next
+error12
jp ERROR
bp_get_count:
@@ -1698,7 +1708,7 @@ bp_get_count:
ret nz
inc de
call expr
- jp c,ERROR
+ jr c,error12
ret
bp_get_condition:
@@ -1710,7 +1720,7 @@ bp_get_condition:
call skipbl
push de
call expr
- jp c,ERROR
+ jr c,error12
ex de,hl
pop de
push de
@@ -1722,7 +1732,7 @@ bp_get_condition:
add hl,bc
ld de,expr_bufe
call cp_hl_de
- jp nc,ERROR
+ jr nc,error12
pop hl
ld (expr_p2),hl
pop de
@@ -1790,9 +1800,8 @@ sub_0913h:
ex af,af'
sub a
ld (l0941h),a
- ld b,BP_CNT
- ld ix,bp_tab
-l0920h:
+ call bpl_init
+
ld a,(ix+000h)
and 007h
jr z,l0938h
@@ -1804,9 +1813,8 @@ l0920h:
call z,sub_0942h
pop bc
l0938h:
- ld de,BP_SIZE
- add ix,de
- djnz l0920h
+
+ call bpl_next
ex af,af'
ret
@@ -1844,9 +1852,8 @@ l0974h:
ret
sub_097ah:
- ld b,BP_CNT
- ld ix,bp_tab
-l0980h:
+ call bpl_init
+
bit 5,(ix+000h)
res 5,(ix+000h)
jr z,l099ah
@@ -1859,15 +1866,13 @@ l0980h:
ld (hl),a
l099ah:
res 3,(ix+000h)
- ld de,BP_SIZE
- add ix,de
- djnz l0980h
+
+ call bpl_next
ret
sub_09a6h:
- ld b,BP_CNT
- ld ix,bp_tab
-l09ach:
+ call bpl_init
+
ld a,(ix+000h)
and 003h
jr z,l09c0h
@@ -1877,9 +1882,8 @@ l09ach:
call cp_hl_de
ret z
l09c0h:
- ld de,BP_SIZE
- add ix,de
- djnz l09ach
+
+ call bpl_next
sub a
inc a
ret
@@ -1902,9 +1906,8 @@ l09edh:
ret
bp_set_to_mem:
- ld b,BP_CNT
- ld ix,bp_tab
-l09f7h:
+ call bpl_init
+
ld a,(ix+000h)
and c
jr z,l0a1dh
@@ -1925,9 +1928,8 @@ l09f7h:
inc hl
ld (hl),d
l0a1dh:
- ld de,BP_SIZE
- add ix,de
- djnz l09f7h
+
+ call bpl_next
ret
user_go:
@@ -5982,6 +5984,9 @@ disas_arg_16:
disas_argtype:
db 0
+pbl_loop_adr:
+ dw 0
+
symlen_cur: ;max length of symbols read so far
db 0
cur_fcb: