* = $FE9D ; Fresh implementation of the +btxfer.fe48 code found on CBUG disk 2 ; created by splicing together the actual dumped kernal ROM image ; from 901244-04a and the commented source code available at ; http://www.6502.org/users/sjgray/computer/cbm2/transactor-b-xfer.pdf ; ; Note if you're running this in an emulator that IPINIT assumes ; it's going to be reading $FF from $01FF and fails if it doesn't. ; The same goes for the original CBUG +btxfer.fe48. ; ; This code should load at fe9d ; ; 2020 Dave McMurtrie IPOINT = $00AC E6509 = $00 I6509 = $01 STACKP = $01FF EXSUBF PHP ;save status PHA ;save .a LDA #$0F ;system segment STA I6509 ;set up ind pointer PLA ;restore .a PLP ;restore status JMP EXSUB NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP EXSUB PHP ;save status SEI PHA ;.a TXA PHA ;.x TYA PHA ;.y JSR IPINIT ;init ipoint, stack TAY ;.y is xfer sp LDA E6509 ;return bank JSR PUTAS ;push .a other stack LDA #$04 ;xfer seg... LDX #$FF ;...rts routn JSR PUTAXS ;.a.x to other stack TSX LDA $0105,X ;.sp + 5 adds lo SEC SBC #$03 ;-3 for jsr PHA ;save .a LDA $0106,X ;hi addr SBC #$00 TAX ;.x hi PLA ;restore .a lo JSR PUTAXS ;push .a.x TYA ;xfer seg sp EXCOMM SEC SBC #$04 ;4 bytes .y.x.a.p STA STACKP ;xfer seg new sp TAY ;new sp also LDX #$04 ;4 bytes .y.x.a.p EXSU10 PLA INY STA (IPOINT),Y ;regs other stack DEX BNE EXSU10 LDY STACKP ;restore .y as sp LDA #$2D ;routine to LDX #$FF ;...pull regs JSR PUTAXS ;...to other stack PLA PLA EXGBYE TSX STX STACKP ;save sp TYA ;.y is new sp TAX TXS ;new stack pointer LDA I6509 ;xfer seg# JMP GBYE ;good bye NOP EXCRTS PHP ;.p PHP ;.p SEI PHA ;.a TXA PHA ;.x TYA PHA ;.y TSX LDA $0106,X ;.sp + 6 is... STA I6509 ;...return seg JSR IPINIT ;load cross sp JMP EXCOMM IPINIT LDY #$01 STY IPOINT+1 DEY STY IPOINT DEY LDA (IPOINT),Y RTS PUTAXS PHA ;save .a TXA STA (IPOINT),Y ;.x hi DEY PLA PUTAS STA (IPOINT),Y ;.a lo DEY RTS EXPULL PLA TAY ;.y PLA TAX ;.x PLA ;.a PLP ;.p RTS PHP JMP ($FFFA) BRK NOP RTS CLI RTS TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX TAX JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF JSR EXSUBF GBYE STA E6509 ;goodbye... RTS BRK BRK BRK BRK BRK BRK