2019-10-16 06:09:13 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
2019-11-01 20:06:04 +00:00
|
|
|
|
RAM.START
|
2019-10-16 06:09:13 +00:00
|
|
|
|
RAMDRV cld no decimal.
|
|
|
|
|
ldx #$0B save 13 bytes of parms
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
.1 lda A1L,x
|
|
|
|
|
sta a1l1,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
ldx #$01
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
.2 lda passit,x save xfer vectors
|
|
|
|
|
sta sp1,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda A4L get command.
|
|
|
|
|
beq stat 0 = status
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
cmp #$04 check for command too high.
|
|
|
|
|
bcs ioerr if it is, i/o error
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
eor #$03
|
|
|
|
|
sta A4L 0=format, 2=read, 1=write
|
|
|
|
|
beq format
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
ldy bloknml+1 check for large block number.
|
|
|
|
|
bne ioerr too big.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda bloknml block #
|
|
|
|
|
bmi ioerr largest block number is $7F
|
|
|
|
|
|
|
|
|
|
* 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'.
|
|
|
|
|
|
|
|
|
|
format lda #RAMXDRV card entry point
|
|
|
|
|
sta passit
|
|
|
|
|
lda /RAMXDRV
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
gocard sta passit+1 also used by 'mainwrt'
|
|
|
|
|
sec direction ram -> card
|
|
|
|
|
clv start with original zero page
|
|
|
|
|
jmp xfer transfer control
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
ioerr lda #$27
|
|
|
|
|
bne H2D41
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
lda #$2B write protect error.
|
|
|
|
|
H2D41 sec flags error
|
|
|
|
|
bcs H2D47
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
noerr .EQ *
|
|
|
|
|
stat lda #$00
|
|
|
|
|
clc
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
H2D47 php save status
|
|
|
|
|
pha and error code.
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
ldx #$0B restore 13 byes of parms
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
H2D4B lda a1l1,x
|
|
|
|
|
sta A1L,x
|
|
|
|
|
dex
|
|
|
|
|
bpl H2D4B
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
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
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
mainwrt sta SETWRITEAUX write to alt 48K
|
|
|
|
|
ldy #$00
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
H2D6A lda (A1L),y pointers set in card by 'setptr'
|
|
|
|
|
sta (A4L),y
|
|
|
|
|
lda (A2L),y
|
|
|
|
|
sta (A3L),y
|
|
|
|
|
dey
|
|
|
|
|
bne H2D6A
|
2022-04-27 19:24:41 +00:00
|
|
|
|
|
2019-10-16 06:09:13 +00:00
|
|
|
|
sta CLRWRITEAUX write to main 48K.
|
|
|
|
|
lda #donewrt done writing card
|
|
|
|
|
sta passit
|
|
|
|
|
lda /donewrt
|
|
|
|
|
jmp gocard
|
2022-04-27 19:24:41 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
RAM.LEN .EQ *-RAM.START
|
|
|
|
|
|
|
|
|
|
.DUMMY
|
2019-10-16 06:09:13 +00:00
|
|
|
|
sp1 .HS 0000
|
|
|
|
|
a1l1 .BS 13 13 bytes of storage
|
2022-04-27 19:24:41 +00:00
|
|
|
|
.ED
|
2019-10-16 06:09:13 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2022-03-27 12:59:32 +00:00
|
|
|
|
SAVE usr/src/prodos.fx/prodos.s.ram
|
|
|
|
|
LOAD usr/src/prodos.fx/prodos.s
|
2019-10-16 06:09:13 +00:00
|
|
|
|
ASM
|