A2osX/ProDOS.203/ProDOS.S.RAM.txt

94 lines
2.7 KiB
Plaintext
Raw Normal View History

2019-04-29 20:36:58 +00:00
NEW
AUTO 3,1
* object code = ram_2
* /RAM driver (main bank portion)
* origin = $FF00
2019-09-10 15:46:56 +00:00
ofsR2 .EQ lcsrc-lcdest offset from ram driver org
2019-04-29 20:36:58 +00:00
2019-09-10 15:46:56 +00:00
lcsrc cld no decimal.
ldx #$0B save 13 bytes of parms
H2D03 lda A1L,x
sta a1l1,x
dex
bpl H2D03
ldx #$01
H2D0D lda passit,x save xfer vectors
sta sp1,x
dex
bpl H2D0D
lda A4L get command.
beq stat 0 = status
cmp #$04 check for command too high.
bcs ioerr if it is, i/o error
eor #$03
sta A4L 0=format, 2=read, 1=write
beq format
ldy bloknml+1 check for large block number.
bne ioerr too big.
lda bloknml block #
bmi ioerr largest block number is $7F
2019-04-29 20:36:58 +00:00
* at this point, control is passed to the code in the alternate 64k.
* it it used for read, write and format. after the request is completed,
* control is passed back to 'noerr'.
2019-09-10 15:46:56 +00:00
format lda #ramdest card entry point
sta passit
lda /ramdest
gocard .EQ *-ofsR2 also used by 'mainwrt'
sta passit+1
sec direction ram -> card
clv start with original zero page
jmp xfer transfer control
ioerr lda #$27
bne H2D41
lda #$2B write protect error.
H2D41 sec flags error
bcs H2D47
noerr .EQ *-ofsR2
stat lda #$00
clc
H2D47 php save status
pha and error code.
ldx #$0B restore 13 byes of parms
H2D4B lda a1l1,x
sta A1L,x
dex
bpl H2D4B
lda sp1 restore xfer parms.
bit $6060 addr $FF58 must = rts ($60) as in ROM
sta passit
lda sp1+1
sta passit+1
pla restore error code
plp and status.
rts
2019-04-29 20:36:58 +00:00
mainwrt .EQ *-ofsR2 transfer data to card.
2019-09-10 15:46:56 +00:00
sta wrcardram write to alt 48K
ldy #$00
H2D6A lda (A1L),y pointers set in card by 'setptr'
sta (A4L),y
lda (A2L),y
sta (A3L),y
dey
bne H2D6A
sta wrmainram write to main 48K.
lda #donewrt done writing card
sta passit
lda /donewrt
jmp gocard
sp1 .EQ *-ofsR2
.HS 0000
a1l1 .EQ *-ofsR2 13 bytes of storage
2019-04-29 20:36:58 +00:00
* end of obj ram_2
2019-09-10 15:46:56 +00:00
r2_end .EQ *
.BS $D9B-(r2_end-H2000) fill to lanirq ($FF9B see note below)
2019-04-29 20:36:58 +00:00
*--------------------------------------
MAN
2019-07-08 12:56:54 +00:00
SAVE USR/SRC/PRODOS.203/PRODOS.S.RAM
LOAD USR/SRC/PRODOS.203/PRODOS.S
2019-04-29 20:36:58 +00:00
ASM