"The Wizard of Oz" wrote in message news:pan.2004.08.26.20.49.25.483509@emeraldcity.gov... > Quick question... First off I managed to do this 10 years ago and can't > find the program source. It must be on a dead hard drive. > > I want to be able to access the RAMRD and RAMWT switches from assembler. > I'm using 8bit Merlin (thanks for the manual Bill). According to an older > //e manual I have, the only thing I have to do is make sure 80STORE is > off. Regardless of the settings of 80STORE when I do a "STA RAMRD" > followed by a "LDA (somezeropage),Y" it looks as though there is a branch > occurs into page 1. Specifically into an area I have for tables. Has > anybody encountered this? Also can someone provide me with a quick code > segment they use to get these switches working. (FYI, I'm writing the > program on a ROM 03 GS and testing it on a ROM 01 GS with the eventual > users being //e and //c folks.) > > This was going to be the last subroutine for the utility, but I just > thought of another useful one. I've been working on this for 8 - 10 months > and I really want to finish up. > > Later > Mike READAUX EQU $C003 READMAIN EQU $C002 WRTAUX EQU $C005 WRTMAIN EQU $C004 AUXZP EQU $C009 MAINZP EQU $C008 ORG $100 ;DANGER USING 35 BYTES OF STACK MEMORY STA MAINZP ;USE MAIN MEMORY ZERO PAGE AND STACK LDA #0 STA $F0 LDA #$10 STA $F1 ;BASE ADDRESS $1000 LDA #$AA STA WRTAUX ;AUXMEM WRITE ACTIVE STA $10FF ;STORE $AA IN AUXMEM LOCATION $10FF STA WRTMAIN ;EVERYTHING IN MAIN AGAIN STA READAUX ;READING AUXRAM LDA #0 ;ZERO ACCUMULATOR LDY #$FF LDA ($F0),Y ;READ AUXMEM LOCATION $10FF STA READMAIN ;EVERYTHING IN MAIN, A CONTAINS $AA BRK Notice I used stack memory.... If you have plenty of memory to play with the easiest thing to do would be to copy your read aux routine to auxmem. When you trigger the read aux switch the 6502 will get its next byte (instruction) from the auxmemory. If I had assembled the above at $300 I could add a read main ,write aux and copy the LDA #0 ;ZERO ACCUMULATOR LDY #$FF LDA ($F0),Y ;READ AUXMEM LOCATION $10FF STA READMAIN ;EVERYTHING IN MAIN, A CONTAINS $AA instructions to auxmem $3xx and execution would be as expected. If your readaux is somewhat more complicated, assemble it for auxmem and read it into memory and use the $C311 auxmove to locate it in auxmem. in zero page have sta readaux jmp mycode.