A2osX/ProDOS.FX/ProDOS.S.RAM.txt

109 lines
2.3 KiB
Plaintext
Raw Normal View History

2019-10-16 06:09:13 +00:00
NEW
AUTO 3,1
2023-11-04 14:42:28 +00:00
*--------------------------------------
RAM.START .PH RAM
RAM.START1 cld no decimal.
2019-10-16 06:09:13 +00:00
ldx #$0B save 13 bytes of parms
2023-11-04 14:42:28 +00:00
.1 lda ZP.A1L,x
2019-10-16 06:09:13 +00:00
sta a1l1,x
dex
bpl .1
2019-10-16 06:09:13 +00:00
ldx #$01
2019-10-16 06:09:13 +00:00
.2 lda passit,x save xfer vectors
sta sp1,x
dex
bpl .2
2023-11-04 14:42:28 +00:00
lda ZP.CMDNUM
2019-10-16 06:09:13 +00:00
beq stat 0 = status
2019-10-16 06:09:13 +00:00
cmp #$04 check for command too high.
bcs ioerr if it is, i/o error
2019-10-16 06:09:13 +00:00
eor #$03
2023-11-04 14:42:28 +00:00
sta ZP.CMDNUM 0=format, 2=read, 1=write
2019-10-16 06:09:13 +00:00
beq format
2023-11-04 14:42:28 +00:00
ldy ZP.BLKNUM+1 check for large block number.
2019-10-16 06:09:13 +00:00
bne ioerr too big.
2023-11-04 14:42:28 +00:00
lda ZP.BLKNUM block #
2019-10-16 06:09:13 +00:00
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'.
2023-11-04 14:42:28 +00:00
format lda #RAMX card entry point
2019-10-16 06:09:13 +00:00
sta passit
2023-11-04 14:42:28 +00:00
lda /RAMX
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
2023-11-04 14:42:28 +00:00
jmp ROM.XFER transfer control
2019-10-16 06:09:13 +00:00
ioerr lda #$27
bne H2D41
2019-10-16 06:09:13 +00:00
lda #$2B write protect error.
H2D41 sec flags error
bcs H2D47
2019-10-16 06:09:13 +00:00
noerr .EQ *
stat lda #$00
clc
2019-10-16 06:09:13 +00:00
H2D47 php save status
pha and error code.
2019-10-16 06:09:13 +00:00
ldx #$0B restore 13 byes of parms
2019-10-16 06:09:13 +00:00
H2D4B lda a1l1,x
2023-11-04 14:42:28 +00:00
sta ZP.A1L,x
2019-10-16 06:09:13 +00:00
dex
bpl H2D4B
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
2023-11-04 14:42:28 +00:00
mainwrt sta IO.SETWRITEAUX write to alt 48K
2019-10-16 06:09:13 +00:00
ldy #$00
2023-11-04 14:42:28 +00:00
H2D6A lda (ZP.A1L),y pointers set in card by 'setptr'
sta (ZP.A4L),y
lda (ZP.A2L),y
sta (ZP.A3L),y
2019-10-16 06:09:13 +00:00
dey
bne H2D6A
2023-11-04 14:42:28 +00:00
sta IO.CLRWRITEAUX write to main 48K.
2019-10-16 06:09:13 +00:00
lda #donewrt done writing card
sta passit
lda /donewrt
jmp gocard
*--------------------------------------
.DUMMY
2019-10-16 06:09:13 +00:00
sp1 .HS 0000
2023-11-04 14:42:28 +00:00
a1l1 .BS 13 13 bytes of storage
.ED
2023-11-04 14:42:28 +00:00
*--------------------------------------
.EP
*--------------------------------------
RAM.LEN .EQ *-RAM.START
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