CONBUF_SIZE equ 80 ;Size of console input buffer\r
EXPR_BUF_SIZE equ 128 ;expressen buffer for conditional breakpoints\r
BP_CNT equ 12 ;Number of breakpoints\r
-BP_SIZE equ 6 ;Size of a breakpoint record\r
+BP_SIZE equ 4 ;Size of a breakpoint record\r
\r
;-------------------------------------------------------------------------------\r
\r
ld hl,ddtz_base\r
ld l,000h\r
ld (reg_sp),hl\r
+\r
+ ld hl,(1) ;wboot addr\r
+ ld de,?const\r
+ ld b,6\r
+vini_l:\r
+ inc hl\r
+ inc hl\r
+ inc hl\r
+ ex de,hl\r
+ inc hl\r
+ ld (hl),e\r
+ inc hl\r
+ ld (hl),d\r
+ inc hl\r
+ ex de,hl\r
+ djnz vini_l\r
+\r
jr mainloop\r
\r
ds CONBUF_SIZE + 3 - ($ - conbuf)\r
\r
;-------------------------------------------------------------------------------\r
\r
-?const:\r
-?conin:\r
-?cono:\r
- ret\r
+?const: jp 0 ; return console input status\r
+?conin: jp 0 ; return console input character\r
+?cono: jp 0 ; send console output character\r
+?list: jp 0 ; send list output character\r
+?auxo: jp 0 ; send auxiliary output character\r
+?auxi: jp 0 ; return auxiliary input character\r
\r
CMDTAB:\r
dw ERROR ;cmd_@ ;examine/substitute the displacement register @\r
; set breakpoints\r
; > BX\r
; clear all breakpoints\r
-; > BX address [address..]\r
+; > BX breakp [breakp..]\r
; clear breakpoints\r
;\r
-; where breakp is:\r
-; expression\r
+; breakp can be any valid expression\r
\r
cmd_B:\r
call skipbl\r
pop de\r
ld (ix+002h),l\r
ld (ix+003h),h\r
- call bp_get_count\r
- ld (ix+004h),l\r
- ld (ix+005h),h\r
call next_arg\r
pop af\r
ld (ix+000h),a\r
error12\r
jp ERROR\r
\r
-bp_get_count:\r
- call skipbl\r
- ld hl,1\r
- cp ':'\r
- ret nz\r
- inc de\r
- call expr\r
- jr c,error12\r
- ret\r
\r
;-------------------------------------------------------------------------------\r
; Breakpoint handling routine.\r
ld d,(ix+003h)\r
ld hl,(reg.pc)\r
call cp_hl_de\r
- push bc\r
- call z,sub_0942h\r
- pop bc\r
-l0938h:\r
-\r
- call bpl_next\r
- ex af,af'\r
- ret\r
-\r
-sub_0942h:\r
+ jr nz,l0938h\r
ex af,af'\r
res 7,a\r
- ex af,af'\r
- ld e,(ix+004h)\r
- ld d,(ix+005h)\r
- dec de\r
- ld a,d\r
- or e\r
- jr z,l0974h\r
- ld (ix+004h),e\r
- ld (ix+005h),d\r
- ret\r
-l0974h:\r
- ex af,af'\r
or (ix+000h)\r
ex af,af'\r
+l0938h:\r
+ call bpl_next\r
+ ex af,af'\r
ret\r
\r
bp_restore_mem:\r
\r
bp_trace_enter:\r
call bp_get_freeslot\r
- ld (ix+004h),001h\r
- ld (ix+005h),000h\r
ld (ix+002h),l\r
ld (ix+003h),h\r
ld a,(b_21e2_start)\r
call crlf\r
l0e10h:\r
pop bc\r
- inc hl\r
inc de\r
- dec bc\r
- ld a,b\r
- or c\r
- jr nz,l0dedh\r
+ cpi\r
+ jp pe,l0dedh\r
ret\r
\r
;-------------------------------------------------------------------------------\r
-; > M[V] startaddr endaddr destaddr\r
-; Move memory [and verify]\r
+; > M startaddr endaddr destaddr\r
+; Move memory\r
\r
cmd_M:\r
- call get_char_upper\r
- cp 'V'\r
- jr nz,l0e1fh\r
- inc de\r
-l0e1fh:\r
- push af\r
call sub_034eh\r
- push hl\r
- push de\r
- push bc\r
call cp_hl_de\r
jr nc,cmdm_up\r
add hl,bc\r
db 01h ;swallow ldir instruction (ld bc,...)\r
cmdm_up:\r
ldir\r
- pop bc\r
- pop de\r
- pop hl\r
- pop af\r
- jr z,l0dedh\r
ret\r
\r
;-------------------------------------------------------------------------------\r
; Query memory for a byte string [Justified]\r
\r
cmd_Q:\r
- call get_char_upper\r
- sub 'J'\r
- ld (cmd_Q_jopt),a\r
- jr nz,l0e8dh\r
- inc de\r
-l0e8dh:\r
call get_arg_range\r
push bc\r
push hl\r
call sub_0ee6h\r
pop hl\r
l0e96h:\r
- call sub_0ed7h\r
+ push hl\r
+ push de\r
+ push bc\r
+l0edah:\r
+ ld a,(de)\r
+ cp (hl)\r
+ jr nz,l0ee2h\r
+ inc de\r
+ inc hl\r
+ djnz l0edah\r
+l0ee2h:\r
+ pop bc\r
+ pop de\r
+ pop hl\r
jr nz,l0eb0h\r
push bc\r
- push hl\r
- ld a,(cmd_Q_jopt)\r
- or a\r
- jr nz,l0ea7h\r
- ld bc,-8\r
- add hl,bc\r
-l0ea7h:\r
ld bc,16\r
- and a\r
+ and a ;clear carry\r
call sub_0f58h\r
- pop hl\r
pop bc\r
l0eb0h:\r
inc hl\r
pop hl\r
ret\r
\r
-sub_0ed7h:\r
- push hl\r
- push de\r
- push bc\r
-l0edah:\r
- ld a,(de)\r
- cp (hl)\r
- jr nz,l0ee2h\r
- inc de\r
- inc hl\r
- djnz l0edah\r
-l0ee2h:\r
- pop bc\r
- pop de\r
- pop hl\r
- ret\r
-\r
sub_0ee6h:\r
ld hl,conbuf+1\r
call sub_0ef7h\r
ret nz\r
jp ERROR\r
\r
-sub_0ef7h:\r
- db 0e6h ; and 037h (clear carry)\r
-sub_0ef8h:\r
+sub_0ef7h: ;from cmd_Q, cmd_Z\r
+ db 0e6h ;and 037h (clear carry)\r
+sub_0ef8h: ;from cmd_S\r
scf\r
l0ef9h:\r
push af\r
call next_arg\r
- cp 'W'\r
- jr nz,l0f0eh\r
- inc de\r
- push hl\r
- call sub_035dh\r
- ex de,hl\r
- ex (sp),hl\r
- ld (hl),e\r
- inc hl\r
- ld a,d\r
- pop de\r
- jr l0f1ah\r
-l0f0eh:\r
cp ''''\r
jr z,l0f1eh\r
push hl\r
push af\r
l0f5ch:\r
call out_hl\r
- call z,outbl2\r
- call outbl\r
+ call outbl2\r
ld de,0\r
l0f68h:\r
ld a,(hl)\r
ld de,BDOS\r
and a\r
sbc hl,de\r
- ld hl,l20edh\r
+ ld hl,l20edh ;set break after BDOS call\r
jr z,l2031h\r
ld iy,(reg.pc)\r
call disas_get_instrlen\r
\r
l20dch:\r
l20edh:\r
- ld hl,(reg_sp)\r
+ ld hl,(reg_sp) ;break on return address\r
ld e,(hl)\r
inc hl\r
ld d,(hl)\r
last_O_val:\r
db 0\r
\r
-cmd_Q_jopt:\r
- db -1\r
-\r
last_D:\r
dw TPA\r
\r