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

89 lines
2.2 KiB
Plaintext
Raw Permalink 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-15 15:13:48 +00:00
RAMDRV cld no decimal.
2019-09-13 20:48:05 +00:00
ldx #$0B save 13 bytes of parms
2019-09-15 15:13:48 +00:00
.1 lda A1L,x
2019-09-10 15:46:56 +00:00
sta a1l1,x
dex
2019-09-15 15:13:48 +00:00
bpl .1
2019-09-10 20:53:18 +00:00
ldx #$01
2019-09-15 15:13:48 +00:00
.2 lda passit,x save xfer vectors
2019-09-10 15:46:56 +00:00
sta sp1,x
dex
2019-09-15 15:13:48 +00:00
bpl .2
2019-09-13 20:48:05 +00:00
lda A4L get command.
beq stat 0 = status
cmp #$04 check for command too high.
bcs ioerr if it is, i/o error
2019-09-10 15:46:56 +00:00
eor #$03
2019-09-13 20:48:05 +00:00
sta A4L 0=format, 2=read, 1=write
2019-09-10 20:53:18 +00:00
beq format
2019-09-13 20:48:05 +00:00
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-15 15:13:48 +00:00
format lda #RAMXDRV card entry point
2019-09-10 15:46:56 +00:00
sta passit
2019-09-15 15:13:48 +00:00
lda /RAMXDRV
gocard sta passit+1 also used by 'mainwrt'
2019-09-13 20:48:05 +00:00
sec direction ram -> card
clv start with original zero page
jmp xfer transfer control
ioerr lda #$27
2019-09-10 15:46:56 +00:00
bne H2D41
2019-09-13 20:48:05 +00:00
lda #$2B write protect error.
H2D41 sec flags error
2019-09-10 20:53:18 +00:00
bcs H2D47
2019-09-15 15:13:48 +00:00
noerr .EQ *
2019-09-10 20:53:18 +00:00
stat lda #$00
2019-09-10 15:46:56 +00:00
clc
2019-09-13 20:48:05 +00:00
H2D47 php save status
pha and error code.
ldx #$0B restore 13 byes of parms
H2D4B lda a1l1,x
2019-09-10 20:53:18 +00:00
sta A1L,x
2019-09-10 15:46:56 +00:00
dex
2019-09-10 20:53:18 +00:00
bpl H2D4B
2019-09-13 20:48:05 +00:00
lda sp1 restore xfer parms.
bit $6060 addr $FF58 must = rts ($60) as in ROM
2019-09-10 20:53:18 +00:00
sta passit
lda sp1+1
sta passit+1
2019-09-13 20:48:05 +00:00
pla restore error code
plp and status.
2019-09-10 15:46:56 +00:00
rts
2019-09-15 15:13:48 +00:00
mainwrt sta SETWRITEAUX write to alt 48K
2019-09-10 20:53:18 +00:00
ldy #$00
2019-09-13 20:48:05 +00:00
H2D6A lda (A1L),y pointers set in card by 'setptr'
2019-09-10 15:46:56 +00:00
sta (A4L),y
2019-09-10 20:53:18 +00:00
lda (A2L),y
sta (A3L),y
2019-09-10 15:46:56 +00:00
dey
2019-09-10 20:53:18 +00:00
bne H2D6A
2019-09-13 20:48:05 +00:00
sta CLRWRITEAUX write to main 48K.
lda #donewrt done writing card
2019-09-10 15:46:56 +00:00
sta passit
lda /donewrt
jmp gocard
2019-09-15 15:13:48 +00:00
sp1 .HS 0000
a1l1 .BS 13 13 bytes of storage
2019-04-29 20:36:58 +00:00
* end of obj ram_2
2019-09-15 15:13:48 +00:00
RAMDRV.END .EQ *
.BS $FF9B-* fill to lanirq ($FF9B see note below)
2019-04-29 20:36:58 +00:00
*--------------------------------------
MAN
SAVE usr/src/prodos.203/prodos.s.ram
LOAD usr/src/prodos.203/prodos.s
2019-04-29 20:36:58 +00:00
ASM