From 2e3122fd000a3b9690496e9ef168db65000c1afd Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sun, 10 Jan 2021 20:27:00 +0100 Subject: [PATCH] monitor command 'D' fully adapted --- src/mon_m65/,aliases_mon.s | 3 +-- src/mon_m65/bsmon.s | 20 +++++++++++--------- src/mon_m65/mon_command_disassemble.s | 15 +++++++-------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/mon_m65/,aliases_mon.s b/src/mon_m65/,aliases_mon.s index 80c6c38d..85b0005e 100644 --- a/src/mon_m65/,aliases_mon.s +++ b/src/mon_m65/,aliases_mon.s @@ -9,8 +9,7 @@ ; ******************** ; * Register storage * ; ******************** - -!addr Bank = 2 ; XXX remove this + !addr Adr_Mode = 2 ; $00 = 64K address, $80 = M65 flat address ; XXX adapt the implementation !addr PCH = 3 !addr PCL = 4 diff --git a/src/mon_m65/bsmon.s b/src/mon_m65/bsmon.s index e9510614..0c223472 100644 --- a/src/mon_m65/bsmon.s +++ b/src/mon_m65/bsmon.s @@ -192,7 +192,7 @@ Jump_Table: !word Mon_Assemble ; A XXX to be debugged/adapted !word Mon_Bits ; B XXX to be debugged/adapted !word Mon_Compare ; C XXX to be debugged/adapted - !word Mon_Disassemble ; D XXX to be debugged/adapted + !word Mon_Disassemble ; D !word Mon_Fill ; F XXX to be debugged/adapted !word Mon_Go ; G XXX to be debugged/adapted !word Mon_Hunt ; H XXX to be debugged/adapted @@ -221,6 +221,8 @@ Mon_Exit: LAC_To_PC: ; XXX to be adapted ; ******** + inc $D020 ; XXX fior debug only + ; called from Mon_Set_Register, Mon_Go and Mon_JSR ; as the first instruction. The carry flag was set from ; the routine Got_LAC if an error occured. @@ -231,12 +233,12 @@ LAC_To_PC: ; XXX to be adapted ; the routines FAR_JMP and FAR_JSR of the operating system BCS @error - LDA Long_AC - STA Bank+2 - LDA Long_AC+1 - STA Bank+1 - LDA Long_AC+2 - STA Bank + ;LDA Long_AC + ;STA Bank+2 + ;LDA Long_AC+1 + ;STA Bank+1 + ;LDA Long_AC+2 + ;STA Bank @error RTS ; ********* @@ -456,7 +458,7 @@ Mon_Bits: JMP Main ; *************** -Mon_Set_Register: +Mon_Set_Register: ; XXX this needs adaptation ; *************** JSR Get_LAC ; get 1st. parameter @@ -465,7 +467,7 @@ Mon_Set_Register: @loop JSR Get_LAC BCS @exit LDA Long_AC - STA Bank,Y + STA Adr_Mode,Y INY CPY #9 BCC @loop diff --git a/src/mon_m65/mon_command_disassemble.s b/src/mon_m65/mon_command_disassemble.s index 40dcb33f..884d7673 100644 --- a/src/mon_m65/mon_command_disassemble.s +++ b/src/mon_m65/mon_command_disassemble.s @@ -3,7 +3,6 @@ Mon_Disassemble: - lda Adr_Mode pha ; store addressing mode, in case no parameter is given lda #$00 sta Adr_Mode ; by default use C64-style addressing @@ -13,25 +12,24 @@ Mon_Disassemble: pla ; drop previous addressing mode jsr LAC_To_LPC ; Long_PC = start address jsr Get_Addr_To_LAC ; get 2nd parameter (end address) - bne @range + beq @norange + jsr LAC_Minus_LPC ; Long_CT = range + +bcc Mon_Error ; -> negative + bra @loop @nopar: pla ; retrieve old addressing mode sta Adr_Mode +@norange: + lda #$20 ; by default disassemble 32 addresses sta Long_CT+0 lda #$00 sta Long_CT+1 sta Long_CT+2 sta Long_CT+3 - bra @loop - -@range: - - jsr LAC_Minus_LPC ; Long_CT = range - +bcc Mon_Error ; -> negative @loop: @@ -47,4 +45,5 @@ Mon_Disassemble: sbc Op_Size sta Long_CT bcs @loop + jmp Main