initial port of monitor 'H' command
This commit is contained in:
1 parent
1474198afd
commit
d6c6b56e33
3 files changed
+84
-50
No files matched your search
+1
-50
@@ -195,7 +195,7 @@ Jump_Table:
|
|||||||
!word Mon_Disassemble ; D
|
!word Mon_Disassemble ; D
|
||||||
!word Mon_Fill ; F
|
!word Mon_Fill ; F
|
||||||
!word Mon_Go ; G XXX to be debugged/adapted
|
!word Mon_Go ; G XXX to be debugged/adapted
|
||||||
!word Mon_Hunt ; H XXX to be debugged/adapted
|
!word Mon_Hunt ; H XXX to be bugfixed
|
||||||
!word Mon_JSR ; J XXX to be debugged/adapted
|
!word Mon_JSR ; J XXX to be debugged/adapted
|
||||||
!word Mon_Memory ; M
|
!word Mon_Memory ; M
|
||||||
!word Mon_Register ; R
|
!word Mon_Register ; R
|
||||||
@@ -550,55 +550,6 @@ Dump_Row:
|
|||||||
PLZ
|
PLZ
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
; *******
|
|
||||||
Mon_Hunt:
|
|
||||||
; *******
|
|
||||||
|
|
||||||
JSR Get_Param_Range ; Long_PC = start
|
|
||||||
LBCS Mon_Error ; Long_CT = count
|
|
||||||
LDY #0
|
|
||||||
JSR Get_Char
|
|
||||||
CMP #KEY_APOSTROPHE
|
|
||||||
BNE @bin
|
|
||||||
JSR Get_Char ; string hunt
|
|
||||||
CMP #0
|
|
||||||
LBEQ Mon_Error ; null string
|
|
||||||
|
|
||||||
@lpstr STA Mon_Data,Y
|
|
||||||
INY
|
|
||||||
JSR Get_Char
|
|
||||||
BEQ @hunt
|
|
||||||
CPY #32 ;max. string length
|
|
||||||
BNE @lpstr
|
|
||||||
BRA @hunt
|
|
||||||
|
|
||||||
@bin JSR Got_LAC
|
|
||||||
@lpbin LDA Long_AC
|
|
||||||
STA Mon_Data,Y
|
|
||||||
INY
|
|
||||||
JSR Get_LAC
|
|
||||||
BCS @hunt
|
|
||||||
CPY #32 ;max. data length
|
|
||||||
BNE @lpbin
|
|
||||||
|
|
||||||
@hunt STY Long_DA ; hunt length
|
|
||||||
JSR Print_CR
|
|
||||||
|
|
||||||
@lpstart LDY #0
|
|
||||||
@lpins JSR Fetch
|
|
||||||
CMP Mon_Data,Y
|
|
||||||
BNE @next
|
|
||||||
INY
|
|
||||||
CPY Long_DA
|
|
||||||
BNE @lpins
|
|
||||||
JSR Print_LPC_Addr ; match
|
|
||||||
@next JSR STOP
|
|
||||||
LBEQ Main
|
|
||||||
JSR Inc_LPC
|
|
||||||
JSR Dec_LCT
|
|
||||||
BPL @lpstart
|
|
||||||
JMP Main
|
|
||||||
|
|
||||||
; ********
|
; ********
|
||||||
Load_Save:
|
Load_Save:
|
||||||
; ********
|
; ********
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
|
||||||
|
; Based on BSM (Bit Shifter's Monitor)
|
||||||
|
|
||||||
|
|
||||||
|
Mon_Hunt:
|
||||||
|
|
||||||
|
jsr Get_Param_Range ; Long_PC = start
|
||||||
|
+bcs Mon_Error ; Long_CT = count
|
||||||
|
|
||||||
|
ldy #$00
|
||||||
|
jsr Get_Char
|
||||||
|
cmp #KEY_APOSTROPHE
|
||||||
|
bne @bin
|
||||||
|
jsr Get_Char ; string hunt
|
||||||
|
cmp #$00
|
||||||
|
+beq Mon_Error ; null string
|
||||||
|
|
||||||
|
@lpstr:
|
||||||
|
|
||||||
|
sta Mon_Data,Y
|
||||||
|
iny
|
||||||
|
jsr Get_Char
|
||||||
|
beq @hunt
|
||||||
|
cpy #32 ; max string length
|
||||||
|
bne @lpstr
|
||||||
|
bra @hunt
|
||||||
|
|
||||||
|
@bin:
|
||||||
|
|
||||||
|
jsr Got_Addr_To_LAC
|
||||||
|
|
||||||
|
@lpbin:
|
||||||
|
|
||||||
|
lda Long_AC
|
||||||
|
sta Mon_Data,Y
|
||||||
|
iny
|
||||||
|
jsr Get_Addr_To_LAC
|
||||||
|
beq @hunt
|
||||||
|
lda Long_AC+1
|
||||||
|
ora Long_AC+2
|
||||||
|
ora Long_AC+3
|
||||||
|
+beq Mon_Error ; value above $FF
|
||||||
|
|
||||||
|
cpy #32 ; max data length
|
||||||
|
bne @lpbin
|
||||||
|
|
||||||
|
@hunt:
|
||||||
|
|
||||||
|
sty Long_DA ; hunt length
|
||||||
|
jsr Print_CR
|
||||||
|
|
||||||
|
@lpstart:
|
||||||
|
|
||||||
|
lda Src_Addr_Mode
|
||||||
|
ora Dst_Addr_Mode
|
||||||
|
sta Addr_Mode ; combined addressing mode
|
||||||
|
|
||||||
|
ldy #$00
|
||||||
|
|
||||||
|
@lpins:
|
||||||
|
|
||||||
|
jsr Fetch
|
||||||
|
cmp Mon_Data,Y
|
||||||
|
bne @next
|
||||||
|
iny
|
||||||
|
cpy Long_DA
|
||||||
|
bne @lpins
|
||||||
|
jsr Print_LPC_Addr ; match
|
||||||
|
|
||||||
|
@next:
|
||||||
|
|
||||||
|
jsr STOP
|
||||||
|
+beq Main
|
||||||
|
jsr Inc_LPC
|
||||||
|
jsr Dec_LCT
|
||||||
|
bpl @lpstart
|
||||||
|
jmp Main
|
||||||
@@ -2,6 +2,12 @@
|
|||||||
; Based on BSM (Bit Shifter's Monitor)
|
; Based on BSM (Bit Shifter's Monitor)
|
||||||
|
|
||||||
|
|
||||||
|
Got_Addr_To_LAC: ; to be used when first byte already fetched
|
||||||
|
|
||||||
|
dec Buf_Index
|
||||||
|
|
||||||
|
; FALLTROUGH
|
||||||
|
|
||||||
Get_Addr_To_LAC:
|
Get_Addr_To_LAC:
|
||||||
|
|
||||||
phx
|
phx
|
||||||
|
|||||||
Reference in new issue
Block a user