X-Git-Url: http://cloudbase.mooo.com/gitweb/ddt180.git/blobdiff_plain/d0ff7c76b85c1d1f7e76672462c0ba85861ab9b3..3628b07486563949246f6e30ef479e3db86b5c4b:/ddt180.z80 diff --git a/ddt180.z80 b/ddt180.z80 index da5cfe6..2763329 100644 --- a/ddt180.z80 +++ b/ddt180.z80 @@ -62,7 +62,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 8 ;Size of a breakpoint record +BP_SIZE equ 6 ;Size of a breakpoint record ;------------------------------------------------------------------------------- @@ -171,7 +171,7 @@ CMDTAB: dw ERROR ;cmd_@ ;examine/substitute the displacement register @ dw ERROR ;cmd_A ;Assemble dw cmd_B ;Breakpoints display/set/clear - dw cmd_C ;trace over Calls + dw ERROR ;cmd_C ;trace over Calls dw cmd_D ;Display memory in hex and ascii dw ERROR ; dw cmd_F ;specify Filename and command line @@ -232,7 +232,6 @@ mainloop: inc hl ld h,(hl) ld l,a - exe_hl: jp (hl) @@ -1325,7 +1324,6 @@ b_0709_start: cmd_G: sub a - ld (trace_call_flag),a ld (bp_p_cpu_flag),a call expr jr c,l0740h @@ -1370,7 +1368,6 @@ bp_clr_temporary: ld a,(ix+000h) and 0f1h ld (ix+000h),a - call bp_clr_condition call bpl_next ret @@ -1386,7 +1383,7 @@ bp_clr_temporary: ; clear breakpoints ; ; where breakp is: -; [R] expression [I condition] +; expression cmd_B: call skipbl @@ -1423,45 +1420,27 @@ bp_clr: jr nz,l07aeh l07a7h: ld (ix+000h),000h - call bp_clr_condition l07aeh: pop af call bpl_next ret bp_print: + ld c,0 call bpl_init bit 0,(ix+000h) jr z,bp_pr_cont - ld a,'R' - bit 4,(ix+000h) - jr nz,l07cdh - ld a,' ' -l07cdh: - call outchar - call outbl ld l,(ix+002h) ld h,(ix+003h) call out_hl - call pstr_inl - dc ' :' - ld l,(ix+004h) - ld h,(ix+005h) - call out_hl - ld l,(ix+006h) - ld h,(ix+007h) - ld a,h - or l - jr z,l0805h - call outbl4 - call pstr_inl - dc 'I ' - call pstr -l0805h: - call crlf + call outbl2 + inc c bp_pr_cont: call bpl_next + ld a,c + or a + call nz,crlf ret ;------------------------------------------------------------------------------- @@ -1473,11 +1452,7 @@ bp_enter: ld b,a call skipbl ret z - cp 'R' - jr nz,bp_e_1 - inc de - set 4,b -bp_e_1: + push bc call expr jr c,error12 @@ -1495,9 +1470,6 @@ bp_e_1: call bp_get_count ld (ix+004h),l ld (ix+005h),h - call bp_get_condition - ld (ix+006h),l - ld (ix+007h),h call next_arg pop af ld (ix+000h),a @@ -1525,39 +1497,6 @@ bp_get_count: jr c,error12 ret -bp_get_condition: - call skipbl - cp 'I' - ld hl,0 - ret nz - inc de - call skipbl - push de - call expr - jr c,error12 - ex de,hl - pop de - push de - sbc hl,de - ld b,h - ld c,l - ld hl,(expr_p1) - push hl - add hl,bc - ld de,expr_bufe - call cp_hl_de - jr nc,error12 - pop de - pop hl - push de - ldir - ex de,hl - ld (hl),c ; trailing 0 - inc hl - ld (expr_p1),hl - pop hl - ret - ;------------------------------------------------------------------------------- ; Breakpoint handling routine. @@ -1637,15 +1576,6 @@ sub_0942h: ex af,af' res 7,a ex af,af' - ld e,(ix+006h) - ld d,(ix+007h) - ld a,d - or e - ld hl,0ffffh - call nz,expr - ld a,h - or l - jr z,l0969h ld e,(ix+004h) ld d,(ix+005h) dec de @@ -1654,11 +1584,6 @@ sub_0942h: jr z,l0974h ld (ix+004h),e ld (ix+005h),d -l0969h: - bit 4,(ix+000h) - ret z - ld a,001h - ld (bp_p_cpu_flag),a ret l0974h: ex af,af' @@ -1708,8 +1633,6 @@ bp_trace_enter: ld (ix+005h),000h ld (ix+002h),l ld (ix+003h),h - ld (ix+006h),000h - ld (ix+007h),000h ld a,(b_21e2_start) and a ld a,008h @@ -1781,60 +1704,6 @@ l0a41h: ld sp,(reg_sp) jp reg.iff -;------------------------------------------------------------------------------- - -bp_clr_condition: - ld a,(ix+000h) - and 003h - ret nz - ld e,(ix+006h) - ld d,(ix+007h) - ld a,d - or e - ret z - push bc - ld h,d - ld l,e - sub a - ld (ix+006h),a - ld (ix+007h),a - ld bc,0ffffh - cpir -l0a7dh: - push de - ld de,(expr_p1) - call cp_hl_de - pop de - jr nc,l0a93h - call sub_0a99h -l0a8bh: - ld a,(hl) - ldi - and a - jr nz,l0a8bh - jr l0a7dh -l0a93h: - ld (expr_p1),de - pop bc - ret - -sub_0a99h: - ld iy,bp_tab - push de -l0a9eh: - ld e,(iy+006h) - ld d,(iy+007h) - call cp_hl_de - jr z,l0ab0h - ld de,BP_SIZE - add iy,de - jr l0a9eh -l0ab0h: - pop de - ld (iy+006h),e - ld (iy+007h),d - ret - ;------------------------------------------------------------------------------- ; > Y ; examine all Y variables @@ -1865,7 +1734,6 @@ cmd_X: ex de,hl ld hl,t_reg_names call sel_dc_string -l0c12h: call l0c33h call outbl @@ -4045,12 +3913,6 @@ b_2048_start: ;------------------------------------------------------------------------------- ; call mn call cc,mn l2080h: - ld a,(b_21e2_start) - and a - jr nz,l208bh - ld a,(trace_call_flag) - and a - ret nz ; jp mn jp cc,mn l208bh: @@ -4120,15 +3982,6 @@ l20d7h: jp (hl) l20dch: - ld a,(b_21e2_start) - and a - jr nz,l20edh - ld a,(trace_call_flag) - and a - jr z,l20edh - call l20edh - pop hl - ret l20edh: ld hl,(reg_sp) ld e,(hl) @@ -4150,11 +4003,8 @@ l20f9h: ld h,000h ld a,(b_21e2_start) and a - jr nz,l2113h - ld a,(trace_call_flag) - and a - ret nz -l2113h: + ret z + scf ret @@ -4164,9 +4014,6 @@ l2113h: ; >>C[N][J] U expression ; trace over Calls [No list] [Jumps only] /.While./.Until. -cmd_C: - ld a,1 - jr cmd_tc ;------------------------------------------------------------------------------- ; >>T[N][J] [steps] @@ -4175,118 +4022,31 @@ cmd_C: ; Trace [no List] [Jumps only] / .While. / .Until. cmd_T: - xor a -cmd_tc: ld (cmd_rpt),hl - ld (trace_call_flag),a - call get_char_upper - sub 'N' - jr nz,tc_non - inc de -tc_non: - ld (trace_N_flag),a - call get_char_upper - sub 'J' - jr nz,tc_noj - inc de -tc_noj: - ld (trace_J_flag),a - call tc_chk_u_or_w - jr z,tc_save_uw_expr_ptr ld hl,1 ;default: 1 step call get_lastarg_def -tc_save_uw_expr_ptr: ld (trace_cnt_or_ptr),hl sub a ld (bp_p_cpu_flag),a -l214ch: call tc_set_bp jr user_go1 l2151h: call bp_clr_temporary - ld a,(trace_J_flag) - and a - jr nz,l216bh - ld iy,(reg.pc) - call sub_21c8h - jr z,l216bh - ld hl,b_2048_start - call lookup_opc - jr nc,l214ch -l216bh: - ld a,(trace_UW_flag) ;0 or 'U' or 'W' - and a - jr z,tc_cnt ;flag is 0, check for step count. - ld de,(trace_cnt_or_ptr) - call expr - ld a,h - or l - add a,0ffh - sbc a,a - ld hl,trace_UW_flag ;'U' or 'W' - xor (hl) - bit 1,a ;'U' = 55H, 'W' = 57H - jr z,l2193h -do_break0: ;print registers and go to main loop - jp do_break - -tc_cnt: ld hl,(trace_cnt_or_ptr) dec hl ld (trace_cnt_or_ptr),hl ld a,h or l - jr z,do_break0 -l2193h: + jp z,do_break + call tc_set_bp - jr nc,do_break0 - ld a,(trace_N_flag) - ld b,a - ld a,(bp_p_cpu_flag) - or b + jp nc,do_break + sbc a,a ld (bp_p_cpu_flag),a user_go1: jp user_go -tc_chk_u_or_w: - call skipbl - xor a - ld (trace_UW_flag),a - call get_char_upper - cp 'U' - jr z,l21b5h - cp 'W' - ret nz -l21b5h: - inc de - push af - push de - call expr - jp c,ERROR - call assert_eol - pop hl - pop af - ld (trace_UW_flag),a - sub a - ret - -sub_21c8h: - ld a,(iy+000h) - cp 0edh - jr z,l21dah - and 0dfh - cp 0ddh - ret nz - ld a,(iy+001h) - cp 0e9h - ret -l21dah: - ld a,(iy+001h) - and 0f7h - cp 045h - ret - ;------------------------------------------------------------------------------- con_col: @@ -4296,16 +4056,8 @@ con_col: b_21e2_start: db 0 -trace_call_flag: - db 0 ;1=call, 0=trace -trace_UW_flag: - db 0 ;0 or 'U' or 'W' trace_cnt_or_ptr: dw 0 -trace_N_flag: - db 0 ;0 if 'N' -trace_J_flag: - db 0 ;0 if 'J' bp_p_cpu_flag: db 0 @@ -4317,9 +4069,6 @@ bp_tab: endm endm -expr_p1: - dw expr_buf - expr_buf: current_cseg defl $ - current_cseg .phase current_phase + current_cseg