EXPR_BUF_SIZE equ 128 ;expressen buffer for conditional breakpoints\r
BP_CNT equ 12 ;Number of breakpoints\r
BP_SIZE equ 8 ;Size of a breakpoint record\r
-YREG_CNT equ 10 ;Number of Y registers (0..9)\r
\r
;-------------------------------------------------------------------------------\r
\r
var.$: dw 0000h\r
var.@: dw 0\r
\r
-error_func:dw p_msg_error\r
cmd_rpt:dw mainloop\r
\r
;-------------------------------------------------------------------------------\r
dw cmd_V ;Verify (compare) two memory areas\r
dw cmd_W ;Write a file to disk\r
dw cmd_X ;eXamine [and substitute] registers\r
- dw cmd_Y ;examine [and substitute] Y variables\r
+ dw ERROR ;cmd_Y ;examine [and substitute] Y variables\r
dw cmd_Z ;Zap (fill) memory with a byte string\r
\r
+ERROR:\r
+p_msg_error:\r
+ call pstr_inl\r
+ dc '?',CR,LF\r
+ ;fall thru\r
mainloop:\r
ld sp,stack\r
- ld hl,p_msg_error\r
- ld (error_func),hl\r
ld hl,(reg.pc)\r
ld (var.$),hl\r
call bp_clr_temporary\r
inc hl\r
ld h,(hl)\r
ld l,a\r
- jr exe_hl\r
\r
-ERROR:\r
- ld hl,(error_func)\r
exe_hl:\r
call CALL_HL\r
jr mainloop\r
\r
;-------------------------------------------------------------------------------\r
\r
-p_msg_error:\r
- call pstr_inl\r
- dc '?'\r
- ;fall thru\r
crlf:\r
call pstr_inl\r
- db CR,LF+80h\r
+ dc CR,LF\r
call inchar\r
ld a,0\r
ld (con_col),a\r
jr z,fact_factor\r
cp '^'\r
jr z,fact_reg.CPU\r
- cp 'Y'\r
- jr z,fact_reg.Y\r
cp '('\r
jr z,fact_mem\r
cp '['\r
\r
;-------------------------------------------------------------------------------\r
\r
-fact_reg.Y:\r
- call get.decdigit\r
- jr c,error1\r
- inc de\r
-get_y_val:\r
- add a,a\r
- ld hl,reg_Y\r
- call add_hl_a\r
- ld a,(hl)\r
- inc hl\r
- ld h,(hl)\r
- ld l,a\r
- and a\r
- ret\r
-\r
fact_factstring:\r
ld hl,0\r
l054bh:\r
; > Y[0..9]\r
; examine (and substitute) an Y variable\r
\r
-cmd_Y:\r
- call get.decdigit\r
- jr c,l0bc3h\r
- inc de\r
- push af\r
- call assert_eol\r
- pop af\r
- call sub_0bdch\r
- jp l0c15h\r
-l0bc3h:\r
- call assert_eol\r
- xor a\r
-l0bc7h:\r
- push af\r
- call sub_0bdch\r
- call outbl4\r
- pop af\r
- inc a\r
- bit 0,a\r
- push af\r
- call z,crlf\r
- pop af\r
- cp YREG_CNT\r
- jr c,l0bc7h\r
- ret\r
-\r
-sub_0bdch:\r
- ld c,a\r
- ld b,0\r
- add a,'0'+080h\r
- ld de,msg_Y+1\r
- ld (de),a\r
- dec de\r
- ld hl,reg_Y\r
- add hl,bc\r
- add hl,bc\r
- ex de,hl\r
- ld c,003h\r
- jp l0c33h\r
\r
;-------------------------------------------------------------------------------\r
; > X\r
pop hl\r
jp p_max_high\r
\r
-\r
-test_numeral:\r
- cp '9'\r
- ret z\r
- ccf\r
- ret c\r
- cp '0'\r
- ret\r
-\r
test_whitespace:\r
cp ' '\r
ret z\r
\r
;-------------------------------------------------------------------------------\r
\r
-msg_Y:\r
- dc 'Yn'\r
-reg_Y:\r
- rept YREG_CNT\r
- dw 0\r
- endm\r
-\r
last_S:\r
dw TPA\r
\r