Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-09-10 22:53:18 +02:00
parent 834281c40b
commit bdcf96401e
17 changed files with 7421 additions and 7406 deletions

Binary file not shown.

View File

@ -8,57 +8,57 @@ NEW
ofsC .EQ cclock_0-tclk_in offset to Cortland clock org
cclock_0 SHORT I,M 8 bit mode.
lda statereg state register.
sta savestate save for restore after tool call.
and #$CF clear the read/write aux memory bits.
sta statereg make it real
clc set e = 0 to set native mode
lda statereg state register.
sta savestate save for restore after tool call.
and #$CF clear the read/write aux memory bits.
sta statereg make it real
clc set e = 0 to set native mode
xce
LONG I,M 16 bit mode.
lda #$0000 zero out result space.
pha push 4 words for hex time result
LONG I,M 16 bit mode.
lda #$0000 zero out result space.
pha push 4 words for hex time result
pha
pha
pha
_ReadTimeHex
SHORT M back to 8 bit to get results from stack
lda savestate restore state register
sta statereg
lda savestate restore state register
sta statereg
pla pull off seconds and ignore
pla
sta p8time minutes
sta p8time minutes
pla
sta p8time+1 hours
pla year
H2FB1 cmp #100 out of range?
bcc H2FB9 no, go ahead and store
sbc #$64 else put back in range.
bra H2FB1 try again
H2FB9 sta p8date+1 year
sta p8time+1 hours
pla year
H2FB1 cmp #100 out of range?
bcc H2FB9 no, go ahead and store
sbc #$64 else put back in range.
bra H2FB1 try again
H2FB9 sta p8date+1 year
pla
inc a increment day for Prodos 8 format.
sta p8date day
pla month
inc a increment month for Prodos 8 format.
asl a shift month as it sits in between
asl a the year and day values.
asl a
asl a
asl a
ora p8date put all but the top bit of month
sta p8date value in the day byte.
rol p8date+1 put hi bit of month in low bit of year
pla pull of unused byte
pla pull off day of week. stack now clean.
sec go back to emulation mode
xce to continue with Prodos 8
inc increment day for Prodos 8 format.
sta p8date day
pla month
inc increment month for Prodos 8 format.
asl shift month as it sits in between
asl the year and day values.
asl
asl
asl
ora p8date put all but the top bit of month
sta p8date value in the day byte.
rol p8date+1 put hi bit of month in low bit of year
pla pull of unused byte
pla pull off day of week. stack now clean.
sec go back to emulation mode
xce to continue with Prodos 8
rts
savestate .EQ *-ofsC
.HS 00 state of the state register
.HS 00 state of the state register
.AS "JIMJAYKERRY&MIKE"
.HS 0000000000000000 pad 0's until length
.HS 0000000000000000 of driver = 125 bytes.
.HS 000000000000
.HS 0000000000000000 pad 0's until length
.HS 0000000000000000 of driver = 125 bytes.
.HS 000000000000
cclk_end .EQ * end of obj cclock_0.
.HS 000000 pad to page boundary
LONGI OFF

File diff suppressed because it is too large Load Diff

View File

@ -8,15 +8,15 @@ ofsG .EQ H2E00-MLI offset to global org
H2E00 jmp mlient1 $2E00-2EFF moved to $BF00
jspare .EQ *-ofsG
jmp jspare will be changed to point to dispatcher.
clockv .EQ *-ofsG P8 clock vector
clockv .EQ *-ofsG P8 clock vector
rts changed to jmp ($4C) if clock present.
.DA tclk_in clock routine entry address.
p8errv .EQ *-ofsG error reporting hook.
.DA tclk_in clock routine entry address.
p8errv .EQ *-ofsG error reporting hook.
jmp syserr1
sysdeath .EQ *-ofsG
jmp sysdeath1 system failure hook.
jmp sysdeath1 system failure hook.
p8error .EQ *-ofsG P8 error code
.DA #0
.DA #0
drivertbl1 .EQ *-ofsG device driver table 1
.DA nodevice
.DA nodevice
@ -36,13 +36,13 @@ drivertbl2 .EQ *-ofsG device driver table 2
.DA nodevice
.DA nodevice
devnum .EQ *-ofsG most recent accessed device
.DA #0
.DA #0
numdevs .EQ *-ofsG count (-1) active devices
.DA #$ff
devlist .EQ *-ofsG active device list
.HS 00000000000000 up to 14 units may be active
.HS 00000000000000
.DA #0
.DA #0
.AS "(C)APPLE "
mlient1 .EQ *-ofsG
@ -50,83 +50,83 @@ mlient1 .EQ *-ofsG
sei
jmp mlicont
aftirq .EQ *-ofsG irq returns here.
sta ramin read/write RAM bank 1
jmp fix45 restore $45 after interrupt in LC
sta ramin read/write RAM bank 1
jmp fix45 restore $45 after interrupt in LC
oldacc .EQ *-ofsG
.DA #0
.DA #0
afbank .EQ *-ofsG
.HS 0
* memory map of lower 48k. each bit represents 1 page.
* protected pages = 1, unprotected = 0
memmap .EQ *-ofsG P8 memory bitmap
memmap .EQ *-ofsG P8 memory bitmap
.HS C000000000000000
.HS 0000000000000000
.HS 0000000000000001
.HS 0000000000000001
* table of buffer addresses for currently open files.
* these can only be changed thru the mli call setbuf.
buftbl .EQ *-ofsG
buftbl .EQ *-ofsG
.HS 0000 file #1
.HS 0000 file #2
.HS 0000 file #3
.HS 0000 file #4
.HS 0000 file #5
.HS 0000 file #6
.HS 0000 file #7
.HS 0000 file #8
.HS 0000 file #2
.HS 0000 file #3
.HS 0000 file #4
.HS 0000 file #5
.HS 0000 file #6
.HS 0000 file #7
.HS 0000 file #8
* table of interrupt vectors. these can only be changed
* by the mli call allocate_interrupt. values of the registers
* at the time of the most recent interrupt are stored here along
* with the address interrupted.
inttbl .EQ *-ofsG interrupt table
.HS 0000 int #1
.HS 0000 int #2
.HS 0000 int #3
.HS 0000 int #4
p8areg .EQ *-ofsG A register savearea
.DA #0
p8xreg .EQ *-ofsG X register savearea
inttbl .EQ *-ofsG interrupt table
.HS 0000 int #1
.HS 0000 int #2
.HS 0000 int #3
.HS 0000 int #4
p8areg .EQ *-ofsG A register savearea
.DA #0
p8xreg .EQ *-ofsG X register savearea
.DA #0
p8yreg .EQ *-ofsG Y register savearea
p8yreg .EQ *-ofsG Y register savearea
.DA #0
p8sreg .EQ *-ofsG S register savearea
p8sreg .EQ *-ofsG S register savearea
.DA #0
p8preg .EQ *-ofsG P register savearea
p8preg .EQ *-ofsG P register savearea
.DA #0
bankid .EQ *-ofsG bank ID byte (ROM/RAM)
.DA #1
intadr .EQ *-ofsG interrupt return address
intadr .EQ *-ofsG interrupt return address
.HS 0000
p8date .EQ *-ofsG bits 15-9=yr, 8-5=mo, 4-0=day
p8date .EQ *-ofsG bits 15-9=yr, 8-5=mo, 4-0=day
.HS 0000
p8time .EQ *-ofsG bits 12-8=hr, 5-0=min, low-hi format
p8time .EQ *-ofsG bits 12-8=hr, 5-0=min, low-hi format
.HS 0000
flevel .EQ *-ofsG current file level
.DA #0
bubit .EQ *-ofsG backup bit disable, setfileinfo only
bubit .EQ *-ofsG backup bit disable, setfileinfo only
.DA #0
spare1 .EQ *-ofsG used to save acc
spare1 .EQ *-ofsG used to save acc
.DA #0
newpfxptr .EQ *-ofsG appletalk alternate prefix ptr
.DA #0
machid .EQ *-ofsG machine ID byte
machid .EQ *-ofsG machine ID byte
.DA #0
rommap .EQ *-ofsG slot ROM bit map
rommap .EQ *-ofsG slot ROM bit map
.DA #0
preflag .EQ *-ofsG prefix active flag
.DA #0
mliact .EQ *-ofsG MLI active flag
mliact .EQ *-ofsG MLI active flag
.DA #0
mliretn .EQ *-ofsG last MLI call return address
.DA 0
mlix .EQ *-ofsG MLI X register savearea
mlix .EQ *-ofsG MLI X register savearea
.DA #0
mliy .EQ *-ofsG MLI Y register savearea
mliy .EQ *-ofsG MLI Y register savearea
.DA #0
* language card bank switching routines which must reside at $BFA0 because
@ -134,48 +134,48 @@ mliy .EQ *-ofsG MLI Y register savearea
HBFA0 .EQ *-ofsG
eor $E000 test for rom enable
beq .1 taken if ram enabled
beq .1 taken if ram enabled
sta romin read ROM
bne .2 always
.1 lda bnkbyt2 for alternate ram
eor $D000 test
beq .2 branch if not alternate ram
bne .2 always
.1 lda bnkbyt2 for alternate ram
eor $D000 test
beq .2 branch if not alternate ram
lda altram else enable alt $D000
.2 pla return code
rti re-enable interrupts and return
.2 pla return code
rti re-enable interrupts and return
mlicont .EQ *-ofsG
sec
ror mliact notify interrupt routines MLI active.
lda $E000 preserve language card/rom orientation
sta bnkbyt1 for proper restoration when mli exits.
ror mliact notify interrupt routines MLI active.
lda $E000 preserve language card/rom orientation
sta bnkbyt1 for proper restoration when mli exits.
lda $D000
sta bnkbyt2
lda ramin force ram card on
lda ramin with write allowed
lda ramin with write allowed
jmp xdosmli
irqexit .EQ *-ofsG
lda bankid determine state of ram card (ROM/RAM)
lda bankid determine state of ram card (ROM/RAM)
irqxit0 .EQ *-ofsG
beq .2 branch if ram card enabled.
bmi .1 branch if alternate $D000 enabled.
beq .2 branch if ram card enabled.
bmi .1 branch if alternate $D000 enabled.
lsr determine if no ram card present.
bcc .3 branch if rom only system.
lsr determine if no ram card present.
bcc .3 branch if rom only system.
lda romin1 enable rom
bcs .3 always taken
lda romin1 enable rom
bcs .3 always taken
.1 lda altram enable alternate $D000
.2 lda #$01 preset bankid for rom.
sta bankid (reset if ram card interrupt)
.3 lda p8areg restore acc
rti exit
.1 lda altram enable alternate $D000
.2 lda #$01 preset bankid for rom.
sta bankid (reset if ram card interrupt)
.3 lda p8areg restore acc
rti exit
irqent .EQ *-ofsG this entry only used when rom
bit ramin was enabled at time of interrupt.
bit ramin was enabled at time of interrupt.
bit ramin
jmp irqrecev
@ -185,7 +185,7 @@ bnkbyt2 .EQ *-ofsG
.DA #0
.HS 00000000 pad to before $BFFA
.DA #4 gsos compatibility byte ($BFFA)
.DA #0 pad
.DA #0 pad
.DA #0 reserved
.DA #0 version # of running interpreter
.DA #0 preserved for System Utilities

View File

@ -7,65 +7,65 @@ NEW
lanirq .EQ *-ofsR2
H2D9B pha $2D9B-2DFF moved to $FF9B-FFFF
lda accsav
sta oldacc
H2D9B pha $2D9B-2DFF moved to $FF9B-FFFF
lda accsav
sta oldacc
pla
sta accsav
sta accsav
pla get status register from stack
pha and put it back.
and #$10 is it a break or interrupt?
bne H2DC2 branch if break.
lda $D000 get ram bankid (LC1 = $D8, LC2=$EE)
eor #$D8 is the system active? ($D8)
beq sysactv branch if it is
pha and put it back.
and #$10 is it a break or interrupt?
bne H2DC2 branch if break.
lda $D000 get ram bankid (LC1 = $D8, LC2=$EE)
eor #$D8 is the system active? ($D8)
beq sysactv branch if it is
lda #$FF
sysactv sta bankid
sta afbank
lda /aftirq setup return address
sta afbank
lda /aftirq setup return address
pha
lda #aftirq
lda #aftirq
pha
lda #$04 status reg with interrupt flag set
lda #$04 status reg with interrupt flag set
pha
H2DC2 lda /romirq setup ROM re-entry
H2DC2 lda /romirq setup ROM re-entry
pha
lda #romirq
lda #romirq
pha
gorom .EQ *-ofsR2
sta romin hits ROM rts at $FFCB
sta romin hits ROM rts at $FFCB
* 'lreset' address must = $FFCB for rom switch i/o to work
lreset .EQ *-ofsR2
lda rreset+1
lda rreset+1
pha
lda rreset
lda rreset
pha
jmp gorom
jmp gorom
rreset .EQ *-ofsR2
.DA resetv-1 rts to resetv
fix45 .EQ *-ofsR2
sta p8areg A register savearea
lda oldacc
sta accsav
lda ramin read/write RAM bank 1
lda ramin
lda afbank
jmp irqxit0
sta p8areg A register savearea
lda oldacc
sta accsav
lda ramin read/write RAM bank 1
lda ramin
lda afbank
jmp irqxit0
stypfx .EQ *-ofsR2 fix appletalk PFI bug
sty newpfxptr
sty preflag prefix flag
sty newpfxptr
sty preflag prefix flag
rts
stapfx .EQ *-ofsR2
sta newpfxptr
sta preflag
sta newpfxptr
sta preflag
rts
* these 3 vectors hard-coded into processor
.DA nmivect nmi handler
.DA lreset reset handler
.DA nmivect nmi handler
.DA lreset reset handler
irqv .EQ *-ofsR2
.DA lanirq irq handler

File diff suppressed because it is too large Load Diff

View File

@ -6,28 +6,28 @@ NEW
ofsR2 .EQ lcsrc-lcdest offset from ram driver org
lcsrc cld no decimal.
ldx #$0B save 13 bytes of parms
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
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
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
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
* 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,
@ -37,49 +37,49 @@ format lda #ramdest card entry point
sta passit
lda /ramdest
gocard .EQ *-ofsR2 also used by 'mainwrt'
sta passit+1
sta passit+1
sec direction ram -> card
clv start with original zero page
jmp xfer transfer control
ioerr lda #$27
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
H2D41 sec flags error
bcs H2D47
noerr .EQ *-ofsR2
stat lda #$00
stat lda #$00
clc
H2D47 php save status
H2D47 php save status
pha and error code.
ldx #$0B restore 13 byes of parms
H2D4B lda a1l1,x
sta A1L,x
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
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.
plp and status.
rts
mainwrt .EQ *-ofsR2 transfer data to card.
sta wrcardram write to alt 48K
ldy #$00
H2D6A lda (A1L),y pointers set in card by 'setptr'
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
lda (A2L),y
sta (A3L),y
dey
bne H2D6A
sta wrmainram write to main 48K.
lda #donewrt done writing card
bne H2D6A
sta wrmainram write to main 48K.
lda #donewrt done writing card
sta passit
lda /donewrt
jmp gocard
sp1 .EQ *-ofsR2
.HS 0000
.HS 0000
a1l1 .EQ *-ofsR2 13 bytes of storage
* end of obj ram_2

View File

@ -5,12 +5,12 @@ NEW
* /RAM installer - transfer part of the driver to the aux bank
* and front part of the driver to the main bank (language card).
RAM_1 .BS $2C80-*
RAM_1 .BS $2C80-*
ldy #$99 move $9A bytesfrom lcsrc to lcdest.
.1 lda lcsrc,y transfer main bank portion of driver
sta lcdest,y
.1 lda lcsrc,y transfer main bank portion of driver
sta lcdest,y
dey
cpy #$FF
bne .1
@ -25,21 +25,21 @@ RAM_1 .BS $2C80-*
stx A2L+1
lda #ramdest
sta A4L
lda /ramdest ramsrc to ramdest
lda /ramdest ramsrc to ramdest
sta A4L+1
sec irection = to aux bank.
sec irection = to aux bank.
jsr auxmove move aux bank portion of driver.
lda #lcdest put driver address into
sta drivertbl2+6 slot 3, drive 2.
sta drivertbl2+6 slot 3, drive 2.
lda /lcdest
sta drivertbl2+7
inc numdevs count (-1) active devices
inc numdevs count (-1) active devices
ldx numdevs
lda #$BF unit num of /RAM
lda #$BF unit num of /RAM
sta devlist,x
rts end of obj ram_1
rts end of obj ram_1
RAM_1_END .EQ * end of /RAM installer
.BS #256-* pad 0's to page boundary

View File

@ -8,109 +8,109 @@ object code = ram_0
* after the main /RAM routine has determined that the command is ok and the
* block to be read/written is within range, it transfers control to this
* aux /RAM routine which remaps the block requested as follows:
* request blocks 0,1: invalid
* 2: returns VDIR (card block 3)
* 3: returns BITMAP (synthesized)
* 4: returns card block 0
* $05-$5F: returns card blocks $05-$5F
* $60-$67: returns blocks $68-$7F in bank 1 of language card
* $68-$7F: returns blocks $68-$7F in bank 2 of language card
* request blocks 0,1: invalid
* 2: returns VDIR (card block 3)
* 3: returns BITMAP (synthesized)
* 4: returns card block 0
* $05-$5F: returns card blocks $05-$5F
* $60-$67: returns blocks $68-$7F in bank 1 of language card
* $68-$7F: returns blocks $68-$7F in bank 2 of language card
ofsR0 .EQ ramsrc-ramdest offset to /RAM driver org
ramsrc lda rd80col read 80 store
pha save for later
sta store80off turn off 80 store
ldx #$04 move the parameters for use:
L5109 lda A4L,x cmd, unit, bufptr and block (lo)
sta tcmd,x -> tcmd, tunit, R2L, R2H, R01
dex
bpl L5109
and formatflg format the volume first time
bne L514F thru, or when requested.
ldx bloknml save R01 during format.
lda #>vblock1 block to be cleared.
jsr clrbuf1 clears all buffers.
ldy #$03 format volume in 2 chunks.
L511F lda VDIR,y
sta vblock1+4,y
dey
bpl L511F
lda #$FE set last block as unusable
sta BITMAP+15 to protect vectors.
tya set bitmap bits to $FF.
ldy #$0E 15 bytes to set
L5130 sta BITMAP,y
dey
bne L5130
sty BITMAP first byte = 0.
ldy #$07 do other chunk
L513B lda access,y
sta vblock1+34,y
dey
bpl L513B
lda formatflg if 0, set to $FF
bne L51AA else exitcard.
sty formatflg y = $FF, won't format next time.
stx R01 restore R01
ramsrc lda rd80col read 80 store
pha save for later
sta store80off turn off 80 store
ldx #$04 move the parameters for use:
L5109 lda A4L,x cmd, unit, bufptr and block (lo)
sta tcmd,x -> tcmd, tunit, R2L, R2H, R01
dex
bpl L5109
and formatflg format the volume first time
bne L514F thru, or when requested.
ldx bloknml save R01 during format.
lda #>vblock1 block to be cleared.
jsr clrbuf1 clears all buffers.
ldy #$03 format volume in 2 chunks.
L511F lda VDIR,y
sta vblock1+4,y
dey
bpl L511F
lda #$FE set last block as unusable
sta BITMAP+15 to protect vectors.
tya set bitmap bits to $FF.
ldy #$0E 15 bytes to set
L5130 sta BITMAP,y
dey
bne L5130
sty BITMAP first byte = 0.
ldy #$07 do other chunk
L513B lda access,y
sta vblock1+34,y
dey
bpl L513B
lda formatflg if 0, set to $FF
bne L51AA else exitcard.
sty formatflg y = $FF, won't format next time.
stx R01 restore R01
* use the requested block number to determine
* which routine performs the transfer
L514F asl R01 block requested -> page requested.
lda R01 get page requested.
cmp #$BF in language card ?
bcs L5163 yes, do it.
cmp #$06 bitmap ?
bne L5160
jmp tbmap yes, transfer bitmap
L5160 jmp treg else normal transfer.
L514F asl R01 block requested -> page requested.
lda R01 get page requested.
cmp #$BF in language card ?
bcs L5163 yes, do it.
cmp #$06 bitmap ?
bne L5160
jmp tbmap yes, transfer bitmap
L5160 jmp treg else normal transfer.
* when a block between $60 and $7F is requested, it must be spirited into/from
* the language card area of the 64k card. this requires a 2 stage move:
* into the temp buffer and then to it's real destination.
L5163 tax save R1 for later.
jsr setptr get direction
php and save it.
bcs L51B8 if it's a write.
L5163 tax save R1 for later.
jsr setptr get direction
php and save it.
bcs L51B8 if it's a write.
lcrd .EQ *-ofsR0
txa get R1 back
cmp #$CF which bank is it in ?
bcs L5173 in main bank.
ora #$10 in secondary bank.
bne L5179 branch always.
L5173 sta altram turn on main $D000
sta altram
L5179 sta R01 restore R1.
lda R2H save R2 for later
pha
ldx R2L
sta setaltzp use alternate zero page/stack
lda #>dbuf set R2 to dbuf
sta R2H
lda #<dbuf
sta R2L
jsr setptr set pointers
tay A > 0 from setptr
L5194 lda (A1L),y move A1,A2 to A4,A3
sta (A4L),y
lda (A2L),y
sta (A3L),y
dey
bne L5194
sta setstdzp use main zero page/stack
L51A2 stx R2L
pla restore R2
sta R2H
plp get direction.
L51AA bcs L51B5 write, done with move.
sta ramin switch in MLI part of LC
sta ramin
jsr blockdo0 read, transfer dbuf to main
L51B5 jmp exitcard
L51B8 jsr blockdo0 transfer main to dbuf.
jmp lcrd transfer dbuf to language card
txa get R1 back
cmp #$CF which bank is it in ?
bcs L5173 in main bank.
ora #$10 in secondary bank.
bne L5179 branch always.
L5173 sta altram turn on main $D000
sta altram
L5179 sta R01 restore R1.
lda R2H save R2 for later
pha
ldx R2L
sta setaltzp use alternate zero page/stack
lda #>dbuf set R2 to dbuf
sta R2H
lda #<dbuf
sta R2L
jsr setptr set pointers
tay A > 0 from setptr
L5194 lda (A1L),y move A1,A2 to A4,A3
sta (A4L),y
lda (A2L),y
sta (A3L),y
dey
bne L5194
sta setstdzp use main zero page/stack
L51A2 stx R2L
pla restore R2
sta R2H
plp get direction.
L51AA bcs L51B5 write, done with move.
sta ramin switch in MLI part of LC
sta ramin
jsr blockdo0 read, transfer dbuf to main
L51B5 jmp exitcard
L51B8 jsr blockdo0 transfer main to dbuf.
jmp lcrd transfer dbuf to language card
* blockdo0 transfers a block between main memory and the 64k card. R1 contains
* the page address of the block in the card; R2 contains the page address of
@ -119,116 +119,116 @@ L51B8 jsr blockdo0 transfer main to dbuf.
* write is done (R2->R1); if cmd is 1, a read is done (R1->R2).
blockdo0 .EQ *-ofsR0 set up R1 = dbuf
lda #>dbuf
lda #>dbuf
blockdo1 .EQ *-ofsR0
sta R01
sta R01
blockdo .EQ *-ofsR0
jsr setptr set pointers.
bcs L51DB it's a write.
sta wrmainram transfer buffer directly to main.
tay 0 left from setptr.
L51CC lda (A1L),y transfer A1,A2 to A4,A3
sta (A4L),y
lda (A2L),y
sta (A3L),y
dey
bne L51CC
sta wrcardram back the way it was.
jsr setptr set pointers.
bcs L51DB it's a write.
sta wrmainram transfer buffer directly to main.
tay 0 left from setptr.
L51CC lda (A1L),y transfer A1,A2 to A4,A3
sta (A4L),y
lda (A2L),y
sta (A3L),y
dey
bne L51CC
sta wrcardram back the way it was.
donewrt .EQ *-ofsR0 mainwrt returns here
rts
L51DB lda #<mainwrt pointers set up,
sta passit pass control to main ram
lda #>mainwrt
jmp ex1 set passit+1 and transfer
rts
L51DB lda #<mainwrt pointers set up,
sta passit pass control to main ram
lda #>mainwrt
jmp ex1 set passit+1 and transfer
* setptr is used by other routines to set up pointers and dtect read or write
setptr .EQ *-ofsR0
lda tcmd is it read or write ?
lsr a
bcs L5208 taken if write.
lda R2H destination page
sta A4L+1
sta A3L+1
lda R2L
sta A4L
sta A3L
lda R01 source page
sta A1L+1
sta A2L+1
lda #$00 source page aligned
sta A1L
sta A2L
beq L5223
L5208 lda R2H source page
sta A1L+1
sta A2L+1
lda R2L
sta A1L
sta A2L
lda R01 destination page
sta A4L+1
sta A3L+1
lda #$00 destination page aligned
sta A4L
sta A3L
L5223 inc A2L+1
inc A3L+1
rts
lda tcmd is it read or write ?
lsr a
bcs L5208 taken if write.
lda R2H destination page
sta A4L+1
sta A3L+1
lda R2L
sta A4L
sta A3L
lda R01 source page
sta A1L+1
sta A2L+1
lda #$00 source page aligned
sta A1L
sta A2L
beq L5223
L5208 lda R2H source page
sta A1L+1
sta A2L+1
lda R2L
sta A1L
sta A2L
lda R01 destination page
sta A4L+1
sta A3L+1
lda #$00 destination page aligned
sta A4L
sta A3L
L5223 inc2L+1
inc3L+1
rts
* tzip is called if blocks 0,1,4,5 are requested.
* on write it does nothing, on read it returns 0's.
tzip jsr clrbuf0 fill dbuf with 0's
jsr blockdo transfer the 0's
jmp exitcard and return
tzip jsr clrbuf0 fill dbuf with 0's
jsr blockdo transfer the 0's
jmp exitcard and return
* clrbuf fills the buffer indicated by R01 to 0's.
* should only be called on a read or format.
clrbuf0 .EQ *-ofsR0
lda #>dbuf dbuf is temp buffer.
lda #>dbuf dbuf is temp buffer.
clrbuf1 .EQ *-ofsR0
sta R01 assign to block.
sta R01 assign to block.
clrbuf2 .EQ *-ofsR0
jsr setptr set pointers
tay acc = 0
L523A sta (A1L),y
sta (A2L),y
dey
bne L523A
rts
jsr setptr set pointers
tay acc = 0
L523A sta (A1L),y
sta (A2L),y
dey
bne L523A
rts
* treg maps the requested block into the aux card
* so that 8k data files will be contiguous (the index
* blocks will not be placed within data).
treg .EQ *-ofsR0
cmp #$04 page 4 = vdir
bne L524A not vdir, continue
lda #$07 else transfer block 7
bne L5258
L524A cmp #$0F if any page < $F (block 8) requested,
bcc tzip it is invalid.
ldx #$00 x = # of iterations.
lda bloknml use true block #.
cmp #$5D beyond 8k blocks ?
bcc L525B no, do normal
sbc #$50 else subtract offset
L5258 jmp times2 and multiply by 2
cmp #$04 page 4 = vdir
bne L524A not vdir, continue
lda #$07 else transfer block 7
bne L5258
L524A cmp #$0F if any page < $F (block 8) requested,
bcc tzip it is invalid.
ldx #$00 x = # of iterations.
lda bloknml use true block #.
cmp #$5D beyond 8k blocks ?
bcc L525B no, do normal
sbc #$50 else subtract offset
L5258 jmp times2 and multiply by 2
* determine which 8k chunk it is in, place in x;
* block offset into chunk goes into y.
L525B sec
sbc #$08 block=block-6
L525E cmp #$11 if <=17 then done
bcc L5268
sbc #$11 else block=block-17.
inx iteration count.
bpl L525E should branch always
.HS 00 otherwise crash !!!
L5268 tay remainder in y
L525B sec
sbc #$08 block=block-6
L525E cmp #$11 if <=17 then done
bcc L5268
sbc #$11 else block=block-17.
inx iteration count.
bpl L525E should branch always
.HS 00 otherwise crash !!!
L5268 tay remainder in y
* if remainder is 1 then it's an index block:
* start index blocks at $1000,$2000...$19FF.
@ -237,61 +237,61 @@ L5268 tay remainder in y
* otherwise, it is some other data block.
* page is 32 + (16 * x) + (2 * y)
cpy #$01 is it index block ?
bne L5273 no.
txa index = 2 * (8 + x)
clc
adc #$08
bne L5285 multiply by 2.
L5273 inx iteration + 1.
txa page = 2 * (16 + 8x)
asl a
asl a
asl a
asl a
sta R01
tya get offset into 8k chunk
beq L5281 if 0, no offset
dey else offset = 2 * y
tya
L5281 clc
adc R01
times2 .EQ *-ofsR0
L5285 asl a acc = 2 * acc
jsr blockdo1 store in R01 and transfer
jmp exitcard and return
cpy #$01 is it index block ?
bne L5273 no.
txa index = 2 * (8 + x)
clc
adc #$08
bne L5285 multiply by 2.
L5273 inx iteration + 1.
txa page = 2 * (16 + 8x)
asl
asl
asl
asl
sta R01
tya get offset into 8k chunk
beq L5281 if 0, no offset
dey else offset = 2 * y
tya
L5281 clc
adc R01
times2 .EQ *-ofsR0
L5285 asl acc = 2 * acc
jsr blockdo1 store in R01 and transfer
jmp exitcard and return
* when block 3 is requested, the bitmap is returned. the real bitmap is only
* 16 bytes long; the rest of the block is synthesized. the temporary buffer
* at $800 is used to build/read a full size bitmap block.
tbmap .EQ *-ofsR0
lda #>dbuf use temp buffer as block
sta R01
jsr setptr set pointers, test read/write.
bcs L52A9 branch if it's write.
jsr clrbuf2
ldy #$0F put real bitmap there
L529B lda BITMAP,y
sta (A1L),y
dey
bpl L529B
jsr blockdo move temp buf to user buf
jmp exitcard
L52A9 jsr blockdo move user buf to temp buf
jsr setptr
ldy #$0F move temp buf to bitmap.
L52B1 lda (A4L),y (pointer set by setptr)
sta BITMAP,y
dey
bpl L52B1
jmp exitcard
lda #>dbuf use temp buffer as block
sta R01
jsr setptr set pointers, test read/write.
bcs L52A9 branch if it's write.
jsr clrbuf2
ldy #$0F put real bitmap there
L529B lda BITMAP,y
sta (A1L),y
dey
bpl L529B
jsr blockdo move temp buf to user buf
jmp exitcard
L52A9 jsr blockdo move user buf to temp buf
jsr setptr
ldy #$0F move temp buf to bitmap.
L52B1 lda (A4L),y (pointer set by setptr)
sta BITMAP,y
dey
bpl L52B1
jmp exitcard
formatflg .EQ *-ofsR0
.HS 00 not formatted yet
.HS 00 not formatted yet
tcmd .EQ *-ofsR0
.HS 00 command
.HS 00 unit (not used)
.HS 00 unit (not used)
R2L .EQ *-ofsR0
.HS 00 R2 = user buffer
R2H .EQ *-ofsR0
@ -300,44 +300,44 @@ R01 .EQ *-ofsR0
.HS 00 page requested
BITMAP .EQ *-ofsR0
.HS 00FFFFFF blocks 0-7 used
.HS FFFFFFFF
.HS FFFFFFFF
.HS FFFFFFFF
.HS FFFFFFFE
VDIR .EQ *-ofsR0 start of vdir.
.HS FFFFFFFE
VDIR .EQ *-ofsR0 start of vdir.
.HS F3 storage type = F, name length = 3
.AS "RAM"
access .EQ *-ofsR0
.DA #C3 destroy, rename, read enabled
.HS 27 entry length
.DA #C3 destroy, rename, read enabled
.HS 27 entry length
.HS 0D
.HS 0000
.HS 0300 block 3
.HS 7F 128 blocks
.HS 0300 block 3
.HS 7F 128 blocks
exitcard .EQ *-ofsR0
lda ramin restore language card
lda ramin
pla get 80store
bpl L52EA 80store wasn't on
sta store80on enable 80store
L52EA jmp bypass jump around passit
lda ramin restore language card
lda ramin
pla get 80store
bpl L52EA 80store wasn't on
sta store80on enable 80store
L52EA jmp bypass jump around passit
passit .EQ *-ofsR0
.HS 0000
.HS 0000
bypass .EQ *-ofsR0
lda #noerr set up return to noerr
sta passit
lda /noerr
ex1 .EQ *-ofsR0
sta passit+1 also used by blockwrite
clc transfer card to main
clv use standard zeropage/stack
jmp xfer jmp back from language card.
sta passit+1 also used by blockwrite
clc transfer card to main
clv use standard zeropage/stack
jmp xfer jmp back from language card.
* NOTE: the previous section of code MUST NOT use $3FE or $3FF
* since the interrupt vector must go there if aux interrupts
* are to be used. no room for expansion here !!
* since the interrupt vector must go there if aux interrupts
* are to be used. no room for expansion here !!
.HS 0000 $3FE-$3FF
.HS 0000 $3FE-$3FF
* end of obj ram_0
*--------------------------------------

View File

@ -11,307 +11,307 @@ NEW
ofsS .EQ disp1obj-dispadr offset to dispatcher org
disp1obj lda romin read ROM
sta clr80vid disable 80 col hardware
sta clraltchar normal LC, flashing UC
sta store80off disable 80 column store
jsr setnorm set normal text mode
jsr init init text screen
jsr setvid reset output to screen
jsr setkbd reset input to keyboard
ldx #$17 clear the memory bitmap
lda #$01 but protect page $BF00.
sta memmap,x P8 memory bitmap
dex
lda #$00
L5A22 sta memmap,x
dex
bpl L5A22
lda #$CF protect zero page, stack and
sta memmap $400-$7FF (text screen display)
L5A2D jsr home clear screen
jsr crout position top/left
ldx #<dsp1msg0-dsp1msgs
jsr prntmsg 'enter prefix...'
lda #$03 line 3
sta cv
jsr crout
jsr MLI get prefix
.DA #$C7'
.DA dsp1pfx'
ldx PrefixBuf get prefix length
lda #$00 put 0 at end of prefix
sta PrefixBuf+1,x
ldx PrefixBuf get length.
beq L5A5D if no prefix to display.
L5A52 lda PrefixBuf,x display prefix directly to screen
ora #$80 normal text
sta vline5-1,x line 5
dex
bne L5A52
L5A5D ldx #$00
dec cv
jsr crout
disp1obj lda romin read ROM
sta clr80vid disable 80 col hardware
sta clraltchar normal LC, flashing UC
sta store80off disable 80 column store
jsr setnorm set normal text mode
jsr init init text screen
jsr setvid reset output to screen
jsr setkbd reset input to keyboard
ldx #$17 clear the memory bitmap
lda #$01 but protect page $BF00.
sta memmap,x P8 memory bitmap
dex
lda #$00
L5A22 sta memmap,x
dex
bpl L5A22
lda #$CF protect zero page, stack and
sta memmap $400-$7FF (text screen display)
L5A2D jsr home clear screen
jsr crout position top/left
ldx #<dsp1msg0-dsp1msgs
jsr prntmsg 'enter prefix...'
lda #$03 line 3
sta cv
jsr crout
jsr MLI get prefix
.DA #$C7'
.DA dsp1pfx'
ldx PrefixBuf get prefix length
lda #$00 put 0 at end of prefix
sta PrefixBuf+1,x
ldx PrefixBuf get length.
beq L5A5D if no prefix to display.
L5A52 lda PrefixBuf,x display prefix directly to screen
ora #$80 normal text
sta vline5-1,x line 5
dex
bne L5A52
L5A5D ldx #$00
dec cv
jsr crout
getkey .EQ *-ofsS
jsr rdkey input char with cursor
cmp #$8D cr ?
beq L5ABD yes, accept what is entered.
pha no, save the char.
jsr clreol clear rest of line.
pla get char back
cmp #$9B esc ?
beq L5A2D yes, start over
cmp #$98 ctrl-x ?
L5A76 beq L5A2D then start over
cmp #$89 tab ?
beq badkey
cmp #$FF delete ?
beq L5A84 if yes
cmp #$88 backspace ?
bne L5A91 if not
L5A84 cpx #$00 at column 0 ?
beq L5A8B if so, do nothing
dec ch else move left
dex dec char count
L5A8B jsr clreol clear rest of line
jmp getkey get another char
L5A91 bcs L5A99
badkey jsr bell output bell for bad key
jmp getkey and get another.
L5A99 cmp #$DB below 'Z' ?
bcc L5A9F if yes
and #$DF else shift to uppercase.
L5A9F cmp #$AE below '.' ?
bcc badkey
cmp #$DB above 'Z' ?
bcs badkey
cmp #$BA below ':' ?
bcc goodkey
cmp #$C1 at or above 'A' ?
bcc badkey
jsr rdkey input char with cursor
cmp #$8D cr ?
beq L5ABD yes, accept what is entered.
pha no, save the char.
jsr clreol clear rest of line.
pla get char back
cmp #$9B esc ?
beq L5A2D yes, start over
cmp #$98 ctrl-x ?
L5A76 beq L5A2D then start over
cmp #$89 tab ?
beq badkey
cmp #$FF delete ?
beq L5A84 if yes
cmp #$88 backspace ?
bne L5A91 if not
L5A84 cpx #$00 at column 0 ?
beq L5A8B if so, do nothing
dec ch else move left
dex dec char count
L5A8B jsr clreol clear rest of line
jmp getkey get another char
L5A91 bcs L5A99
badkey jsr bell output bell for bad key
jmp getkey and get another.
L5A99 cmp #$DB below 'Z' ?
bcc L5A9F if yes
and #$DF else shift to uppercase.
L5A9F cmp #$AE below '.' ?
bcc badkey
cmp #$DB above 'Z' ?
bcs badkey
cmp #$BA below ':' ?
bcc goodkey
cmp #$C1 at or above 'A' ?
bcc badkey
goodkey inx
cpx #$27 more than 39 chars ?
bcs L5A76 then too many, go restart.
sta PrefixBuf,x save it
jsr cout
jmp getkey get another.
L5ABD cpx #$00 prefix length = 0 ?
beq L5AD3 if yes, don't set length.
stx PrefixBuf set prefix length.
jsr MLI call mli to set prefix.
.DA #$C6'
.DA dsp1pfx'
bcc L5AD3 if ok, go get filename.
jsr bell if not, ring bell
lda #$00 and try again for prefix.
L5AD1 beq L5A76
L5AD3 jsr home clear screen for application name.
jsr crout
ldx #<disp1msg-dsp1msgs
jsr prntmsg 'enter pathname...'
cpx #$27 more than 39 chars ?
bcs L5A76 then too many, go restart.
sta PrefixBuf,x save it
jsr cout
jmp getkey get another.
L5ABD cpx #$00 prefix length = 0 ?
beq L5AD3 if yes, don't set length.
stx PrefixBuf set prefix length.
jsr MLI call mli to set prefix.
.DA #$C6'
.DA dsp1pfx'
bcc L5AD3 if ok, go get filename.
jsr bell if not, ring bell
lda #$00 and try again for prefix.
L5AD1 beq L5A76
L5AD3 jsr home clear screen for application name.
jsr crout
ldx #<disp1msg-dsp1msgs
jsr prntmsg 'enter pathname...'
retryrich .EQ *-ofsS
lda #$03 line 3
sta cv
jsr crout
ldx #$00
lda #$03 line 3
sta cv
jsr crout
ldx #$00
loop1 .EQ *-ofsS
jsr rdkey input char with cursor.
cmp #$9B esc ?
bne L5AF4 if not esc.
lda ch esc pressed in column 0 ?
bne L5AD3 if not, get pathname again.
beq L5AD1 if so, get prefix again.
L5AF4 cmp #$98 ctrl-x ?
L5AF6 beq L5AD3 then cancel and get pathname again.
cmp #$89 tab ?
beq L5B09 not good.
cmp #$FF delete ?
beq L5B04 delete char.
cmp #$88 backspace ?
bne L5B07
L5B04 jmp delchar delete char.
L5B07 bcs L5B0F if > $88 then char may be acceptable.
L5B09 jsr bell output bell (ctl-G)
jmp loop1 not good.
L5B0F cmp #$8D cr ?
beq L5B3C then done.
cmp #$DB less than 'Z' ?
bcc L5B19 no.
and #$DF make sure it's uppercase.
L5B19 cmp #$AE '.' ?
bcc L5B09 not good if less.
cmp #$DB less than '[' ?
bcs L5B09 not good.
cmp #$BA <= '9' ?
bcc L5B29 then ok.
cmp #$C1 greater than 'A' ?
bcc L5B09 if not, then no good.
L5B29 pha it's good, save it.
jsr clreol clear to end of line
pla
jsr cout print it
inx
cpx #$27 more than 39 chars ?
bcs L5AF6 too long, get pathname again.
sta PrefixBuf,x store it.
jmp loop1 get another char
L5B3C lda #$A0
jsr cout after cr, blank out the cursor.
stx PrefixBuf put length in front of the name.
jsr MLI get file info for pathname in PrefixBuf
.DA #$C4'
.DA dsp1info'
bcc L5B4F if no errors.
jmp dsp1error
L5B4F lda dsp1type
cmp #$FF is it a SYS file ?
beq L5B5B yes.
lda #$01 not SYS file error.
jmp dsp1error
L5B5B lda #$00 it's a system file
sta dsp1cln
jsr MLI close all open files
.DA #$CC'
.DA dsp1cls'
bcc L5B6B
jmp dsp1error
L5B6B lda dsp1acess check for proper access.
and #$01 is read disabled ?
bne L5B77 no, access ok.
lda #$27 i/o error
jmp dsp1error
L5B77 jsr MLI open the file
.DA #$C8'
.DA dsp1open'
bcc L5B82
jmp dsp1error
L5B82 lda dsp1refn copy the reference number
sta dsp1rdn
sta dsp1eofn
jsr MLI get eof
.DA #$D1'
.DA dsp1eof'
bcs L5BE2
lda dsp1eofb+2 3rd of 3 bytes.
beq L5B9C if 0 then ok
lda #$27 else i/o error because
bne L5BE2 file is too large.
L5B9C lda dsp1eofb move eof to # of bytes to read.
sta dsp1cnt
lda dsp1eofb+1
sta dsp1cnt+1
jsr MLI read the file
.DA #$CA'
.DA dsp1read'
php save the status.
jsr MLI close the file.
.DA #$CC'
.DA dsp1cls'
bcc L5BBB
L5BB7 plp get status (it is irrelevant now)
bne L5BE2 if close generated an error
plp here if close was ok.
L5BBB bcs L5BB7 error.
jmp sysentry execute system file
jsr rdkey input char with cursor.
cmp #$9B esc ?
bne L5AF4 if not esc.
lda ch esc pressed in column 0 ?
bne L5AD3 if not, get pathname again.
beq L5AD1 if so, get prefix again.
L5AF4 cmp #$98 ctrl-x ?
L5AF6 beq L5AD3 then cancel and get pathname again.
cmp #$89 tab ?
beq L5B09 not good.
cmp #$FF delete ?
beq L5B04 delete char.
cmp #$88 backspace ?
bne L5B07
L5B04 jmp delchar delete char.
L5B07 bcs L5B0F if > $88 then char may be acceptable.
L5B09 jsr bell output bell (ctl-G)
jmp loop1 not good.
L5B0F cmp #$8D cr ?
beq L5B3C then done.
cmp #$DB less than 'Z' ?
bcc L5B19 no.
and #$DF make sure it's uppercase.
L5B19 cmp #$AE '.' ?
bcc L5B09 not good if less.
cmp #$DB less than '[' ?
bcs L5B09 not good.
cmp #$BA <= '9' ?
bcc L5B29 then ok.
cmp #$C1 greater than 'A' ?
bcc L5B09 if not, then no good.
L5B29 pha it's good, save it.
jsr clreol clear to end of line
pla
jsr cout print it
inx
cpx #$27 more than 39 chars ?
bcs L5AF6 too long, get pathname again.
sta PrefixBuf,x store it.
jmp loop1 get another char
L5B3C lda #$A0
jsr cout after cr, blank out the cursor.
stx PrefixBuf put length in front of the name.
jsr MLI get file info for pathname in PrefixBuf
.DA #$C4'
.DA dsp1info'
bcc L5B4F if no errors.
jmp dsp1error
L5B4F lda dsp1type
cmp #$FF is it a SYS file ?
beq L5B5B yes.
lda #$01 not SYS file error.
jmp dsp1error
L5B5B lda #$00 it's a system file
sta dsp1cln
jsr MLI close all open files
.DA #$CC'
.DA dsp1cls'
bcc L5B6B
jmp dsp1error
L5B6B lda dsp1acess check for proper access.
and #$01 is read disabled ?
bne L5B77 no, access ok.
lda #$27 i/o error
jmp dsp1error
L5B77 jsr MLI open the file
.DA #$C8'
.DA dsp1open'
bcc L5B82
jmp dsp1error
L5B82 lda dsp1refn copy the reference number
sta dsp1rdn
sta dsp1eofn
jsr MLI get eof
.DA #$D1'
.DA dsp1eof'
bcs L5BE2
lda dsp1eofb+2 3rd of 3 bytes.
beq L5B9C if 0 then ok
lda #$27 else i/o error because
bne L5BE2 file is too large.
L5B9C lda dsp1eofb move eof to # of bytes to read.
sta dsp1cnt
lda dsp1eofb+1
sta dsp1cnt+1
jsr MLI read the file
.DA #$CA'
.DA dsp1read'
php save the status.
jsr MLI close the file.
.DA #$CC'
.DA dsp1cls'
bcc L5BBB
L5BB7 plp get status (it is irrelevant now)
bne L5BE2 if close generated an error
plp here if close was ok.
L5BBB bcs L5BB7 error.
jmp sysentry execute system file
delchar .EQ *-ofsS
lda ch is cursor in column 0 ?
beq L5BD3 yes, ignore it.
dex
lda #$A0 blank out the cursor
jsr cout
dec ch
dec ch point to last char entered
jsr cout and blank it too.
dec ch point to that location.
L5BD3 jmp loop1 get next char.
lda ch is cursor in column 0 ?
beq L5BD3 yes, ignore it.
dex
lda #$A0 blank out the cursor
jsr cout
dec ch
dec ch point to last char entered
jsr cout and blank it too.
dec ch point to that location.
L5BD3 jmp loop1 get next char.
prntmsg .EQ *-ofsS
L5BD6 lda dsp1msgs,x
beq L5BE1
jsr cout
inx
bne L5BD6
L5BE1 rts
L5BD6 lda dsp1msgs,x
beq L5BE1
jsr cout
inx
bne L5BD6
L5BE1 rts
* dispatcher 1 error handler
dsp1error .EQ *-ofsS
L5BE2 sta errnum
lda #$0C display error message on line 13
sta cv
jsr crout
lda errnum
cmp #$01
bne L5BF5
ldx #<dsp1err1-dsp1msgs not a type 'sys' file
bne L5C0B handled separately.
L5BF5 cmp #$40 syntax error in pathname ?
beq L5C09
cmp #$44 bad subdirectory path ?
beq L5C09
cmp #$45 volume not found ?
beq L5C09
cmp #$46 file not found ?
beq L5C09
ldx #<dsp1err2-dsp1msgs if not the errors above then 'i/o error'
bne L5C0B
L5C09 ldx #<dsp1err3-dsp1msgs otherwise display 'file/path not found'
L5C0B jsr prntmsg
jmp retryrich retry for application pathname
L5BE2 sta errnum
lda #$0C display error message on line 13
sta cv
jsr crout
lda errnum
cmp #$01
bne L5BF5
ldx #<dsp1err1-dsp1msgs not a type 'sys' file
bne L5C0B handled separately.
L5BF5 cmp #$40 syntax error in pathname ?
beq L5C09
cmp #$44 bad subdirectory path ?
beq L5C09
cmp #$45 volume not found ?
beq L5C09
cmp #$46 file not found ?
beq L5C09
ldx #<dsp1err2-dsp1msgs if not the errors above then 'i/o error'
bne L5C0B
L5C09 ldx #<dsp1err3-dsp1msgs otherwise display 'file/path not found'
L5C0B jsr prntmsg
jmp retryrich retry for application pathname
msb on
dsp1msgs .EQ *-ofsS
dsp1msg0 .EQ *-ofsS
dc c'ENTER PREFIX (PRESS "RETURN" TO ACCEPT)'
.HS 00
dc c'ENTER PREFIX (PRESS "RETURN" TO ACCEPT)'
.HS 00
disp1msg .EQ *-ofsS
dc c'ENTER PATHNAME OF NEXT APPLICATION'
.HS 00
dc c'ENTER PATHNAME OF NEXT APPLICATION'
.HS 00
dsp1err1 .EQ *-ofsS
.DA #87'
dc c'NOT A TYPE "SYS" FILE'
.HS 00
.DA #87'
dc c'NOT A TYPE "SYS" FILE'
.HS 00
dsp1err2 .EQ *-ofsS
.DA #87'
dc c'I/O ERROR '
.HS 00
.DA #87'
dc c'I/O ERROR '
.HS 00
dsp1err3 .EQ *-ofsS
.DA #87'
dc c'FILE/PATH NOT FOUND '
.HS 00
.DA #87'
dc c'FILE/PATH NOT FOUND '
.HS 00
dsp1info .EQ *-ofsS get file info parms
.DA #0A' 10 parameters
.DA PrefixBuf' pathname buffer
.DA #0A' 10 parameters
.DA PrefixBuf' pathname buffer
dsp1acess .EQ *-ofsS
.HS 00 access
.HS 00 access
dsp1type .EQ *-ofsS
.HS 00 file type
ds 13 the rest are unimportant
dsp1open .EQ *-ofsS open file parms
.HS 00 file type
ds 13 the rest are unimportant
dsp1open .EQ *-ofsS open file parms
dc h'03' 3 parameters for open
.DA PrefixBuf' pathname buffer
.DA fbuf' fcb buffer
.DA PrefixBuf' pathname buffer
.DA fbuf' fcb buffer
dsp1refn .EQ *-ofsS
.HS 00 reference #
.HS 00 reference #
dsp1cls .EQ *-ofsS close file parms
.DA #01' 1 parameter for close
.DA #01' 1 parameter for close
dsp1cln .EQ *-ofsS
.HS 00 reference #
.HS 00 reference #
dsp1read .EQ *-ofsS
dc h'04' 4 parameters for read
dsp1rdn .EQ *-ofsS
.HS 00 reference #
.DA sysentry' .SYS load address
.HS 00 reference #
.DA sysentry' .SYS load address
dsp1cnt .EQ *-ofsS
.HS 0000 byte count
.HS 0000
.HS 0000
dsp1eof .EQ *-ofsS get eof parms
dc h'02' 2 parameters
dsp1eofn .EQ *-ofsS
.HS 00 reference #
.HS 00 reference #
dsp1eofb .EQ *-ofsS
dc h'000000' 3 byte eof
dsp1pfx .EQ *-ofsS get/set prefix parms
.DA #01' 1 parameter
.DA PrefixBuf' prefix buffer
dsp1pfx .EQ *-ofsS get/set prefix parms
.DA #01' 1 parameter
.DA PrefixBuf' prefix buffer
disp1end .EQ *
ds $300-(disp1end-disp1obj) fill to page boundary

View File

@ -6,419 +6,419 @@ NEW
ofsB .EQ birdbye-dispadr offset to Bird's Bye org
birdbye cld
lda romin read ROM
stz softev
lda #>dispadr set reset vector to 'dispadr'
sta softev+1
jsr setpwrc create power-up byte
lda #$A0
jsr init80 initialize 80 column text card
ldx #$17
lda romin read ROM
stz softev
lda #>dispadr set reset vector to 'dispadr'
sta softev+1
jsr setpwrc create power-up byte
lda #$A0
jsr init80 initialize 80 column text card
ldx #$17
* set up memory bitmap in global page
L5D16 stz memmap,x P8 memory bitmap
dex
bpl L5D16
inc memmap+$17 protect global page
lda #$CF protect zero page, stack and page 1
sta memmap
lda #$02
sta smparms init set mark parms pcount.
L5D16 stz memmap,x P8 memory bitmap
dex
bpl L5D16
inc memmap+$17 protect global page
lda #$CF protect zero page, stack and page 1
sta memmap
lda #$02
sta smparms init set mark parms pcount.
* drive selector
ldx numdevs get device count and
stx lstpntr store in zero page.
lda devnum get last slot/drive
bne volname
ldx numdevs get device count and
stx lstpntr store in zero page.
lda devnum get last slot/drive
bne volname
ds2 .EQ *-ofsB
L5D32 ldx lstpntr get device list pointer.
lda devlist,x get unit number from list.
cpx #$01 make sure it's real.
bcs L5D3F if so, change list pointer.
ldx numdevs get device count.
inx
L5D3F dex decrement list pointer and restore.
stx lstpntr
L5D32 ldx lstpntr get device list pointer.
lda devlist,x get unit number from list.
cpx #$01 make sure it's real.
bcs L5D3F if so, change list pointer.
ldx numdevs get device count.
inx
L5D3F dex decrement list pointer and restore.
stx lstpntr
* get and store volume name
volname sta ol_unit store unit number for online.
jsr MLI
.DA #$C5' online call
.DA ol_parms'
bcs L5D32 error check.
stz dlevel haven't read root directory yet.
lda PrefixBuf+1 load description byte.
and #$0F mask for name length.
beq L5D32 if 0, then try next unit.
adc #$02 add 2 to length.
tax name length in x.
volname sta ol_unit store unit number for online.
jsr MLI
.DA #$C5' online call
.DA ol_parms'
bcs L5D32 error check.
stz dlevel haven't read root directory yet.
lda PrefixBuf+1 load description byte.
and #$0F mask for name length.
beq L5D32 if 0, then try next unit.
adc #$02 add 2 to length.
tax name length in x.
vnam1 .EQ *-ofsB
stx PrefixBuf save the name length
lda #$2F '/'
sta PrefixBuf+1 slash before and
sta PrefixBuf,x after name.
stz PrefixBuf+1,x null after complete name.
stx PrefixBuf save the name length
lda #$2F '/'
sta PrefixBuf+1 slash before and
sta PrefixBuf,x after name.
stz PrefixBuf+1,x null after complete name.
* open and read directory
jsr MLI
.DA #$C8' open
.DA op_parms'
bcc L5D7F good open.
lda dlevel trying to open root directory ?
beq L5D32 yes, just move to next volume.
jsr bell1 no, generate bell tone
jsr popdir and stay at same level.
stx PrefixBuf
jmp keyloop
L5D7F inc dlevel
stz filecount zero file count.
lda op_refn get file reference number
sta rd_refn store in read
sta sm_refn and setmark parm lists.
lda #$2B set read parm list for
sta dhdr_len directory header length.
stz dhdr_len+1
jsr doread read directory
bcs L5DB3
ldx #$03
L5D9A lda sysentry+$23,x copy directory info
sta entlen,x to zero page.
dex
bpl L5D9A
sta dhdr_len put entry length in read parm list.
lda #$01 set block file counter to 1.
sta blkfl
stz fpos_mid zero out msb's of file position
stz fpos_hi in setmark parm list.
lda filecnt any files in directory ?
ora filecnt+1
bne L5DB5 if so, continue
L5DB3 bra L5E29 else go close directory file.
L5DB5 bit filecnt+1 check msb of file count.
bmi L5DB3 if set then done.
L5DB9 lda fpos_mid get mid byte of setmark file position.
and #$FE reset lsb
sta fpos_mid and save.
ldy blkfl block file counter
lda #$00
cpy entblk have we read all entries in this block ?
bcc L5DCE if not, continue.
tay if so, zero y-reg and
sty blkfl reset block counter / flag
inc fpos_mid
jsr MLI
.DA #$C8' open
.DA op_parms'
bcc L5D7F good open.
lda dlevel trying to open root directory ?
beq L5D32 yes, just move to next volume.
jsr bell1 no, generate bell tone
jsr popdir and stay at same level.
stx PrefixBuf
jmp keyloop
L5D7F inc dlevel
stz filecount zero file count.
lda op_refn get file reference number
sta rd_refn store in read
sta sm_refn and setmark parm lists.
lda #$2B set read parm list for
sta dhdr_len directory header length.
stz dhdr_len+1
jsr doread read directory
bcs L5DB3
ldx #$03
L5D9A lda sysentry+$23,x copy directory info
sta entlen,x to zero page.
dex
bpl L5D9A
sta dhdr_len put entry length in read parm list.
lda #$01 set block file counter to 1.
sta blkfl
stz fpos_mid zero out msb's of file position
stz fpos_hi in setmark parm list.
lda filecnt any files in directory ?
ora filecnt+1
bne L5DB5 if so, continue
L5DB3 bra L5E29 else go close directory file.
L5DB5 bit filecnt+1 check msb of file count.
bmi L5DB3 if set then done.
L5DB9 lda fpos_mid get mid byte of setmark file position.
and #$FE reset lsb
sta fpos_mid and save.
ldy blkfl block file counter
lda #$00
cpy entblk have we read all entries in this block ?
bcc L5DCE if not, continue.
tay if so, zero y-reg and
sty blkfl reset block counter / flag
inc fpos_mid
* set up setmark parameters for next file to be read.
* if transfer to second sector, handle it.
L5DCC inc fpos_mid
L5DCE dey decrement file block counter
clc
bmi L5DD8
adc entlen add entry length to acc.
bcc L5DCE determine if we flopped into 2nd half of
bcs L5DCC block, if so inc mid byte position.
L5DD8 adc #$04 add 4 and put in
sta fpos_lo low byte of setmark.
jsr MLI call mli
.DA #$CE' set mark
.DA #smparms' parameters address = $0060
.HS 00
bcs L5DB3 error
jsr doread
bcs L5DB3 error.
inc blkfl increase count of files read.
lda sysentry file type/length.
and #$F0 mask off high nibble.
beq L5DB9 deleted file, try next one.
dec filecnt decrement low file count.
bne L5DF8
dec filecnt+1 and high if necessary.
L5DF8 ror sysentry+$1E check access bit.
bcc L5DB5 if no read, try next file.
lda sysentry+$10 get file type.
cmp #$0F directory file ?
beq L5E08 then continue.
cmp #$FF system file ?
bne L5DB5 no, read next file.
L5E08 ldx filecount get valid files read.
cpx #$80 if greater than size of filename buffer
bcs L5E29 then close directory
sta filetyps,x else store filetype in zero page
jsr namecalc and go set up storage area.
ldy #$0F
L5E15 lda sysentry,y get byte of filename
sta (fnstore),y store in directed area
dey
bpl L5E15
iny y = 0
and #$0F mask off low nibble (name length)
sta (fnstore),y restore in name buffer
inc filecount increment valid file counter
bne L5DB5 get next file (branch always)
L5E26 jmp ds2 error. try next unit.
L5E29 jsr MLI close directory file
.DA #$CC'
.DA cl_parms'
bcs L5E26 error.
jsr settxt use full screen for windows
jsr home
lda #$17 cursor at bottom of screen.
jsr tabv set vertical position.
ldy #$00
lda #$14 horizontal position.
jsr sethorz print message.
jsr homecurs cursor to upper/left.
ldx #$00
L5E48 lda PrefixBuf+1,x
beq showfiles
jsr output
inx
bne L5E48
L5DCC inc fpos_mid
L5DCE dey decrement file block counter
clc
bmi L5DD8
adc entlen add entry length to acc.
bcc L5DCE determine if we flopped into 2nd half of
bcs L5DCC block, if so inc mid byte position.
L5DD8 adc #$04 add 4 and put in
sta fpos_lo low byte of setmark.
jsr MLI call mli
.DA #$CE' set mark
.DA #smparms' parameters address = $0060
.HS 00
bcs L5DB3 error
jsr doread
bcs L5DB3 error.
inc blkfl increase count of files read.
lda sysentry file type/length.
and #$F0 mask off high nibble.
beq L5DB9 deleted file, try next one.
dec filecnt decrement low file count.
bne L5DF8
dec filecnt+1 and high if necessary.
L5DF8 ror sysentry+$1E check access bit.
bcc L5DB5 if no read, try next file.
lda sysentry+$10 get file type.
cmp #$0F directory file ?
beq L5E08 then continue.
cmp #$FF system file ?
bne L5DB5 no, read next file.
L5E08 ldx filecount get valid files read.
cpx #$80 if greater than size of filename buffer
bcs L5E29 then close directory
sta filetyps,x else store filetype in zero page
jsr namecalc and go set up storage area.
ldy #$0F
L5E15 lda sysentry,y get byte of filename
sta (fnstore),y store in directed area
dey
bpl L5E15
iny y = 0
and #$0F mask off low nibble (name length)
sta (fnstore),y restore in name buffer
inc filecount increment valid file counter
bne L5DB5 get next file (branch always)
L5E26 jmp ds2 error. try next unit.
L5E29 jsr MLI close directory file
.DA #$CC'
.DA cl_parms'
bcs L5E26 error.
jsr settxt use full screen for windows
jsr home
lda #$17 cursor at bottom of screen.
jsr tabv set vertical position.
ldy #$00
lda #$14 horizontal position.
jsr sethorz print message.
jsr homecurs cursor to upper/left.
ldx #$00
L5E48 lda PrefixBuf+1,x
beq showfiles
jsr output
inx
bne L5E48
showfiles stz valcnt
stz topname init top filename index.
lda filecount # of valid files.
beq L5EB0 if no files.
cmp #$15 more than what will fit on screen ?
bcc L5E61 no.
lda #$14 limit to 20 files on the screen.
L5E61 sta gp_cnt
lda #$02 set window dimensions
sta wndtop
sta wndlft
lda #$16
sta wndwdth
sta wndbtm
L5E6F jsr nameprnt output filename to screen
inc valcnt
dec gp_cnt file counter.
bne L5E6F continue printing names.
stz valcnt
beq L5EAA if last file, it needs to be inverse.
stz topname init top filename index.
lda filecount # of valid files.
beq L5EB0 if no files.
cmp #$15 more than what will fit on screen ?
bcc L5E61 no.
lda #$14 limit to 20 files on the screen.
L5E61 sta gp_cnt
lda #$02 set window dimensions
sta wndtop
sta wndlft
lda #$16
sta wndwdth
sta wndbtm
L5E6F jsr nameprnt output filename to screen
inc valcnt
dec gp_cnt file counter.
bne L5E6F continue printing names.
stz valcnt
beq L5EAA if last file, it needs to be inverse.
uparrow jsr nameprnt print old name in normal.
ldx valcnt get old name number.
beq L5EAA if already at the top name
dec valcnt else fix index.
lda cv current cursor line.
cmp #$02 at top line of window ?
bne L5EAA no, move up normally.
dec topname fix offset index
lda #$16 else sroll windows down a line.
bne L5EA7 branch always.
ldx valcnt get old name number.
beq L5EAA if already at the top name
dec valcnt else fix index.
lda cv current cursor line.
cmp #$02 at top line of window ?
bne L5EAA no, move up normally.
dec topname fix offset index
lda #$16 else sroll windows down a line.
bne L5EA7 branch always.
dnarrow jsr nameprnt print old name in normal.
ldx valcnt get old name number.
inx add one.
cpx filecount
bcs L5EAA if already at last filename
stx valcnt else update index.
lda cv current cursor line.
cmp #$15 at bottom line of window ?
bne L5EAA no, move cursor normally.
inc topname update offset index
lda #$17 else scroll up a line.
L5EA7 jsr cout
L5EAA jsr setinv set inverse text mode.
jsr nameprnt output last filename.
ldx valcnt get old name number.
inx add one.
cpx filecount
bcs L5EAA if already at last filename
stx valcnt else update index.
lda cv current cursor line.
cmp #$15 at bottom line of window ?
bne L5EAA no, move cursor normally.
inc topname update offset index
lda #$17 else scroll up a line.
L5EA7 jsr cout
L5EAA jsr setinv set inverse text mode.
jsr nameprnt output last filename.
keyloop .EQ *-ofsB
L5EB0 lda kbd get keyboard input.
bpl L5EB0 loop until key pressed.
sta kbdstrobe clear strobe.
jsr setnorm set normal text mode.
ldx filecount are any files displayed ?
beq L5ECB no, don't accept arrow keys or return.
cmp #$8D return ?
beq L5EF4 then run selected file.
cmp #$8A down ?
beq dnarrow move down a name.
cmp #$8B up ?
beq uparrow move up a name.
L5ECB cmp #$89 tab ?
beq L5EED new volume.
cmp #$9B esc ?
bne L5EB0 no, try again else pop up a directory.
L5EB0 lda kbd get keyboard input.
bpl L5EB0 loop until key pressed.
sta kbdstrobe clear strobe.
jsr setnorm set normal text mode.
ldx filecount are any files displayed ?
beq L5ECB no, don't accept arrow keys or return.
cmp #$8D return ?
beq L5EF4 then run selected file.
cmp #$8A down ?
beq dnarrow move down a name.
cmp #$8B up ?
beq uparrow move up a name.
L5ECB cmp #$89 tab ?
beq L5EED new volume.
cmp #$9B esc ?
bne L5EB0 no, try again else pop up a directory.
* pop a directory level
jsr popdir
dec dlevel
bra L5EF1
jsr popdir
dec dlevel
bra L5EF1
popdir .EQ *-ofsB
ldx PrefixBuf
L5EDD dex
lda PrefixBuf,x
cmp #$2F slash
bne L5EDD
cpx #$01
bne L5EEC
ldx PrefixBuf
L5EEC rts
L5EED jmp ds2 set up new unit number.
L5EF0 inx
L5EF1 jmp vnam1 get new directory info.
ldx PrefixBuf
L5EDD dex
lda PrefixBuf,x
cmp #$2F slash
bne L5EDD
cpx #$01
bne L5EEC
ldx PrefixBuf
L5EEC rts
L5EED jmp ds2 set up new unit number.
L5EF0 inx
L5EF1 jmp vnam1 get new directory info.
* run selected file
L5EF4 jsr MLI set prefix
.DA #$C6'
.DA pf_parms'
bcs L5EED error.
ldx valcnt get name number.
jsr namecalc set up name storage area (on return y=0)
ldx PrefixBuf get prefix length.
L5F04 iny start at y = 1.
lda (fnstore),y get character of name.
inx
sta PrefixBuf,x store in prefix buffer.
cpy namelen check length of name.
bcc L5F04 loop until all transferred.
stx PrefixBuf put prefix length into buffer.
ldy valcnt get file number.
lda |filetyps,y get file type.
bpl L5EF0 branch if directory.
jsr settxt reset to full window.
jsr home makes for no flash.
lda #$95 ctrl-u
jsr cout turn off 80 columns.
jsr MLI open file
.DA #$C8'
.DA op_parms'
bcs L5EED if error.
lda op_refn move reference number
sta rd_refn for read.
lda #$FF read the entire file.
sta dhdr_len
sta dhdr_len+1
jsr doread read selected file.
php save possible error.
jsr MLI close file. ignore any error from close
.DA #$CC'
.DA cl_parms'
plp restore status from read.
bcs L5EED if any errors.
jmp sysentry execute selected system file.
L5EF4 jsr MLI set prefix
.DA #$C6'
.DA pf_parms'
bcs L5EED error.
ldx valcnt get name number.
jsr namecalc set up name storage area (on return y=0)
ldx PrefixBuf get prefix length.
L5F04 iny start at y = 1.
lda (fnstore),y get character of name.
inx
sta PrefixBuf,x store in prefix buffer.
cpy namelen check length of name.
bcc L5F04 loop until all transferred.
stx PrefixBuf put prefix length into buffer.
ldy valcnt get file number.
lda |filetyps,y get file type.
bpl L5EF0 branch if directory.
jsr settxt reset to full window.
jsr home makes for no flash.
lda #$95 ctrl-u
jsr cout turn off 80 columns.
jsr MLI open file
.DA #$C8'
.DA op_parms'
bcs L5EED if error.
lda op_refn move reference number
sta rd_refn for read.
lda #$FF read the entire file.
sta dhdr_len
sta dhdr_len+1
jsr doread read selected file.
php save possible error.
jsr MLI close file. ignore any error from close
.DA #$CC'
.DA cl_parms'
plp restore status from read.
bcs L5EED if any errors.
jmp sysentry execute selected system file.
* output messages. on entry: acc = horizontal position,
* y = index to message teminated by 0.
sethorz .EQ *-ofsB
sta ch
sta ch
msgout .EQ *-ofsB
L5F4C lda dsp2msg,y
beq L5F57
jsr cout
iny
bne L5F4C
L5F57 rts
L5F4C lda dsp2msg,y
beq L5F57
jsr cout
iny
bne L5F4C
L5F57 rts
* name pointer calculator for name storage area
namecalc .EQ *-ofsB
stz fnstore+1 init high byte of 16-bit shift
txa
asl a shift to high nibble
rol fnstore+1
asl a
rol fnstore+1
asl a
rol fnstore+1
asl a
rol fnstore+1
sta fnstore low pointer
lda #>iobuf
clc
adc fnstore+1
sta fnstore+1
ldy #$00
lda (fnstore),y file name length
sta namelen
rts
stz fnstore+1 init high byte of 16-bit shift
txa
asl shift to high nibble
rol fnstore+1
asl
rol fnstore+1
asl
rol fnstore+1
asl
rol fnstore+1
sta fnstore low pointer
lda #>iobuf
clc
adc fnstore+1
sta fnstore+1
ldy #$00
lda (fnstore),y file name length
sta namelen
rts
* output a filename line
nameprnt .EQ *-ofsB
lda #$02
sta ch80col horizontal position = 2.
ldx valcnt filename number
txa
sec
sbc topname calculate line # to display name
inc a
inc a
jsr tabv set vertical position.
lda filetyps,x get filetype (x is unchanged by tabv).
bmi L5F99 branch if system file.
stz ch80col adjust cursor position.
lda invflg save current inverse setting
pha
ldy #<fldrmsg-dsp2msg
jsr msgout display the folder.
pla restore inverse setting.
sta invflg
L5F99 jsr outsp output a space.
jsr namecalc calc name location.
L5F9F iny y = 1 (first time).
lda (fnstore),y get name character.
jsr output put on screen.
cpy namelen end of name ?
bcc L5F9F no.
outsp .EQ *-ofsB output a space.
lda #$A0
bne L5FB1 branch always.
homecurs .EQ *-ofsB screen control - home cursor
lda #$99
lda #$02
sta ch80col horizontal position = 2.
ldx valcnt filename number
txa
sec
sbc topname calculate line # to display name
inc
inc
jsr tabv set vertical position.
lda filetyps,x get filetype (x is unchanged by tabv).
bmi L5F99 branch if system file.
stz ch80col adjust cursor position.
lda invflg save current inverse setting
pha
ldy #<fldrmsg-dsp2msg
jsr msgout display the folder.
pla restore inverse setting.
sta invflg
L5F99 jsr outsp output a space.
jsr namecalc calc name location.
L5F9F iny y = 1 (first time).
lda (fnstore),y get name character.
jsr output put on screen.
cpy namelen end of name ?
bcc L5F9F no.
outsp .EQ *-ofsB output a space.
lda #$A0
bne L5FB1 branch always.
homecurs .EQ *-ofsB screen control - home cursor
lda #$99
output .EQ *-ofsB
ora #$80 set high bit.
L5FB1 jmp cout output to screen.
ora #$80 set high bit.
L5FB1 jmp cout output to screen.
doread .EQ *-ofsB
jsr MLI mli read call
.DA #$CA'
.DA rd_parms'
rts
jsr MLI mli read call
.DA #$CA'
.DA rd_parms'
rts
* data area
dsp2msg .EQ *-ofsB
dc c'RETURN: Select | TAB: Chg Vol | '
dc c'ESC: Back'
.DA #$00'
dc c'RETURN: Select | TAB: Chg Vol | '
dc c'ESC: Back'
.DA #$00'
fldrmsg .EQ *-ofsB
.DA #0F' inverse control code
dc h'1B' enable mousetext
dc c'XY' folder characters
dc h'18' disable mousetext
dc h'0E' normal control code
.HS 00
.DA #0F' inverse control code
dc h'1B' enable mousetext
dc c'XY' folder characters
dc h'18' disable mousetext
dc h'0E' normal control code
.HS 00
op_parms .EQ *-ofsB open parameters
.DA #03' 3 parms
.DA PrefixBuf' pathname
.DA op_buf' file buffer
.DA #03' 3 parms
.DA PrefixBuf' pathname
.DA op_buf' file buffer
op_refn .EQ *-ofsB
.HS 00 reference number
cl_parms .EQ *-ofsB close parameters
dc h'01' 1 parm
.HS 00 reference number.
cl_parms .EQ *-ofsB close parameters
dc h'01' 1 parm
.HS 00 reference number.
ol_parms .EQ *-ofsB online parameters
dc h'02' 2 parms
ol_unit .EQ *-ofsB
dc h'60' unit number, default = s6, d1
.DA PrefixBuf+1' data buffer
.DA PrefixBuf+1' data buffer
pf_parms .EQ *-ofsB set prefix parameters
.DA #01' one parm
.DA PrefixBuf' pathname
rd_parms .EQ *-ofsB read parameters
.DA #04' 4 parms
.DA #01' one parm
.DA PrefixBuf' pathname
rd_parms .EQ *-ofsB read parameters
.DA #04' 4 parms
rd_refn .EQ *-ofsB
dc h'01' reference number
.DA sysentry' data buffer
.DA sysentry' data buffer
* these last 2 parms (4 bytes) may extend past $300 length limit since
* the request count is set prior to using the parm block and the transfer
* count isn't used at all (except by prodos)
* .HS 0000 requested length
* .HS 0000 actual length
* .HS 0000 actual length
dhdr_len .EQ *-ofsB directory header length
.HS 00 (actually uses 2 bytes)

View File

@ -20,8 +20,8 @@ ofsQ .EQ GQdisp-dispadr offset to GQuit dispatcher org
GQdisp lda ramin read/write LC bank 1
clc
xce 16 bit native mode.
jmp >P8QUIT go to GQuit.
.DA #0000000000 offset to paragraph boundary.
jmp >P8QUIT go to GQuit.
.DA #0000000000 offset to paragraph boundary.
.AS "GQ" id bytes so GQuit can identify this
* load application
@ -29,9 +29,9 @@ GQdisp lda ramin read/write LC bank 1
* Entry is in 16-bit native mode. Exit is in emulation mode.
*
* On entry and exit:
* Data bank register is set to $00.
* Direct register is set to $0000.
* Stack pointer is set to $01FB.
* Data bank register is set to $00.
* Direct register is set to $0000.
* Stack pointer is set to $01FB.
*
* Inputs: acc = value of E1_OS_Switch (0 or 1, 1 = yes to switch)
*
@ -43,84 +43,84 @@ GQdisp lda ramin read/write LC bank 1
SHORT M 8 bit accumulator
LONGI ON
pha save the switch status.
pha save the switch status.
ldx #inbuf point to passed prefix.
jsr copyvol copy the name into the buffer.
pla retrieve the switch status
jsr copyvol copy the name into the buffer.
pla retrieve the switch status
* go into emulation mode to load and run Prodos 8 application
sec
xce 8 bit emulation mode
ora #$00 switching from P16 to P8 ?
beq L602D no.
beq L602D no.
* switching from P16 to P8 so pass prefix 0 from P16 to the P8 prefix. the
* prefix is passed at $00/0200 by GQuit.
L6020 jsr MLI set prefix
.DA #$C6
.DA pfxparms
L6020 jsr MLI set prefix
.DA #$C6
.DA pfxparms
bcc L602D if prefix ok.
jsr gqerror error handler.
bra L6020 try again
jsr gqerror error handler.
bra L6020 try again
* load application at $2000
L602D xce native mode (carry clear)
LONG I 16 bit regs, 8 bit acc.
lda PrefixBuf+1 is the application name
cmp #$2F a complete pathname ?
bne L603D no, use prefix as volume name
ldx #PrefixBuf else use the application name.
jsr copyvol copy the volume name to buffer.
L603D sec back to emulation mode.
L602D xce native mode (carry clear)
LONG I 16 bit regs, 8 bit acc.
lda PrefixBuf+1 is the application name
cmp #$2F a complete pathname ?
bne L603D no, use prefix as volume name
ldx #PrefixBuf else use the application name.
jsr copyvol copy the volume name to buffer.
L603D sec back to emulation mode.
xce
L603F jsr MLI open the application file
.DA #$C8
.DA opnparms
bcc L604C if open ok.
jsr gqerror handle error.
bra L603F try again.
L604C lda oprefnum copy ref number to parameter lists
L603F jsr MLI open the application file
.DA #$C8
.DA opnparms
bcc L604C if open ok.
jsr gqerror handle error.
bra L603F try again.
L604C lda oprefnum copy ref number to parameter lists
sta eofrefn
sta rdrefnum
sta closeref
* do a geteof call for how many bytes to read
L6058 jsr MLI get eof
.DA #$D1
.DA eofparms
L6058 jsr MLI get eof
.DA #$D1
.DA eofparms
bcc L6065 eof ok.
jsr gqerror handle error.
bra L6058 try again.
jsr gqerror handle error.
bra L6058 try again.
* store the size of the file in the read parameter list
L6065 lda eofval
L6065 lda eofval
sta rdcount
lda eofval+1
sta rdcount+1
L6071 jsr MLI read
.DA #$CA
.DA readparm
L6071 jsr MLI read
.DA #$CA
.DA readparm
bcc L607E read ok
jsr gqerror
bra L6071
L607E jsr MLI close
.DA #$CC
.DA closeprm
L607E jsr MLI close
.DA #$CC
.DA closeprm
bcc L608B close ok
jsr gqerror
bra L607E
L608B jsr dolaunch check for possible 2nd pathname.
bne L6099 if none then run program
jsr ckfordrv else make sure the file is online.
bcc L6099 if so then run the program.
lda #$45 volume not found error.
L608B jsr dolaunch check for possible 2nd pathname.
bne L6099 if none then run program
jsr ckfordrv else make sure the file is online.
bcc L6099 if so then run the program.
lda #$45 volume not found error.
bra L60AB
L6099 lda romin enable ROM
L6099 lda romin enable ROM
jmp sysentry execute the system application
gqerror .EQ *-ofsQ
@ -128,98 +128,98 @@ gqerror .EQ *-ofsQ
xce 16 bit native mode
LONG I,M
jsr mountvol mount volume.
bcs L60AB if error.
sec back to emulation mode.
bcs L60AB if error.
sec back to emulation mode.
xce
rts
* generate a fatal error while running under Prodos 8.
* on input, acc = error code. this routine does not return.
L60AB clc native mode
L60AB clc native mode
xce
LONG I,M
and #$00FF mask off high byte of error code.
pha put on stack for IntMath tool call.
and #$00FF mask off high byte of error code.
pha put on stack for IntMath tool call.
pea $0000 errval>>16
pea errval push address of string buffer.
pea $0004 make string 4 digits long.
_Int2Hex convert value to hex string.
pha make space for return value.
pea $0000 quitstr1>>16
pea quitstr1 push first error message address
_Int2Hex convert value to hex string.
pha make space for return value.
pea $0000 quitstr1>>16
pea quitstr1 push first error message address
pea $0000 quitstr2>>16
pea quitstr2 push second error message address
pea quitstr2 push second error message address
pea $0000 button1>>16
pea button1 push first button text address
pea $0000 quitbtn2>>16
pea quitbtn2 push 2nd button text address (null)
_TLTextMountVolume make the dialog box
pla retrieve button press (not used)
pea button1 push first button text address
pea $0000 quitbtn2>>16
pea quitbtn2 push 2nd button text address (null)
_TLTextMountVolume make the dialog box
pla retrieve button press (not used)
sec emulation mode
xce
jsr MLI quit back to GQuit
.DA #$65
.DA quitparms
jsr MLI quit back to GQuit
.DA #$65
.DA quitparms
* p8 mount volume
*
* on entry: volbuf = name of volume to mount.
* on exit: carry clear if mount volume displayed and 'return' was pressed.
* carry set if no window displayed or if had window and 'esc' pressed.
* carry set if no window displayed or if had window and 'esc' pressed.
mountvol .EQ *-ofsQ
ldy #$0000 volbuf>>16
ldy #$0000 volbuf>>16
ldx #volbuf set up pointer to volume name.
* if error is 'volume not found' or 'no disk in drive' then display the
* Mount Volume window, otherwise return with carry set.
and #$00FF mask just in case.
cmp #$0045 volume not found ?
beq L6101 yes
cmp #$002F no disk in drive ?
beq L6101 yes
sec indicate error not handled.
rts return with error code still in acc.
and #$00FF mask just in case.
cmp #$0045 volume not found ?
beq L6101 yes
cmp #$002F no disk in drive ?
beq L6101 yes
sec indicate error not handled.
rts return with error code still in acc.
L6101 pha save error code in case esc pressed.
phy pointer to volume name.
L6101 pha save error code in case esc pressed.
phy pointer to volume name.
phx
tsc
phd save D reg.
tcd point D reg at stack.
lda [$01] get length byte and leading separator.
dec don't count leading separator.
xba then swap the bytes so the volume name
sta [$01] doesn't cpntain the separator.
pha room for result.
pea $0000 mountmsg>>16
phd save D reg.
tcd point D reg at stack.
lda [$01] get length byte and leading separator.
dec don't count leading separator.
xba then swap the bytes so the volume name
sta [$01] doesn't cpntain the separator.
pha room for result.
pea $0000 mountmsg>>16
pea mountmsg
phy hi word of pointer to volume name.
inx skip separator.
phx lo word of pointer to volume name.
pea $0000 button1>>16
pea button1 'Return'
inx skip separator.
phx lo word of pointer to volume name.
pea $0000 button1>>16
pea button1 'Return'
pea $0000 button2>>16
pea button2 'Escape'
pea button2 'Escape'
_TLTextMountVolume
lda [$01] restore first 2 bytes of vilume name
xba back to their original positions
inc and values.
lda [$01] restore first 2 bytes of vilume name
xba back to their original positions
inc and values.
sta [$01]
pla which button: 1=Return 2=Escape.
pld restore D reg.
plx pull volume name pointer off stack
pla which button: 1=Return 2=Escape.
pld restore D reg.
plx pull volume name pointer off stack
plx
cmp #$0001 which button was pressed ?
bne L613C if Escape pressed.
clc indicate Return was pressed.
pla pull original error code off stack.
rts return with carry clear.
L613C sec indicate Escape was pressed.
pla restore error code.
rts return with carry set.
cmp #$0001 which button was pressed ?
bne L613C if Escape pressed.
clc indicate Return was pressed.
pla pull original error code off stack.
rts return with carry clear.
L613C sec indicate Escape was pressed.
pla restore error code.
rts return with carry set.
* copy the volume name from the given pathname to the volume name buffer.
*
@ -229,19 +229,19 @@ L613C sec indicate Escape was pressed.
copyvol .EQ *-ofsQ
lda |1,x get the first slash
sta volbuf+1
ldy #$0002 initialize the length count.
ldy #$0002 initialize the length count.
LONGI OFF
LONGA OFF
L6148 lda |2,x now copy the volume name up to
cmp #$2F the separating slash.
L6148 lda |2,x now copy the volume name up to
cmp #$2F the separating slash.
beq L6156
sta volbuf,y
inx
iny
bra L6148
L6156 dey fix character count.
tya length.
sta volbuf store the resultant string length.
tya length.
sta volbuf store the resultant string length.
rts
* translate a filename message from the message center to the currently
@ -253,182 +253,182 @@ L6156 dey fix character count.
dolaunch .EQ *-ofsQ
lda sysentry does the app start with a jump ?
cmp #$4C
bne L616F no, doesn't follow the convention.
bne L616F no, doesn't follow the convention.
lda #$EE check for the signature bytes.
cmp sysentry+3
bne L616F 1st one doesn't match, skip it.
bne L616F 1st one doesn't match, skip it.
cmp sysentry+4
beq L6170 both match, go get a filename message.
L616F rts just return to launch the app.
L6170 lda #$FF put flag conditioning value on
pha the stack (assume error).
clc native 16-bit mode.
beq L6170 both match, go get a filename message.
L616F rts just return to launch the app.
L6170 lda #$FF put flag conditioning value on
pha the stack (assume error).
clc native 16-bit mode.
xce
LONG I,M
pha make room on stack for user id.
_MMStartUp start up the memory manager.
pla get the user id and
pha leave it on the stack.
pha make room on stack for user id.
_MMStartUp start up the memory manager.
pla get the user id and
pha leave it on the stack.
pha
pha make room on stack for new handle.
pha make room on stack for new handle.
pea $0000
pea $000A get a 10 byte block of memory.
pea $000A get a 10 byte block of memory.
pha put user id on stack.
pea $0000 totally unrestricted block.
pha LocationPtr (not used)
pea $0000 totally unrestricted block.
pha LocationPtr (not used)
pha
_NewHandle go get the block of memory.
pla get the handle from the stack.
_NewHandle go get the block of memory.
pla get the handle from the stack.
plx
bcs L620A branch if error, no memory available.
phx leave the handle on the stack.
bcs L620A branch if error, no memory available.
phx leave the handle on the stack.
pha
pea $0002 'get' a message.
pea $0001 get a type 1 (filename) message.
phx put the message handle on the stack
pha (still in acc and x regs)
pea $0002 'get' a message.
pea $0001 get a type 1 (filename) message.
phx put the message handle on the stack
pha (still in acc and x regs)
_MessageCenter
bcs L6203 branch if no message.
pha leave 4 bytes free on stack
pha (will be used as a direct page pointer)
tsc get the stack pointer.
phd save current direct register.
inc a point to new direct page space.
tcd make a new direct page.
lda [$04] de-reference the handle.
bcs L6203 branch if no message.
pha leave 4 bytes free on stack
pha (will be used as a direct page pointer)
tsc get the stack pointer.
phd save current direct register.
inc a point to new direct page space.
tcd make a new direct page.
lda [$04] de-reference the handle.
sta $00
ldy #$0002
lda [$04],y
sta $02
ldy #$0006 get the message command.
ldy #$0006 get the message command.
lda [$00],y
bne bad_msg if print, then skip it.
lda $00 adjust pointer to filename string.
bne bad_msg if print, then skip it.
lda $00 adjust pointer to filename string.
clc
adc #$0008
sta $00
bcc L61D1
inc $02
L61D1 lda [$00] get the length of the string.
and #$00FF mask off high (leaving just the length)
SHORT M 8 bit accumulator
cmp sysentry+5 check against length of app buffer.
L61D1 lda [$00] get the length of the string.
and #$00FF mask off high (leaving just the length)
SHORT M 8 bit accumulator
cmp sysentry+5 check against length of app buffer.
beq L61DF if equal then continue with move.
bcs bad_msg if too long then bad message.
L61DF tay string length.
L61E0 lda [$00],y get a character.
sta sysentry+6,y store it in the app's filename buffer
sta inbuf,y and in prefix buffer.
bcs bad_msg if too long then bad message.
L61DF tay string length.
L61E0 lda [$00],y get a character.
sta sysentry+6,y store it in the app's filename buffer
sta inbuf,y and in prefix buffer.
dey
bpl L61E0
lda #$00 change flag conditioning value on stack
sta $0D,s to indicate a filename is passed.
lda #$00 change flag conditioning value on stack
sta $0D,s to indicate a filename is passed.
bad_msg LONG M 16-bit acc.
pld restore direct register.
pla fix stack because handle and userid
pla still on stack.
pea $0003 now delete the message (done with it).
pea $0001 message type 1.
pha garbage handle (not used).
pld restore direct register.
pla fix stack because handle and userid
pla still on stack.
pea $0003 now delete the message (done with it).
pea $0001 message type 1.
pha garbage handle (not used).
pha
_MessageCenter go delete the message.
L6203 _DisposeHandle throw away message (handle is on stack)
L620A _MMShutDown shutdown the memory manager (userid is
sec on stack).
xce back to emulation mode.
_MessageCenter go delete the message.
L6203 _DisposeHandle throw away message (handle is on stack)
L620A _MMShutDown shutdown the memory manager (userid is
sec on stack).
xce back to emulation mode.
LONGA OFF
pla condition z-flag with value on stack.
bne L6231 then done.
ldx inbuf get length of pathname.
lda #$2F look for slash.
L621B cmp inbuf,x
beq L6225 when found, set prefix.
pla condition z-flag with value on stack.
bne L6231 then done.
ldx inbuf get length of pathname.
lda #$2F look for slash.
L621B cmp inbuf,x
beq L6225 when found, set prefix.
dex
bne L621B
bra L6231 if no slash, just skip it.
L6225 dex don't include trailing slash.
stx inbuf set new length.
jsr MLI set the P8 prefix.
.DA #$C6
.DA pfxparms
lda #$00 set z-flag
L6231 rts and go launch the app.
bra L6231 if no slash, just skip it.
L6225 dex don't include trailing slash.
stx inbuf set new length.
jsr MLI set the P8 prefix.
.DA #$C6
.DA pfxparms
lda #$00 set z-flag
L6231 rts and go launch the app.
* check for disk volume
*
* on exit:
* carry clear = disk was found
* carry set = disk not found
* carry clear = disk was found
* carry set = disk not found
ckfordrv .EQ *-ofsQ
clc native mode
xce
LONG I 16-bit regs, 8-bit acc.
LONG I 16-bit regs, 8-bit acc.
ldx #sysentry+6 point to pathname buffer.
jsr copyvol copy volume name to pathname buffer.
.1 sec emulation mode.
jsr copyvol copy volume name to pathname buffer.
.1 sec emulation mode.
xce
jsr MLI get info on the volume.
.DA #$C4
.DA gfiparms
bcc .2 branch if volume found,
jsr MLI get info on the volume.
.DA #$C4
.DA gfiparms
bcc .2 branch if volume found,
clc (native mode)
xce
LONG I,M
jsr mountvol else ask user to mount the volume.
bcc .1 if <return> pressed, then try again.
sec emulation mode.
jsr mountvol else ask user to mount the volume.
bcc .1 if <return> pressed, then try again.
sec emulation mode.
xce
sec disk not found.
.2 rts
sec disk not found.
.2 rts
* Prodos 8 parameter lists
pfxparms .EQ *-ofsQ set prefix parms.
.DA #01 one parm.
.DA inbuf address of prefix.
opnparms .EQ *-ofsQ open parms.
.DA #3 3 parms.
.DA PrefixBuf pathname
.DA op_buf i/o buffer
.DA #01 one parm.
.DA inbuf address of prefix.
opnparms .EQ *-ofsQ open parms.
.DA #3 3 parms.
.DA PrefixBuf pathname
.DA op_buf i/o buffer
oprefnum .EQ *-ofsQ
.HS 00 reference #
.HS 00 reference #
eofparms .EQ *-ofsQ
.DA #02 2 parms
.DA #02 2 parms
eofrefn .EQ *-ofsQ
.HS 00 reference #
.HS 00 reference #
eofval .EQ *-ofsQ
.HS 000000 3 byte eof value
.HS 000000 3 byte eof value
readparm .EQ *-ofsQ
.DA #04 4 parms
.DA #04 4 parms
rdrefnum .EQ *-ofsQ
.HS 00 reference #
.DA sysentry read into $2000 (bank 0).
.HS 00 reference #
.DA sysentry read into $2000 (bank 0).
rdcount .EQ *-ofsQ
.HS 0000 # of bytes to read.
.HS 0000 transfer count
.HS 0000 # of bytes to read.
.HS 0000 transfer count
closeprm .EQ *-ofsQ
.DA #1 1 parm
.DA #1 1 parm
closeref .EQ *-ofsQ
.HS 00 reference #
.HS 00 reference #
quitparms .EQ *-ofsQ
.DA #04 4 parms.
.HS 00 quit back to launcher (GQuit)
.DA #04 4 parms.
.HS 00 quit back to launcher (GQuit)
.HS 0000
.HS 00
.HS 0000
gfiparms .EQ *-ofsQ get file info parms.
.DA #$0A 10 parms
.DA volbuf volume buffer
.DA #0 access
.DA #0 file type
.DA 0 aux type
.DA #0 storage type
.DA 0 blocks used
.DA 0 modification date
.DA 0 modification time
.DA 0 creation date
.DA 0 creation time
.DA #$0A 10 parms
.DA volbuf volume buffer
.DA #0 access
.DA #0 file type
.DA 0 aux type
.DA #0 storage type
.DA 0 blocks used
.DA 0 modification date
.DA 0 modification time
.DA 0 creation date
.DA 0 creation time
* messages for P8 fatal error. maximum length of message is 35 characters.
* the error code will be displayed immediately after the final character.
@ -440,8 +440,8 @@ quitstr2 .EQ *-ofsQ
.DA #$14
.AS "ProDOS Error = $"
errval .EQ *-ofsQ hex error code gets stored here
.AS " "
quitbtn2 .EQ *-ofsQ null string (no 2nd button)
.AS " "
quitbtn2 .EQ *-ofsQ null string (no 2nd button)
.HS 00
* messages for P8 mount volume. maximum length of message is 35 characters.
@ -453,11 +453,11 @@ mountmsg .EQ *-ofsQ
button1 .EQ *-ofsQ
.DA #$0D
.AS "Accept: "
.DA #$1B mousetext on
.DA #$0F inverse on
.DA #$4D mousetext return
.DA #$0E normal on
.DA #$18 mousetext off
.DA #$1B mousetext on
.DA #$0F inverse on
.DA #$4D mousetext return
.DA #$0E normal on
.DA #$18 mousetext off
button2 .EQ *-ofsQ
.DA #$0B
.AS "Cancel: Esc"

View File

@ -9,60 +9,60 @@ NEW
ofsT .EQ tclock_0-tclk_in offset to Thunderclock org
tclock_0 ldx clkslt clock slot = $C1.
lda clkmode,x save current mode
lda clkmode,x save current mode
pha
lda #$A3 send numeric mode byte to Thunderclock
lda #$A3 send numeric mode byte to Thunderclock
jsr wttcp
clkslt .EQ *-ofsT+2 points to $C1.
jsr rdtcp read month, day of week, day of month
clc and time into input buffer.
clc and time into input buffer.
ldx #$04 index for 5 values.
ldy #$0C read minutes 1st, month last.
.1 lda inbuf,y convert values to binary.
and #$07 no value > 5 decimal.
ldy #$0C read minutes 1st, month last.
.1 lda inbuf,y convert values to binary.
and #$07 no value > 5 decimal.
sta pcl 'tens' place value
asl multiply by 10
asl multiply by 10
asl
adc pcl
asl
adc inbuf+1,y add to ascii 'ones' place
sec and subtract out the ascii
sec and subtract out the ascii
sbc #$B0
sta pcl,x save converted value.
dey index to next lowest value
sta pcl,x save converted value.
dey index to next lowest value
dey
dey
dex are there more values?
bpl .1 if yes.
tay contains month
dex are there more values?
bpl .1 if yes.
tay contains month
lsr
ror
ror
ror high bit of month held in carry
ror high bit of month held in carry
ora A1L
sta p8date save low value of date.
php save high bit of month.
and #$1F isolate day.
adc tdays-1,y (y = month)
sta p8date save low value of date.
php save high bit of month.
and #$1F isolate day.
adc tdays-1,y (y = month)
bcc .2 branch if not Sept 13 thru 30th
adc #$03 adj for mod 7 when day > 256
adc #$03 adj for mod 7 when day > 256
.2 sec
.3 sbc #$07
bcs .3 loop until < 0.
adc #$07 make it in the range of 0-6.
sbc pch the delta provides years offset.
bcs .4 branch if positive
adc #$07 else make it positive again.
.4 tay
lda yradj,y look up year
plp and combine it with hi bit of month
adc #$07 make it in the range of 0-6.
sbc pch the delta provides years offset.
bcs .4 branch if positive
adc #$07 else make it positive again.
.4 tay
lda yradj,y look up year
plp and combine it with hi bit of month
rol
sta p8date+1 P8 date
sta p8date+1 P8 date
lda A1L+1 hour
sta p8time+1 P8 time
sta p8time+1 P8 time
lda A2L minute
sta p8time
pla restore previous mode.
pla restore previous mode.
ldx clkslt clock slot = $C1
sta clkmode,x
H2F69 rts
@ -71,18 +71,18 @@ H2F69 rts
* one entry for each month. the values are modulo 256.
tdays .EQ *-ofsT
.DA #$00 January
.DA #$1F February
.DA #$3B March
.DA #$5A April
.DA #$78 May
.DA #$97 June
.DA #$B5 July
.DA #$D3 August
.DA #$F2 September
.DA #$14 October (MOD 256)
.DA #$33 November
.DA #$51 December
.DA #$00 January
.DA #$1F February
.DA #$3B March
.DA #$5A April
.DA #$78 May
.DA #$97 June
.DA #$B5 July
.DA #$D3 August
.DA #$F2 September
.DA #$14 October (MOD 256)
.DA #$33 November
.DA #$51 December
* the following table is used to look up the current year, based on
* the current month, day and day of week. The 1st entry corresponds
@ -92,12 +92,12 @@ tdays .EQ *-ofsT
yradj .EQ *-ofsT
.DA #$60 Monday
.DA #$5F Sunday
.DA #$5E Saturday
.DA #$5D Friday
.DA #$62 Thursday
.DA #$61 Wednesday
.DA #$60 Tuesday
.DA #$5F Sunday
.DA #$5E Saturday
.DA #$5D Friday
.DA #$62 Thursday
.DA #$61 Wednesday
.DA #$60 Tuesday
tclk_end .EQ * end of obj tclock_0.
.HS 000000 pad
*--------------------------------------

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,546 @@
NEW
AUTO 3,1
* MEMMGR memory manager
*
* allocate buffer in memory tables
alcbuffr .EQ *-ofsX
ldy #$04 index to user specified buffer.
alcbufr1 .EQ *-ofsX
lda (A3L),y this buffer must be on a page boundary.
tax save for validation.
cmp #$08
bcc L4E1E cannot be lower than video !
cmp #$BC nor greater than $BB00
bcs L4E1E since it would wipe out globals...
sta datptr+1
dey
lda (A3L),y low address should be zero !
sta datptr
bne L4E1E error if not page boundary.
inx add 4 pages for 1k buffer.
inx
inx
inx
L4DED dex test for conflicts.
jsr cmembit test for free buffer space
and memmap,y P8 memory bitmap
bne L4E1E report memory conflict, if any.
cpx datptr+1 test all 4 pages.
bne L4DED
inx add 4 pages again for allocation.
inx
inx
inx
L4DFE dex set proper bits to 1
jsr cmembit
ora memmap,y to mark it's allocation.
sta memmap,y
cpx datptr+1 set all 4 pages
bne L4DFE
ldy fcbptr calculate buffer number
lda fcbbuf,y
asl buffer number = (entnum) * 2.
sta fcbbuf+11,y save it in fcb.
tax use entnum * 2 as index to global
lda datptr+1 buffer addr tables. get addr already
sta buftbl-1,x validated as good. store hi addr
clc (entnums start at 1, not 0)
rts
L4E1E lda #$56 buffer is in use or not legal
sec
rts
getbufadr .EQ *-ofsX
tax index into global buffer table.
lda buftbl-2,x
sta bufaddrl
lda buftbl-1,x
sta bufaddrh
rts
relbuffr .EQ *-ofsX preserve buffer address in 'bufaddr'
jsr getbufadr
tay returns high buffer address in acc.
beq L4E54 branch if unallocated buffer space.
stz buftbl-1,x take address out of buffer list.
stz buftbl-2,x (x was set up by getbufadr)
freebuf .EQ *-ofsX
ldx bufaddrh get hi buffer address
inx add 4 pages to account for 1k space.
inx
inx
inx
L4E43 dex drop to next lower page.
jsr cmembit get bit and position to memtable of
eor #$FF this page. invert mask.
and memmap,y mark address as free space.
sta memmap,y
cpx bufaddrh all pages freed ?
bne L4E43 no.
L4E54 clc no error.
rts
* calculate memory allocation bit position.
* on entry: x = high address of buffer, low address assumed zero.
* on exit: acc = allocation bit mask, x = unchanged, y = pointer to memtabl byte
cmembit .EQ *-ofsX
txa page address
and #$07 which page in any 2k set ?
tay use as index to determine
lda whichbit,y bit position representation.
pha save bit position mask for now.
txa page address.
lsr a
lsr a determine 2k set
lsr a
tay return it in y.
pla restore bit mask. return bit position
rts in a & y, pointer to memtabl in x.
valdbuf .EQ *-ofsX
lda usrbuf+1 high address of user's buffer
cmp #$02 must be greater than page 2.
bcc L4E1E report bad buffer
ldx cbytes+1
lda cbytes get cbytes-1 value.
sbc #$01 (carry is set)
bcs L4E76
dex
L4E76 clc
adc usrbuf calculate end of request address.
txa do high address.
adc usrbuf+1 the final address
tax must be less than $BFnn (globals)
cpx #$BF
bcs L4E1E report bad buffer.
inx loop thru all affected pages.
vldbuf1 .EQ *-ofsX
L4E82 dex check next lower page.
jsr cmembit
and memmap,y if 0 then no conflict.
bne L4E1E branch if conflict.
cpx usrbuf+1 was that the last (lowest) page ?
bne L4E82 if not.
clc all pages ok.
rts
getbuf .EQ *-ofsX give user address of file buffer
ldy #$02 referenced by refnum.
lda bufaddrl
sta (A3L),y
iny
lda bufaddrh
sta (A3L),y
clc no errors possible
rts
setbuf .EQ *-ofsX
ldy #$03
jsr alcbufr1 allocate new buffer address over old one
bcs L4EC7 report any errors immediately
lda bufaddrh
sta usrbuf+1
lda bufaddrl
sta usrbuf
jsr freebuf free address space of old buffer
ldy #$00
ldx #$03
L4EB8 lda (usrbuf),y move all 4 pages of the buffer to
sta (datptr),y new location.
iny
bne L4EB8
inc datptr+1
inc usrbuf+1
dex
bpl L4EB8
clc no errors
L4EC7 rts
* move 3 pages of dispatcher from 'displc2' to 'dispadr'
* this move routine must be resident above $E000 at all times
calldisp .EQ *-ofsX
lda altram read/write RAM bank 2
lda altram
lda #>dispadr
sta A2L+1
lda #<dispadr
sta A2L
lda #>displc2
sta A1L+1
stz A1L
ldy #$00
ldx #$03 3 pages to move.
L4EE0 dey move a page of code.
lda (A1L),y
sta (A2L),y
tya
bne L4EE0
inc1L+1 pointers to next page
inc2L+1
dex move all pages needed
bne L4EE0
lda ramin read/write RAM bank 1
lda ramin swap mli space back in
stz mliact MLI active flag
stz softev
lda #>dispadr point RESET to dispatch entry
sta softev+1
eor #$A5
sta pwredup power up byte
jmp dispadr
* translate a prodos call into a smartport call
* to access unseen smartport devices
remap_sp .EQ *-ofsX
ldx #$03 assume 3 parameters.
lda A4L command number
sta cmdnum
bne L4F1B taken if not status call
ldy #<spstatlist set up memory for the status list buffer
sty buf fake up the prodos parameters
ldy #>spstatlist
sty buf+1
stz bloknml set statcode = 0 for simple status call
L4F1B cmp #$03 format command ?
bne L4F21 no.
ldx #$01 format has only 1 parameter.
L4F21 stx statparms set # of parms.
lda unitnum
lsr a turn unit number into an index
lsr a
lsr a
lsr a
tax
lda spunit-1,x get the smartport unit number and
sta sp_unitnum store into smartport parm list.
lda spvectlo-1,x
sta sp_vector+1 copy smartport entry address
lda spvecthi-1,x
sta sp_vector+2
ldx #$04 copy buffer pointer and block #
L4F3F lda buf-1,x from prodos parameters
sta sp_bufptr-1,x to smartport parameter block
dex
bne L4F3F
sp_vector .EQ *-ofsX smartport call
jsr $0000 (entry address gets modified)
cmdnum .EQ *-ofsX
.HS 00 command #
.DA statparms'
bcs L4F6E
ldx cmdnum status call ?
bne L4F6E no...
ldx spstatlist+1 else get the block count
ldy spstatlist+2
lda spstatlist get the returned status.
bit #$10 is there a disk present ?
bne L4F65 yes, check for write protected.
lda #$2F return offline error.
bra L4F6D
L4F65 and #$44 mask all but write allowed and write
eor #$40 protected bits. if allowed and not
beq L4F6E protected, exit with carry clear
lda #$2B else return write protected error.
L4F6D sec
L4F6E rts
spvectlo .EQ *-ofsX storage for low byte of smartport
.DA #0000000000000000' entry.
.DA #00000000000000'
spvecthi .EQ *-ofsX storage for high byte of smartport
.DA #0000000000000000' entry.
.DA #00000000000000'
statparms .EQ *-ofsX # of parms (always 3 except format)
dc h'03'
sp_unitnum .EQ *-ofsX
.HS 00 unit number
sp_bufptr .EQ *-ofsX
.HS 0000 data buffer
dc h'000000' block number (3 bytes)
* data tables
scnums .EQ *-ofsX table of valid mli command numbers.
dc h'D3000000'
.DA #40410000808182'
.DA #65C0C1C2C3C4C5C6'
.DA #C7C8C9CACBCCCDCE'
.DA #CF00D0D1D2'
pcntbl .EQ *-ofsX parameter counts for the calls
dc h'02FFFF'
.DA #FF0201FFFF030300'
.DA #04070102070A0201'
.DA #0103030404010102'
.DA #02FF020202'
* command table
cmdtable .EQ *-ofsX
.DA create' create
.DA destroy' destroy
.DA rename' rename
.DA setinfo' setinfo
.DA getinfo' getinfo
.DA online' online
.DA setprefx' set prefix
.DA getprefx' get prefix
.DA openf' open
.DA newline' newline
.DA readf' read
.DA writef' write
.DA closef' close
.DA flushf' flush
.DA setmark' set mark
.DA getmark' get mark
.DA seteof' seteof
.DA geteof' geteof
.DA setbuf' setbuf
.DA getbuf' getbuf
* corresponding command function bytes
disptch .EQ *-ofsX
dc h'A0A1A2A3'
.DA #84050607'
dc h'88494A4B'
.DA #2C2D4E4F'
.DA #50515253'
dinctbl .EQ *-ofsX table to increment
dc h'0100000200' directory usage/eof counts
pass .EQ *-ofsX
dc h'75'
xdosver .EQ *-ofsX
dc h'00'
compat .EQ *-ofsX
.HS 00
dc h'C3270D000000'
rootstuf .EQ *-ofsX
.DA #0F02000400000800'
whichbit .EQ *-ofsX
.DA #8040201008040201'
ofcbtbl .EQ *-ofsX
.DA #0C0D1819151617'
inftabl .EQ *-ofsX
.DA #1E101F2080939421'
.DA #22232418191A1B'
deathmsg .EQ *-ofsX
dc h'20'
msb on
dc c'RESTART SYSTEM-$01'
dc h'20'
*** work space ***
* note: this area is accessed by code that depends on the order of these
* variables in the file control block and temporary directory.
own_blk .EQ *-ofsX
.HS 0000
own_ent .EQ *-ofsX
.HS 00
own_len .EQ *-ofsX
.HS 00
h_credt .EQ *-ofsX
.HS 0000 directory creation date
.HS 0000 directory creation time
.HS 00 version under which this dir created
.HS 00 earliest version that it's compatible
h_attr .EQ *-ofsX attributes (protect bit, etc.)
.HS 00
h_entln .EQ *-ofsX length of each entry in this directory
.HS 00
h_maxent .EQ *-ofsX maximum number of entries per block
.HS 00
h_fcnt .EQ *-ofsX current # of files in this directory
.HS 0000
h_bmap .EQ *-ofsX address of first allocation bitmap
.HS 0000
h_tblk .EQ *-ofsX total number of blocks on this unit
.HS 0000
d_dev .EQ *-ofsX device number of this directory entry
.HS 00
d_head .EQ *-ofsX address of <sub> directory header
.HS 0000
d_entblk .EQ *-ofsX address of block which contains entry
.HS 0000
d_entnum .EQ *-ofsX entry number within block
.HS 00
d_stor .EQ *-ofsX
dc h'0000000000000000' file name
dc h'0000000000000000'
d_filid .EQ *-ofsX user's identification byte
.HS 00
d_frst .EQ *-ofsX first block of file
.HS 0000
d_usage .EQ *-ofsX # of blocks allocated to this file
.HS 0000
d_eof .EQ *-ofsX current end of file marker
dc h'000000'
d_credt .EQ *-ofsX
.HS 0000 file creation date
.HS 0000 file creation time
d_sosver .EQ *-ofsX sos version that created this file
.HS 00
d_comp .EQ *-ofsX backward version compatibility
.HS 00
d_attr .EQ *-ofsX attributes (protect, r/w, enable, etc.)
.HS 00
d_auxid .EQ *-ofsX user auxilliary identification
.HS 0000
d_moddt .EQ *-ofsX
.HS 0000 file's last modification date
.HS 0000 file's last modification time
d_dhdr .EQ *-ofsX file directory header block address
.HS 0000
scrtch .EQ *-ofsX scratch area for
.DA #00000000' allocation address conversion.
oldeof .EQ *-ofsX temp used in r/w
dc h'000000'
oldmark .EQ *-ofsX
.DA #000000'
xvcbptr .EQ *-ofsX used in 'cmpvcb' as a temp
.HS 00
vcbptr .EQ *-ofsX
.HS 00
fcbptr .EQ *-ofsX
.HS 00
fcbflg .EQ *-ofsX
.HS 00
reql .EQ *-ofsX
.HS 00
reqh .EQ *-ofsX
.HS 00
levels .EQ *-ofsX
.HS 00
totent .EQ *-ofsX
.HS 00
entcntl .EQ *-ofsX
.HS 00
entcnth .EQ *-ofsX
.HS 00
cntent .EQ *-ofsX
.HS 00
nofree .EQ *-ofsX
.HS 00
bmcnt .EQ *-ofsX
.HS 00
saptr .EQ *-ofsX
.HS 00
pathcnt .EQ *-ofsX
.HS 00
p_dev .EQ *-ofsX
.HS 00
p_blok .EQ *-ofsX
.HS 0000
bmptr .EQ *-ofsX
.HS 00
basval .EQ *-ofsX
.HS 00
half .EQ *-ofsX
.HS 00
* bitmap info tables
bmastat .EQ *-ofsX
.HS 00
bmadev .EQ *-ofsX
.HS 00
bmadadr .EQ *-ofsX
.HS 0000
bmacmap .EQ *-ofsX
.HS 00
tposll .EQ *-ofsX
.HS 00
tposlh .EQ *-ofsX
.HS 00
tposhi .EQ *-ofsX
.HS 00
rwreql .EQ *-ofsX
.HS 00
rwreqh .EQ *-ofsX
.HS 00
nlchar .EQ *-ofsX
.HS 00
nlmask .EQ *-ofsX
.HS 00
ioaccess .EQ *-ofsX has a call been made to
.HS 00 disk device handler ?
cmdtemp .EQ *-ofsX
.HS 00
bkbitflg .EQ *-ofsX used to set or clear backup bit
.HS 00
duplflag .EQ *-ofsX
.HS 00
vcbentry .EQ *-ofsX
.HS 00
* xdos temporary variables
namcnt .EQ *-ofsX
.HS 00
rnptr .EQ *-ofsX
.HS 00
namptr .EQ *-ofsX
.HS 00
vnptr .EQ *-ofsX
.HS 00
prfxflg .EQ *-ofsX
.HS 00
cferr .EQ *-ofsX
.HS 00
* deallocation temporary variables
firstbl .EQ *-ofsX
.HS 00
firstbh .EQ *-ofsX
.HS 00
stortyp .EQ *-ofsX
.HS 00
deblock .EQ *-ofsX
.HS 0000
dtree .EQ *-ofsX
.HS 00
dsap .EQ *-ofsX
.HS 00
dseed .EQ *-ofsX
.HS 0000
topdest .EQ *-ofsX
.HS 00
dtmpx .EQ *-ofsX
.HS 00
loklst .EQ *-ofsX look list of recognized device numbers
dealbufl .EQ *-ofsX
.HS 0000000000000000
dealbufh .EQ *-ofsX
.HS 0000000000000000
cbytes .EQ *-ofsX
.HS 0000
.HS 00 cbytes+2 must = 0
bufaddrl .EQ *-ofsX
.HS 00
bufaddrh .EQ *-ofsX
.HS 00
goadr .EQ *-ofsX
.HS 0000
delflag .EQ *-ofsX used by 'detree' to know if called
.HS 00 from delete (destroy).
* zero fill to page boundary - 3 ($FEFD). so that cortland flag stays
* within page boundary.
.HS 00000000000000
.HS 0000000000
.DA calldisp
cortflag .EQ *-ofsX cortland flag. 1 = Cortland system
.HS 00 (must stay within page boundary)
* end of obj mli_2
*--------------------------------------
MAN
SAVE USR/SRC/PRODOS.203/PRODOS.S.XDOS.M
LOAD USR/SRC/PRODOS.203/PRODOS.S
ASM

File diff suppressed because it is too large Load Diff

View File

@ -17,19 +17,19 @@ ZP.DstPtr .EQ $14
PrefixBuf .EQ $280
DirBlkBuf .EQ $C00
*--------------------------------------
* $2000 mli_0 mli loader/relocator
* $2C80 ram_1 installer for /RAM
* $2D00 ram_2 /RAM driver in main lc
* $2D9B mli_3 interrupts
* $2E00 mli_1 global page
* $2000 mli_0 mli loader/relocator
* $2C80 ram_1 installer for /RAM
* $2D00 ram_2 /RAM driver in main lc
* $2D9B mli_3 interrupts
* $2E00 mli_1 global page
* $2F00 tclock_0 Thunderclock driver
* $2F80 cclock_0 Cortland clock driver
* $3000 mli_2 xdos mli & block file manager
* $5100 ram_0 /RAM driver in aux mem
* $5300 xrw_0 disk core routines
* $5A00 sel_0 dispatcher
* $5D00 sel_1 enhanced quit code (Bird's Better Bye)
* $6000 sel_2 GQuit dispatcher support
* $3000 mli_2 xdos mli & block file manager
* $5100 ram_0 /RAM driver in aux mem
* $5300 xrw_0 disk core routines
* $5A00 sel_0 dispatcher
* $5D00 sel_1 enhanced quit code (Bird's Better Bye)
* $6000 sel_2 GQuit dispatcher support
.PH $2000
@ -41,6 +41,8 @@ DirBlkBuf .EQ $C00
.INB USR/SRC/PRODOS.203/PRODOS.S.TCLK
.INB USR/SRC/PRODOS.203/PRODOS.S.CCLK
.INB USR/SRC/PRODOS.203/PRODOS.S.XDOS
.INB USR/SRC/PRODOS.203/PRODOS.S.XDOS.C
.INB USR/SRC/PRODOS.203/PRODOS.S.XDOS.M
.INB USR/SRC/PRODOS.203/PRODOS.S.RAMX
.INB USR/SRC/PRODOS.203/PRODOS.S.DISKII
.INB USR/SRC/PRODOS.203/PRODOS.S.SEL0