diff --git a/src/mon_m65/,aliases_mon.s b/src/mon_m65/,aliases_mon.s index 814abeea..d54a3fba 100644 --- a/src/mon_m65/,aliases_mon.s +++ b/src/mon_m65/,aliases_mon.s @@ -59,7 +59,8 @@ !addr Op_Ix = $2E ; type of constant !addr Op_Len = $2F ; length of operand - ; $30-$63 - free space, unused for now + ; $30-$62 - free space, unused for now +!addr Byte_TMP = $63 ; temporary byte !addr Long_TMP = $64 ; temporary pointer, for fetching/storing memory content; has to be the same as Long__TMP in Kernal !addr Mon_Data = $68 ; 40 bytes, buffer for hunt diff --git a/src/mon_m65/bsmon.s b/src/mon_m65/bsmon.s index fae51867..9e29ca4c 100644 --- a/src/mon_m65/bsmon.s +++ b/src/mon_m65/bsmon.s @@ -191,7 +191,7 @@ Jump_Table: !word Mon_Assemble ; A XXX to be debugged/adapted !word Mon_Bits ; B - !word Mon_Compare ; C XXX to be debugged/adapted + !word Mon_Compare ; C !word Mon_Disassemble ; D !word Mon_Fill ; F !word Mon_Go ; G XXX to be debugged/adapted @@ -550,26 +550,6 @@ Dump_Row: PLZ RTS -; ********** -Mon_Compare: -; ********** - - JSR Get_Param_Range ; Long_PC = source - LBCS Mon_Error ; Long_CT = count - JSR Get_LAC ; Long_AC = target - LBCS Mon_Error - JSR Print_CR - LDZ #0 -@loop LDA [Long_PC],Z - CMP [Long_AC],Z - BEQ @laba - JSR Print_LPC_Addr -@laba JSR Inc_LAC - JSR Inc_LPC - JSR Dec_LCT - BPL @loop - JMP Main - ; ******* Mon_Hunt: ; ******* diff --git a/src/mon_m65/mon_command_compare.s b/src/mon_m65/mon_command_compare.s new file mode 100644 index 00000000..c9684d8f --- /dev/null +++ b/src/mon_m65/mon_command_compare.s @@ -0,0 +1,43 @@ + +; Based on BSM (Bit Shifter's Monitor) + + +Mon_Compare: + + jsr Get_Param_Range ; Long_PC = source + +bcs Mon_Error ; Long_CT = count + jsr Get_LAC ; Long_AC = target + +bcs Mon_Error + + lda Src_Addr_Mode + ora Dst_Addr_Mode + sta Src_Addr_Mode + + lda Addr_Mode + sta Dst_Addr_Mode + + jsr Print_CR + ldz #0 + +@loop: + + lda Dst_Addr_Mode + sta Addr_Mode + jsr Get_From_Memory_LAC + sta Byte_TMP + + lda Src_Addr_Mode + sta Addr_Mode + jsr Get_From_Memory_LPC + + cmp Byte_TMP + beq @laba + jsr Print_LPC_Addr + +@laba: + + jsr Inc_LAC + jsr Inc_LPC + jsr Dec_LCT + bpl @loop + jmp Main diff --git a/src/mon_m65/mon_helper_memory.s b/src/mon_m65/mon_helper_memory.s index 5eafd00b..2a840445 100644 --- a/src/mon_m65/mon_helper_memory.s +++ b/src/mon_m65/mon_helper_memory.s @@ -1,6 +1,12 @@ ; Monitor helper code - memory read and write +Get_From_Memory_LAC: + + jsr Exchange_LAC_LPC + jsr Get_From_Memory_LPC + jmp Exchange_LAC_LPC + Get_From_Memory_LDA: jsr Exchange_LDA_LPC