X-Git-Url: http://cloudbase.mooo.com/gitweb/ddt180.git/blobdiff_plain/b5b85b4cb3bbddbeb2726bad4666b7d012bf61f2..c18ba81991314d10f95b00051fd1e3fbcebc8e48:/ddt180.z80 diff --git a/ddt180.z80 b/ddt180.z80 index 235e469..3a445c3 100644 --- a/ddt180.z80 +++ b/ddt180.z80 @@ -51,7 +51,7 @@ STACK_SIZE equ 80 ;ddtz internal stack CONBUF_SIZE equ 80 ;Size of console input buffer EXPR_BUF_SIZE equ 128 ;expressen buffer for conditional breakpoints BP_CNT equ 12 ;Number of breakpoints -BP_SIZE equ 6 ;Size of a breakpoint record +BP_SIZE equ 4 ;Size of a breakpoint record ;------------------------------------------------------------------------------- @@ -146,16 +146,35 @@ l0093h: ld hl,ddtz_base ld l,000h ld (reg_sp),hl + + ld hl,(1) ;wboot addr + ld de,?const + ld b,6 +vini_l: + inc hl + inc hl + inc hl + ex de,hl + inc hl + ld (hl),e + inc hl + ld (hl),d + inc hl + ex de,hl + djnz vini_l + jr mainloop ds CONBUF_SIZE + 3 - ($ - conbuf) ;------------------------------------------------------------------------------- -?const: -?conin: -?cono: - ret +?const: jp 0 ; return console input status +?conin: jp 0 ; return console input character +?cono: jp 0 ; send console output character +?list: jp 0 ; send list output character +?auxo: jp 0 ; send auxiliary output character +?auxi: jp 0 ; return auxiliary input character CMDTAB: dw ERROR ;cmd_@ ;examine/substitute the displacement register @ @@ -1443,11 +1462,10 @@ bp_clr_temporary: ; set breakpoints ; > BX ; clear all breakpoints -; > BX address [address..] +; > BX breakp [breakp..] ; clear breakpoints ; -; where breakp is: -; expression +; breakp can be any valid expression cmd_B: call skipbl @@ -1531,9 +1549,6 @@ bp_enter: pop de ld (ix+002h),l ld (ix+003h),h - call bp_get_count - ld (ix+004h),l - ld (ix+005h),h call next_arg pop af ld (ix+000h),a @@ -1551,15 +1566,6 @@ bp_get_freeslot: error12 jp ERROR -bp_get_count: - call skipbl - ld hl,1 - cp ':' - ret nz - inc de - call expr - jr c,error12 - ret ;------------------------------------------------------------------------------- ; Breakpoint handling routine. @@ -1627,32 +1633,14 @@ sub_0913h: ld d,(ix+003h) ld hl,(reg.pc) call cp_hl_de - push bc - call z,sub_0942h - pop bc -l0938h: - - call bpl_next - ex af,af' - ret - -sub_0942h: + jr nz,l0938h ex af,af' res 7,a - ex af,af' - ld e,(ix+004h) - ld d,(ix+005h) - dec de - ld a,d - or e - jr z,l0974h - ld (ix+004h),e - ld (ix+005h),d - ret -l0974h: - ex af,af' or (ix+000h) ex af,af' +l0938h: + call bpl_next + ex af,af' ret bp_restore_mem: @@ -1693,8 +1681,6 @@ bp_tst_e: bp_trace_enter: call bp_get_freeslot - ld (ix+004h),001h - ld (ix+005h),000h ld (ix+002h),l ld (ix+003h),h ld a,(b_21e2_start) @@ -2120,29 +2106,17 @@ 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 ;------------------------------------------------------------------------------- -; > M[V] startaddr endaddr destaddr -; Move memory [and verify] +; > M startaddr endaddr destaddr +; Move memory cmd_M: - call get_char_upper - cp 'V' - jr nz,l0e1fh - inc de -l0e1fh: - push af call sub_034eh - push hl - push de - push bc call cp_hl_de jr nc,cmdm_up add hl,bc @@ -2155,11 +2129,6 @@ l0e1fh: db 01h ;swallow ldir instruction (ld bc,...) cmdm_up: ldir - pop bc - pop de - pop hl - pop af - jr z,l0dedh ret ;------------------------------------------------------------------------------- @@ -2192,32 +2161,31 @@ cmd_H: ; Query memory for a byte string [Justified] cmd_Q: - call get_char_upper - sub 'J' - ld (cmd_Q_jopt),a - jr nz,l0e8dh - inc de -l0e8dh: call get_arg_range push bc push hl call sub_0ee6h pop hl l0e96h: - call sub_0ed7h + push hl + push de + push bc +l0edah: + ld a,(de) + cp (hl) + jr nz,l0ee2h + inc de + inc hl + djnz l0edah +l0ee2h: + pop bc + pop de + pop hl jr nz,l0eb0h push bc - push hl - ld a,(cmd_Q_jopt) - or a - jr nz,l0ea7h - ld bc,-8 - add hl,bc -l0ea7h: ld bc,16 - and a + and a ;clear carry call sub_0f58h - pop hl pop bc l0eb0h: inc hl @@ -2256,23 +2224,6 @@ l0ed3h: pop hl ret -sub_0ed7h: - push hl - push de - push bc -l0edah: - ld a,(de) - cp (hl) - jr nz,l0ee2h - inc de - inc hl - djnz l0edah -l0ee2h: - pop bc - pop de - pop hl - ret - sub_0ee6h: ld hl,conbuf+1 call sub_0ef7h @@ -2283,26 +2234,13 @@ sub_0ee6h: ret nz jp ERROR -sub_0ef7h: - db 0e6h ; and 037h (clear carry) -sub_0ef8h: +sub_0ef7h: ;from cmd_Q, cmd_Z + db 0e6h ;and 037h (clear carry) +sub_0ef8h: ;from cmd_S scf l0ef9h: push af call next_arg - cp 'W' - jr nz,l0f0eh - inc de - push hl - call sub_035dh - ex de,hl - ex (sp),hl - ld (hl),e - inc hl - ld a,d - pop de - jr l0f1ah -l0f0eh: cp '''' jr z,l0f1eh push hl @@ -2364,8 +2302,7 @@ sub_0f58h: push af l0f5ch: call out_hl - call z,outbl2 - call outbl + call outbl2 ld de,0 l0f68h: ld a,(hl) @@ -3627,7 +3564,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 @@ -3758,7 +3695,7 @@ l20d7h: l20dch: l20edh: - ld hl,(reg_sp) + ld hl,(reg_sp) ;break on return address ld e,(hl) inc hl ld d,(hl) @@ -3942,9 +3879,6 @@ last_O_addr: last_O_val: db 0 -cmd_Q_jopt: - db -1 - last_D: dw TPA