Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-05-28 23:13:52 +02:00
parent be157e3ff3
commit e0690b5de4
23 changed files with 553 additions and 380 deletions

Binary file not shown.

Binary file not shown.

View File

@ -5,11 +5,11 @@ NEW
.OR $2000 .OR $2000
.TF bin/format .TF bin/format
*-------------------------------------- *--------------------------------------
.INB INC/MACROS.I .INB inc/macros.i
.INB INC/A2OSX.I .INB inc/a2osx.i
.INB INC/MLI.E.I .INB inc/mli.e.i
.INB INC/KERNEL.I .INB inc/kernel.i
.INB INC/LIBBLKDEV.I .INB inc/libblkdev.i
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR ZPBIN .OR ZPBIN
@ -314,14 +314,12 @@ CS.RUN.LL.DISKII
ldx #16 ldx #16
jsr CS.RUN.ZeroPtr1 16 sectors filled with 0, give some time to spin up jsr CS.RUN.ZeroPtr1 16 sectors filled with 0, give some time to spin up
>PUSHB DSSS0000
>LIBCALL hLIBBLKDEV,LIBBLKDEV.D2Recalibrate
bcs .9
stz CurTrack stz CurTrack
lda #162
sta CurQTrack
ldx #0
jsr CS.RUN.SeekToX
lda TrkCnt lda TrkCnt
sta Counter sta Counter
@ -660,5 +658,5 @@ DIB .BS S.DIB
DS.END .ED DS.END .ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/FORMAT.S SAVE usr/src/bin/format.s
ASM ASM

View File

@ -5,9 +5,10 @@ NEW
LIBBLKDEV.GetProDOSCatSize .EQ 4 LIBBLKDEV.GetProDOSCatSize .EQ 4
LIBBLKDEV.BuildProDOSCat .EQ 6 LIBBLKDEV.BuildProDOSCat .EQ 6
LIBBLKDEV.D2MotorControl .EQ 8 LIBBLKDEV.D2MotorControl .EQ 8
LIBBLKDEV.D2MoveHead .EQ 10 LIBBLKDEV.D2Recalibrate .EQ 10
LIBBLKDEV.D2TrkRead16s .EQ 12 LIBBLKDEV.D2MoveHead .EQ 12
LIBBLKDEV.D2TrkWrite16s .EQ 14 LIBBLKDEV.D2TrkRead16s .EQ 14
LIBBLKDEV.D2TrkWrite16s .EQ 16
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE INC/LIBBLKDEV.I SAVE inc/libblkdev.i

View File

@ -114,6 +114,14 @@ NEW
.DO ]1=MLIGETBUF .DO ]1=MLIGETBUF
lda #2 lda #2
.FIN .FIN
.DO ]1=MLISETFILEINFOEX
lda #2
.FIN
.DO ]1=MLIGETFILEINFOEX
lda #2
.FIN
jsr GP.MLICall jsr GP.MLICall
.EM .EM
*-------------------------------------- *--------------------------------------
@ -530,4 +538,4 @@ FPU.FOUT .EQ 58 PrintF
.EM .EM
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE INC/MACROS.I SAVE inc/macros.i

View File

@ -1,6 +1,5 @@
NEW NEW
PREFIX AUTO 4,1
AUTO 4,1
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
* PRODOS Constants * PRODOS Constants
@ -65,20 +64,21 @@ S.FI.CTIME .EQ $10
* *
S.FI .EQ $12 S.FI .EQ $12
*-------------------------------------- *--------------------------------------
S.FIEX.TYPE .EQ 0 S.FIEX.FILENAME .EQ 0
S.FIEX.KEYPTR .EQ 1 S.FIEX.TYPE .EQ 16
S.FIEX.BUSED .EQ 3 S.FIEX.KEYPTR .EQ 17
S.FIEX.EOF .EQ 5 S.FIEX.BLKUSED .EQ 19
S.FIEX.CTIME .EQ 8 S.FIEX.EOF .EQ 21
S.FIEX.VERSION .EQ 12 S.FIEX.CTIME .EQ 24
S.FIEX.MVERSION .EQ 13 S.FIEX.VERSION .EQ 28
S.FIEX.ACCESS .EQ 14 S.FIEX.MVERSION .EQ 29
S.FIEX.AUXTYPE .EQ 15 S.FIEX.ACCESS .EQ 30
S.FIEX.MTIME .EQ 17 S.FIEX.AUXTYPE .EQ 31
S.FIEX.BLKPTR .EQ 21 S.FIEX.MTIME .EQ 33
S.FIEX.ACL .EQ 24 S.FIEX.BLKPTR .EQ 37
S.FIEX.ACL .EQ 40
* *
S.FIEX .EQ 32 S.FIEX .EQ 48
*-------------------------------------- *--------------------------------------
MLI .EQ $BF00 MLI .EQ $BF00
*JSPARE .EQ $BF03 *JSPARE .EQ $BF03
@ -151,4 +151,4 @@ MACHID.CLK .EQ %00000001
*KVERSION .EQ $BFFF *KVERSION .EQ $BFFF
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE INC/MLI.I SAVE inc/mli.i

View File

@ -1,6 +1,5 @@
NEW NEW
PREFIX AUTO 3,1
AUTO 4,1
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
* NIC Devices * NIC Devices
@ -23,4 +22,4 @@ S.DCB.NIC.GW .EQ 18
S.DCB.NIC .EQ 22 S.DCB.NIC .EQ 22
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE INC/NIC.I SAVE inc/nic.i

View File

@ -1,6 +1,5 @@
NEW NEW
PREFIX AUTO 3,1
AUTO 4,1
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
* WIZnet W5100 IO Registers * WIZnet W5100 IO Registers
@ -85,4 +84,4 @@ RX.BASE .EQ $6000
RXTX.MASK .EQ $1FFF RXTX.MASK .EQ $1FFF
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE INC/NIC.W5100.I SAVE inc/nic.w5100.i

View File

@ -1,6 +1,5 @@
NEW NEW
PREFIX AUTO 3,1
AUTO 4,1
*-------------------------------------- *--------------------------------------
* ProDOS Reserved ZP Location 00-1F,56-FF * ProDOS Reserved ZP Location 00-1F,56-FF
*-------------------------------------- *--------------------------------------
@ -27,4 +26,4 @@ RNDL .EQ $4E RANDOM NUMBER LOW
RNDH .EQ $4F RANDOM NUMBER HIGH RNDH .EQ $4F RANDOM NUMBER HIGH
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE INC/ZP.I SAVE inc/zp.i

View File

@ -51,17 +51,18 @@ xboot .DA #1
sec apple iii enters xboot 'ora $38' sec apple iii enters xboot 'ora $38'
bcs BB.AppleII branch if not apple iii native mode bcs BB.AppleII branch if not apple iii native mode
*-------------------------------------- *--------------------------------------
BB.AppleIII lda #$9f make apple iii boot using block 1 BB.AppleIII bcc *
pha the return address is $a000 * lda #$9f make apple iii boot using block 1
lda #$ff * pha the return address is $a000
pha * lda #$ff
* pha
inc * inc
tax ldx #0 * tax ldx #0
inc lda #1 (read block 1) * inc lda #1 (read block 1)
jmp $f479 * jmp $f479
*-------------------------------------- *--------------------------------------
BB.AppleII stx unit save unit number BB.AppleII stx unit save unit number
cmp #$03 for disk ii cmp #$03 for disk ii
@ -231,12 +232,12 @@ bterr2 bcs booterr
jmp kernel go execute kernel code. jmp kernel go execute kernel code.
*-------------------------------------- *--------------------------------------
booterr jsr clrscrn clear video booterr jsr clrscrn clear video
ldy #BB.MSG.ERR.Len-1 * ldy #BB.MSG.ERR.Len-1
.1 lda BB.MSG.ERR,y *.1 lda BB.MSG.ERR,y
sta scrn,y * sta scrn,y
dey * dey
bpl .1 * bpl .1
jmp $ff69 jmp $ff69
*-------------------------------------- *--------------------------------------
@ -256,8 +257,8 @@ endcode ldx slotz
jmp BB.Read jmp BB.Read
*-------------------------------------- *--------------------------------------
BB.MSG.ERR .AS -"ERR" *BB.MSG.ERR .AS -"ERR"
BB.MSG.ERR.Len .EQ *-BB.MSG.ERR *BB.MSG.ERR.Len .EQ *-BB.MSG.ERR
BB.ProDOS .DA #$26 $20 = storage type + 6 = "PRODOS" len BB.ProDOS .DA #$26 $20 = storage type + 6 = "PRODOS" len
.AS "PRODOS" .AS "PRODOS"
*-------------------------------------- *--------------------------------------
@ -298,60 +299,83 @@ d2io lda blok figure out track & sector.
jsr BB.Read jsr BB.Read
quitrd ldy IO.D2.DrvOff,x quitrd ldy IO.D2.DrvOff,x
erretrn rts return error status in carry. rts return error status in carry.
*-------------------------------------- *--------------------------------------
BB.Read lda BB.HdrTrk get track we're on BB.Read lda BB.HdrTrk get track we're on
jsr BB.Trk2Qtrk jsr BB.Trk2Qtrk
sta BB.CurQTrk sta BB.CurQTrk
.1 lda BB.CurQTrk ldy #0
cmp BB.TargetQTrk
beq .3
bcs .2 move out, not in .1 ldx BB.CurQTrk
inc tya
beq .2
txa
jsr BB.PhaseOff
.2 cpx BB.TargetQTrk
beq .8
bcs .3
inx
.HS B0 BCS .HS B0 BCS
.2 dec .3 dex
sta BB.CurQTrk
jsr BB.AllPhaseOff
stx BB.CurQTrk
txa
jsr BB.PhaseOn jsr BB.PhaseOn
lda #115 11.5 ms lda #104
jsr BB.MSWait Trash X jsr BB.MSWait Trash X
bcs .1 ALWAYS
iny
bcs .1 CS from BB.MSWait
.3 lda #0 wait 25.5 ms .8 tya
beq seekend
lda #0 wait 25.6 ms
jsr BB.MSWait Trash X jsr BB.MSWait Trash X
jsr BB.AllPhaseOff lda BB.TargetQTrk
bcs seekend ALWAYS jsr BB.PhaseOff
bcs seekend CS from BB.MSWait
*-------------------------------------- *--------------------------------------
BB.AllPhaseOff ldx slotz BB.PhaseOff bit #1 1,3,5,7 ?
bit IO.D2.Ph0Off,x beq BB.PhaseOff.2 only half track
bit IO.D2.Ph3Off,x
bit IO.D2.Ph2Off,x BB.PhaseOff.1 bit IO.D2.Ph0Off
bit IO.D2.Ph1Off,x BB.PhaseOff.2 bit IO.D2.Ph0Off
rts
BB.PhaseOff.8 rts
*-------------------------------------- *--------------------------------------
BB.PhaseOn bit #1 1,3,5,7 ? BB.PhaseOn bit #1 1,3,5,7 ?
beq .7 beq .7
pha pha
inc
jsr .7 jsr .7
pla pla
inc 2,4,6,0
.7 and #6 mask for 0,2,4,6 .7 and #6 mask for 0,2,4,6
ora slotz Slot $n0 ora slotz Slot $n0
ora #IO.D2.Ph0On
tax tax
lda IO.D2.Ph0On,x turn on one phase bit $C000,x turn on one phase
lda BB.PhaseOff.2+1
sta BB.PhaseOff.1+1
dex
stx BB.PhaseOff.2+1
rts rts
*-------------------------------------- *--------------------------------------
BB.MSWait sec (6) JSR (2) BB.MSWait sec (6) JSR (2)
@ -375,7 +399,7 @@ BB.Trk2Qtrk asl x2
lsr x3 lsr x3
.1 adc #$ff SELF MODIFIED .1 adc #$ff SELF MODIFIED
rts BB.Trk2Qtrk.RTS rts
*-------------------------------------- *--------------------------------------
seekend ldx slotz seekend ldx slotz
@ -387,7 +411,7 @@ tryread plp fix stack.
rdhead sec anticipate error. rdhead sec anticipate error.
dec BB.RetryCnt if = 0 then give up! dec BB.RetryCnt if = 0 then give up!
beq erretrn branch if can't fine/read sector. beq BB.Trk2Qtrk.RTS branch if can't fine/read sector.
clc indicate reading header. clc indicate reading header.
rddata php carry set if reading sector. rddata php carry set if reading sector.

View File

@ -11,98 +11,132 @@ D2MotorControl >PULLB MotorOn
lda MotorOn lda MotorOn
asl asl
lda #0 lda #IO.D2.DrvOff
adc #IO.D2.DrvOff
adc Slotn0 adc Slotn0
tax tax
lda $C000,x lda $C000,x
* clc * clc
.9 .9 rts
D2MotorControl.RTS */--------------------------------------
rts *\--------------------------------------
D2Recalibrate >PULLB DrvSlt
jsr CheckDiskII
bcs .9
stz MoveTo
lda #252
sta MoveFrom
jsr D2MoveHead.1
lda #0
jsr D2.PhaseOn
lda #0 wait 25.6 ms
jsr D2.Wait100msA Trash X
lda #0 wait 25.6 ms
jsr D2.Wait100msA Trash X
lda #0 wait 25.6 ms
jsr D2.Wait100msA Trash X
lda #0 wait 25.6 ms
jsr D2.Wait100msA Trash X
jsr D2.PhaseOn.2
clc
.9 rts
*/-------------------------------------- */--------------------------------------
*\-------------------------------------- *\--------------------------------------
D2MoveHead >PULLB MoveTo D2MoveHead >PULLB MoveTo
>PULLB MoveFrom >PULLB MoveFrom
>PULLB DrvSlt >PULLB DrvSlt
jsr CheckDiskII jsr CheckDiskII
bcs D2MotorControl.RTS bcs .9
php
sei
jsr D2MoveHead.1
plp
clc
.9 rts
ldy #0 D2MoveHead.1 ldy #0
.1 lda MoveFrom .1 ldx MoveFrom
cmp MoveTo
beq .3
bcs .2 tya
beq .2
txa
jsr D2.PhaseOff
.2 cpx MoveTo
beq .8
inc MoveFrom<MoveTo, must move in bcs .3
inx MoveFrom<MoveTo, must move in
.HS B0 BCS .HS B0 BCS
.2 dec MoveFrom>MoveTo, must move out .3 dex MoveFrom>MoveTo, must move out
sta MoveFrom stx MoveFrom
pha txa
jsr D2.PhaseOn jsr D2.PhaseOn
lda #85 8.5 ms lda #104
jsr D2.Wait100msA Trash X
pla
jsr D2.PhaseOff
lda #1 0.1 ms
jsr D2.Wait100msA Trash X jsr D2.Wait100msA Trash X
iny iny
bra .1 bra .1
.3 tya .8 tya
beq D2.PhaseOff.8
beq D2.AllPahseOff.8 lda #0 wait 25.6 ms
lda #0 wait 25.5 ms
jsr D2.Wait100msA Trash X jsr D2.Wait100msA Trash X
clc
rts lda MoveTo
*-------------------------------------- *--------------------------------------
D2.AllPhaseOff ldx Slotn0 D2.PhaseOff bit #1 1,3,5,7 ?
bit IO.D2.Ph0Off,x beq D2.PhaseOff.2 only half track
bit IO.D2.Ph3Off,x
bit IO.D2.Ph2Off,x D2.PhaseOff.1 bit IO.D2.Ph0Off SELF MODIFIED
bit IO.D2.Ph1Off,x D2.PhaseOff.2 bit IO.D2.Ph0Off SELF MODIFIED
D2.AllPahseOff.8
clc D2.PhaseOff.8 rts
rts
*-------------------------------------- *--------------------------------------
D2.PhaseOn bit #1 1,3,5,7 ? D2.PhaseOn bit #1 1,3,5,7 ?
beq .7 only half track bne .1 only half track
bcc .1
pha CS : move out
jsr .7 jsr .7
pla bra D2.PhaseOn.2
inc
bcs .7
.1 pha .1 pha
inc
jsr .7 jsr .7
pla pla
inc
jsr .7
bra D2.PhaseOn.1
.7 and #6 mask for 0,2,4,6 .7 and #6 mask for 0,2,4,6
ora Slotn0 Slot $n0 ora Slotn0 Slot $n0
ora #IO.D2.Ph0On ora #IO.D2.Ph0On
tax tax
bit $C000,x turn on one phase
lda D2.PhaseOn.2+1
sta D2.PhaseOn.1+1
stx D2.PhaseOn.2+1
lda D2.PhaseOff.2+1 lda D2.PhaseOff.2+1
sta D2.PhaseOff.1+1 sta D2.PhaseOff.1+1
@ -111,11 +145,8 @@ D2.PhaseOn bit #1 1,3,5,7 ?
stx D2.PhaseOff.2+1 stx D2.PhaseOff.2+1
rts rts
*-------------------------------------- *--------------------------------------
D2.PhaseOff bit #1 1,3,5,7 ? D2.PhaseOn.1 bit IO.D2.Ph0On SELF MODIFIED
beq D2.PhaseOff.2 only half track D2.PhaseOn.2 bit IO.D2.Ph0On SELF MODIFIED
D2.PhaseOff.1 bit $c000
D2.PhaseOff.2 bit $c000
rts rts
*-------------------------------------- *--------------------------------------
D2.Wait100msA sec D2.Wait100msA sec

View File

@ -60,6 +60,7 @@ CS.START cld
.DA GetProDOSCatSize .DA GetProDOSCatSize
.DA BuildProDOSCat .DA BuildProDOSCat
.DA D2MotorControl .DA D2MotorControl
.DA D2Recalibrate
.DA D2MoveHead .DA D2MoveHead
.DA D2TrkRead16s .DA D2TrkRead16s
.DA D2TrkWrite16s .DA D2TrkWrite16s

View File

@ -177,7 +177,7 @@ m128k sta idapple Save MACHID in temp location
.1 .1
* stz $D700,x * stz $D700,x
stz fcbbuf,x stz FCBs,x
stz VCBs,x stz VCBs,x
* stz $DA00,x * stz $DA00,x
* stz $DB00,x * stz $DB00,x

View File

@ -7,7 +7,7 @@ XDOS cld no decimal.
* pla get processor status * pla get processor status
* sta spare1 save it temporarily * sta spare1 save it temporarily
ply ply get processor status
pla find out the address of the caller pla find out the address of the caller
sta A3L sta A3L
@ -22,7 +22,7 @@ XDOS cld no decimal.
* lda spare1 * lda spare1
* pha pull processor status * pha pull processor status
phy phy pull processor status
plp to re-enable interrupts. plp to re-enable interrupts.
cld still no decimal cld still no decimal
@ -84,6 +84,7 @@ godevmgr lsr shift back down for device manager.
gobfmgr lsr shift back down for block file manager. gobfmgr lsr shift back down for block file manager.
and #$1F valid commands are 0-$13 and #$1F valid commands are 0-$13
tax tax
jsr XDOS.bfmgr jsr XDOS.bfmgr
exitmli stz bubit clear backup bit exitmli stz bubit clear backup bit
@ -251,7 +252,12 @@ sysdeath1 tax death error code.
*-------------------------------------- *--------------------------------------
* ProDOS Block File Manager * ProDOS Block File Manager
*-------------------------------------- *--------------------------------------
XDOS.bfmgr lda XDOS.CmdFlags,x translate into command address. XDOS.bfmgr cpx #$14
bcc .1
* >DEBUG
.1 lda XDOS.CmdFlags,x translate into command address.
asl bit 7 indicates pathname to process asl bit 7 indicates pathname to process
sta cmdtemp sta cmdtemp
and #$3F bit 6 is refnum, 5 is time to process and #$3F bit 6 is refnum, 5 is time to process
@ -510,18 +516,19 @@ findfcb ldy #$01 index to ref#
sta fcbptr used as an index to fcb sta fcbptr used as an index to fcb
tay tay
pla restore ref# in acc pla restore ref# in acc
cmp fcbbuf,y cmp FCBs,y
bne errnoref bne errnoref
fndfcbuf lda fcbbuf+11,y get page address of file buffer. fndfcbuf lda FCBs+11,y get page address of file buffer.
jsr getbufadr get file's address into bufaddrl,h jsr getbufadr get file's address into bufaddrl,h
ldx bufaddrh (y=fcbptr preserved) ldx bufaddrh (y=fcbptr preserved)
beq fcbdead fcb corrupted beq fcbdead fcb corrupted
stx datptr+1 save ptr to data area of buffer stx datptr+1 save ptr to data area of buffer
inx inx
inx index block always 2 pages after data inx index block always 2 pages after data
stx zpt+1 stx zpt+1
lda fcbbuf+1,y also set up device # lda FCBs+1,y also set up device #
sta devnum sta devnum
lda bufaddrl lda bufaddrl
sta datptr index and data buffers always on sta datptr index and data buffers always on
@ -529,7 +536,7 @@ fndfcbuf lda fcbbuf+11,y get page address of file buffer.
fndfvol tax search for associated vcb fndfvol tax search for associated vcb
lda VCBs+VCB.DEV,x lda VCBs+VCB.DEV,x
cmp fcbbuf+1,y is this vcb the same device? cmp FCBs+1,y is this vcb the same device?
beq tstvopen if it is, make sure volume is active. beq tstvopen if it is, make sure volume is active.
nxtfvol txa adjust index to next vcb. nxtfvol txa adjust index to next vcb.
@ -550,7 +557,7 @@ tstvopen lda VCBs,x make sure this vcb is open.
rts rts
errnoref lda #$00 put a zero into this fcb to errnoref lda #$00 put a zero into this fcb to
sta fcbbuf,y show free fcb. sta FCBs,y show free fcb.
badref lda #MLI.E.BADREF requested refnum is badref lda #MLI.E.BADREF requested refnum is
sec illegal (out of range) sec illegal (out of range)
@ -660,11 +667,11 @@ olinerr1 pha save error code.
H34CE sec flag error H34CE sec flag error
rts rts
H34D0 lda VCBs,x get volume name count H34D0 lda VCBs,x get volume name count
sta namcnt sta namcnt
ldy namptr index to user's buffer. ldy namptr index to user's buffer.
H34D9 lda VCBs,x move name to user's buffer H34D9 lda VCBs,x move name to user's buffer
sta (usrbuf),y sta (usrbuf),y
inx inx
iny iny
@ -726,7 +733,7 @@ H352A lda bloknml preserve disk address of current (last)
sta gbuf+2 save block address in y,a to sta gbuf+2 save block address in y,a to
sty gbuf+3 current directory. sty gbuf+3 current directory.
jsr XDOS.WriteGBuf update directory block with new link. jsr XDOS.WriteGBuf update directory block with new link.
bcs H351D if error bcs H351D if error
ldx #$01 ldx #$01
@ -745,21 +752,24 @@ clrdir sta gbuf+2,x
inx inx
bne clrdir bne clrdir
jsr XDOS.WriteGBuf write prepared directory extension. jsr XDOS.WriteGBuf write prepared directory extension.
bcs H351D if error bcs H351D if error
lda own_blk lda own_blk
ldx own_blk+1 ldx own_blk+1
jsr XDOS.ReadGBufAX read in parent directory block jsr XDOS.ReadGBufAX read in parent directory block
ldx own_ent and calc entry address. ldx own_ent and calc entry address.
lda /gbuf lda /gbuf
sta zpt+1 sta zpt+1
lda #$04 lda #$04
ocalc clc ocalc clc
dex has entry address been calulated? dex has entry address been calulated?
beq H3584 if yes. beq H3584 if yes.
adc own_len next entry address adc own_len next entry address
bcc ocalc bcc ocalc
inc zpt+1 entry must be in 2nd 256 bytes of block inc zpt+1 entry must be in 2nd 256 bytes of block
bcs ocalc always taken. bcs ocalc always taken.
@ -811,6 +821,7 @@ cmvname lda (A3L),y y = index to file kind.
cmp #$04 cmp #$04
lda #$10 assume tree type lda #$10 assume tree type
bcc csvfkind bcc csvfkind
lda #$D0 it's directory. lda #$D0 it's directory.
csvfkind ldx namptr index to local name of pathname. csvfkind ldx namptr index to local name of pathname.
@ -919,7 +930,7 @@ cralcblk jsr alc1blk get address of file's data block
sty d_frst+1 sty d_frst+1
sta bloknml sta bloknml
sty bloknml+1 sty bloknml+1
jsr XDOS.WriteGBuf go write data block of file jsr XDOS.WriteGBuf go write data block of file
bcs crerr3 bcs crerr3
inc h_fcnt add 1 to total # of files in this dir inc h_fcnt add 1 to total # of files in this dir
@ -994,7 +1005,7 @@ H36E0 jsr XDOS.WriteGBuf go write updated directory block.
lda d_head get address of header block and lda d_head get address of header block and
ldx d_head+1 ldx d_head+1
jsr XDOS.ReadGBufAX go read in header block to modify. jsr XDOS.ReadGBufAX go read in header block to modify.
bcs crerr3 bcs crerr3
uphead ldy #$01 update current # of files in this dir. uphead ldy #$01 update current # of files in this dir.
@ -1006,7 +1017,7 @@ H36F2 lda h_fcnt,y
lda h_attr also update header's attributes. lda h_attr also update header's attributes.
sta gbuf+34 sta gbuf+34
jsr XDOS.WriteGBuf go write updated header jsr XDOS.WriteGBuf go write updated header
bcs H375A bcs H375A
ripple lda gbuf+4 test for 'root' directory because ripple lda gbuf+4 test for 'root' directory because
@ -1021,7 +1032,7 @@ ripple lda gbuf+4 test for 'root' directory because
lda gbuf+39 get addr of parent entry's dir block lda gbuf+39 get addr of parent entry's dir block
ldx gbuf+40 ldx gbuf+40
jsr XDOS.ReadGBufAX read it jsr XDOS.ReadGBufAX read it
bcs H375A bcs H375A
jsr entcalc get indirect ptr to parent entry in gbuf jsr entcalc get indirect ptr to parent entry in gbuf
@ -1038,7 +1049,7 @@ H3732 lda p8date,x
dex dex
bpl H3732 bpl H3732
H373B jsr XDOS.WriteGBuf write updated entry back to disk. H373B jsr XDOS.WriteGBuf write updated entry back to disk.
bcs H375A if error. bcs H375A if error.
ldy #$25 compare current block # to this ldy #$25 compare current block # to this

View File

@ -238,18 +238,17 @@ wrtbmap lda #$02 write command.
txa error code txa error code
L3DB6 rts L3DB6 rts
*-------------------------------------- *--------------------------------------
rdblk
XDOS.ReadGBufAX sta bloknml XDOS.ReadGBufAX sta bloknml
stx bloknml+1 stx bloknml+1
rdgbuf
XDOS.ReadGBuf lda #$01 read command. XDOS.ReadGBuf lda #$01 read command.
.HS 2C BIT ABS .HS 2C BIT ABS
wrtgbuf
XDOS.WriteGBuf lda #$02 write command XDOS.WriteGBuf lda #$02 write command
sta A4L pass to device handler. sta A4L pass to device handler.
lda /gbuf general buffer. lda /gbuf general buffer.
dobitmap
XDOS.RWBlock php no interrupts XDOS.RWBlock php no interrupts
sei sei
sta buf+1 buffer high. sta buf+1 buffer high.
@ -277,7 +276,7 @@ XDOS.GetMark ldx fcbptr index to open fcb.
ldy #$02 index to user's mark parmeter. ldy #$02 index to user's mark parmeter.
.1 lda fcbbuf+18,x transfer current position .1 lda FCBs+18,x transfer current position
sta (A3L),y to user's parameter list sta (A3L),y to user's parameter list
inx inx
iny iny
@ -301,7 +300,7 @@ XDOS.SetMark ldy #$04 index to user's desired position.
sta tposll-2,y sta tposll-2,y
bcc .2 branch if mark < eof bcc .2 branch if mark < eof
cmp fcbbuf+21,x cmp FCBs+21,x
bcc .2 branch if mark qualifies. bcc .2 branch if mark qualifies.
bne L3DFD branch if mark > eof (invalid position) bne L3DFD branch if mark > eof (invalid position)
@ -314,7 +313,7 @@ XDOS.SetMark ldy #$04 index to user's desired position.
bne .1 branch if more. bne .1 branch if more.
rdposn ldy fcbptr test to see if new position is rdposn ldy fcbptr test to see if new position is
lda fcbbuf+19,y within the same (current) data block. lda FCBs+19,y within the same (current) data block.
and #$FE and #$FE
sta scrtch sta scrtch
lda tposlh middle byte of new position lda tposlh middle byte of new position
@ -322,81 +321,105 @@ rdposn ldy fcbptr test to see if new position is
sbc scrtch sbc scrtch
sta scrtch sta scrtch
bcc L3E44 branch if < current position. bcc L3E44 branch if < current position.
cmp #$02 must be within 512 bytes of beginning cmp #$02 must be within 512 bytes of beginning
bcs L3E44 of current position. bcs L3E44 of current position.
lda tposhi make sure within the same 64k. lda tposhi make sure within the same 64k.
cmp fcbbuf+20,y cmp FCBs+20,y
bne L3E44 branch if not. bne L3E44 branch if not.
jmp svmark if so, adj fcb, position ptr and return. jmp svmark if so, adj fcb, position ptr and return.
L3E44 lda fcbbuf+7,y determine file type for positioning.
L3E44 lda FCBs+7,y determine file type for positioning.
beq L3E50 0 = invalid file type. beq L3E50 0 = invalid file type.
cmp #$04 tree class file? cmp #$04 tree class file?
bcc L3E59 yes, go position. bcc L3E59 yes, go position.
jmp dirmark no, test for dir type. jmp dirmark no, test for dir type.
L3E50 ldy #$A4 clear illegal filetype entry in fcb L3E50 ldy #$A4 clear illegal filetype entry in fcb
sta fcbbuf,y sta FCBs,y
lda #$43 and report error lda #$43 and report error
sec sec
rts rts
L3E59 lda fcbbuf+7,y use storage type as # of index levels L3E59 lda FCBs+7,y use storage type as # of index levels
sta levels since 1=seed, 2=sapling, 3=tree. sta levels since 1=seed, 2=sapling, 3=tree.
lda fcbbuf+8,y lda FCBs+8,y
and #$40 if previous data was modified then and #$40 if previous data was modified then
beq L3E6B disk must be updated. beq L3E6B disk must be updated.
jsr wfcbdat jsr wfcbdat
bcs L3ED4 if error. bcs L3ED4 if error.
L3E6B ldy fcbptr test to see if current index block L3E6B ldy fcbptr test to see if current index block
lda fcbbuf+20,y is usable by checking if new lda FCBs+20,y is usable by checking if new
and #$FE position is within 128k of the and #$FE position is within 128k of the
sta scrtch beginning of current sapling level sta scrtch beginning of current sapling level
lda tposhi chunk. lda tposhi chunk.
sec sec
sbc scrtch sbc scrtch
bcc L3E9D branch if a new index block is needed. bcc L3E9D branch if a new index block is needed.
cmp #$02 is new position within 128k of old ? cmp #$02 is new position within 128k of old ?
bcs L3E9D branch if not. bcs L3E9D branch if not.
ldx levels is it a seed file ? ldx levels is it a seed file ?
dex dex
bne datlevel no, use current indexes. bne datlevel no, use current indexes.
L3E89 lda tposlh is new position < 512 ? L3E89 lda tposlh is new position < 512 ?
lsr lsr
ora tposhi ora tposhi
bne L3EEF no, mark both data and index block as bne L3EEF no, mark both data and index block as
lda fcbbuf+12,y unallocated. 1st block is only block
lda FCBs+12,y unallocated. 1st block is only block
sta bloknml and it's data. sta bloknml and it's data.
lda fcbbuf+13,y high block address. lda FCBs+13,y high block address.
jmp rnewpos go read in block and set statuses. jmp rnewpos go read in block and set statuses.
L3E9D lda fcbbuf+8,y check to see if previous index block
L3E9D lda FCBs+8,y check to see if previous index block
and #$80 was modified. and #$80 was modified.
beq L3EA9 read in over it if current up to date. beq L3EA9 read in over it if current up to date.
jsr wfcbidx go update index on disk (fcb block addr) jsr wfcbidx go update index on disk (fcb block addr)
bcs L3ED4 bcs L3ED4
L3EA9 ldx levels be sure there is a top index L3EA9 ldx levels be sure there is a top index
cpx #$03 before reading it... cpx #$03 before reading it...
beq posindex branch if file is a tree. beq posindex branch if file is a tree.
lda tposhi is new position within range of a lda tposhi is new position within range of a
lsr sapling file (less than 128k) ? lsr sapling file (less than 128k) ?
php save results php save results
lda #$07 (no level is allocated for new pos'n) lda #$07 (no level is allocated for new pos'n)
plp restore z-flag. plp restore z-flag.
bne L3F18 go mark all as dummy. bne L3F18 go mark all as dummy.
jsr clrstats clr status bits 0,1,2 (index/data/alloc) jsr clrstats clr status bits 0,1,2 (index/data/alloc)
dex check for seed dex check for seed
beq L3E89 if seed, check for position < 512. beq L3E89 if seed, check for position < 512.
jsr rfcbfst go get only index block. jsr rfcbfst go get only index block.
bcs L3ED4 if error. bcs L3ED4 if error.
ldy fcbptr save newly loaded index block's address. ldy fcbptr save newly loaded index block's address.
lda bloknml lda bloknml
sta fcbbuf+14,y sta FCBs+14,y
lda bloknml+1 lda bloknml+1
sta fcbbuf+15,y sta FCBs+15,y
bcc datlevel branch always bcc datlevel branch always
L3ED4 rts L3ED4 rts
posindex jsr clrstats clr all alloc requirements for previous posindex jsr clrstats clr all alloc requirements for previous
jsr rfcbfst position. get highest level index block jsr rfcbfst position. get highest level index block
bcs L3ED4 bcs L3ED4
lda tposhi then test for a sap level index block lda tposhi then test for a sap level index block
lsr lsr
tay tay
@ -404,17 +427,22 @@ posindex jsr clrstats clr all alloc requirements for previous
inc zpt+1 inc zpt+1
cmp (zpt),y (both high and low = 0 if no index exists) cmp (zpt),y (both high and low = 0 if no index exists)
bne saplevel bne saplevel
tax are both bytes 0 ? tax are both bytes 0 ?
bne saplevel bne saplevel
dec zpt+1 dec zpt+1
L3EEF lda #$03 show neither index or data block alloc'd L3EEF lda #$03 show neither index or data block alloc'd
bra L3F18 bra L3F18
saplevel sta bloknml read in next lower index block. saplevel sta bloknml read in next lower index block.
lda (zpt),y (high address) lda (zpt),y (high address)
sta bloknml+1 sta bloknml+1
dec zpt+1 dec zpt+1
jsr rfcbidx read in sapling level jsr rfcbidx read in sapling level
bcs L3ED4 bcs L3ED4
datlevel lda tposhi get block address of data block datlevel lda tposhi get block address of data block
lsr lsr
lda tposlh ( if there is one ) lda tposlh ( if there is one )
@ -424,17 +452,21 @@ datlevel lda tposhi get block address of data block
inc zpt+1 inc zpt+1
cmp (zpt),y cmp (zpt),y
bne L3F51 bne L3F51
tax tax
bne L3F51 bne L3F51
lda #$01 show data block as never been allocated lda #$01 show data block as never been allocated
dec zpt+1 dec zpt+1
L3F18 ldy fcbptr set status to show what's missing L3F18 ldy fcbptr set status to show what's missing
ora fcbbuf+8,y ora FCBs+8,y
sta fcbbuf+8,y sta FCBs+8,y
lsr discard bit that says data block lsr discard bit that says data block
lsr unallocated because carry indicates if lsr unallocated because carry indicates if
jsr zipdata index block is invalid and needs to be jsr zipdata index block is invalid and needs to be
bcc svmark zeroed. branch if it doesn't need zeroed bcc svmark zeroed. branch if it doesn't need zeroed
jsr zeroindex zero index block in user's i/o buffer jsr zeroindex zero index block in user's i/o buffer
bra svmark bra svmark
@ -458,30 +490,38 @@ zipdata lda #$00
L3F42 sta (datptr),y zero out data area L3F42 sta (datptr),y zero out data area
iny iny
bne L3F42 bne L3F42
inc datptr+1 inc datptr+1
L3F49 sta (datptr),y L3F49 sta (datptr),y
iny iny
bne L3F49 bne L3F49
dec datptr+1 dec datptr+1
rts rts
L3F51 sta bloknml get data block of new position L3F51 sta bloknml get data block of new position
lda (zpt),y (high address) lda (zpt),y (high address)
dec zpt+1 dec zpt+1
rnewpos sta bloknml+1 rnewpos sta bloknml+1
jsr rfcbdat jsr rfcbdat
bcs L3F86 if error. bcs L3F86 if error.
jsr clrstats show whole chain is allocated. jsr clrstats show whole chain is allocated.
svmark ldy fcbptr update position in fcb svmark ldy fcbptr update position in fcb
iny iny
iny iny
ldx #$02 ldx #$02
L3F68 lda fcbbuf+18,y save old mark in case calling routine L3F68 lda FCBs+18,y save old mark in case calling routine
sta oldmark,x fails later. sta oldmark,x fails later.
lda tposll,x lda tposll,x
sta fcbbuf+18,y sta FCBs+18,y
dey dey
dex move 3 byte position marker dex move 3 byte position marker
bpl L3F68 bpl L3F68
clc set up indirect address to buffer clc set up indirect address to buffer
lda datptr page pointed to by the current lda datptr page pointed to by the current
sta sos position marker. sta sos position marker.
@ -490,10 +530,11 @@ L3F68 lda fcbbuf+18,y save old mark in case calling routine
adc datptr+1 adc datptr+1
sta sos+1 sta sos+1
L3F86 rts carry set if error L3F86 rts carry set if error
clrstats ldy fcbptr clear allocation states for data block clrstats ldy fcbptr clear allocation states for data block
lda fcbbuf+8,y and both levels of indexes/ lda FCBs+8,y and both levels of indexes/
and #$F8 and #$F8
sta fcbbuf+8,y indicates that either they exist now sta FCBs+8,y indicates that either they exist now
rts or unnecessary for current position. rts or unnecessary for current position.
dirmark cmp #$0D is it a directory ? dirmark cmp #$0D is it a directory ?
@ -505,27 +546,35 @@ dirmark cmp #$0D is it a directory ?
L3F9C lda scrtch recover results of previous subtraction. L3F9C lda scrtch recover results of previous subtraction.
lsr use difference as counter for how many lsr use difference as counter for how many
sta cntent blocks must be read to get to new pos'n. sta cntent blocks must be read to get to new pos'n.
lda fcbbuf+19,y test for positive direction lda FCBs+19,y test for positive direction
cmp tposlh indicated by carry. cmp tposlh indicated by carry.
bcc L3FB9 if set, position forward. otherwise, bcc L3FB9 if set, position forward. otherwise,
L3FAB ldy #$00 read directory file in reverse order. L3FAB ldy #$00 read directory file in reverse order.
jsr dirpos1 read previous block. jsr dirpos1 read previous block.
bcs L3FD6 if error. bcs L3FD6 if error.
inc cntent count up to 128. inc cntent count up to 128.
bpl L3FAB loop if more blocks to pass over. bpl L3FAB loop if more blocks to pass over.
bmi svmark always. bmi svmark always.
L3FB9 ldy #$02 position is forward from current. L3FB9 ldy #$02 position is forward from current.
jsr dirpos1 read next directory block jsr dirpos1 read next directory block
bcs L3FD6 if error. bcs L3FD6 if error.
dec cntent dec cntent
bne L3FB9 loop if position not found in this block bne L3FB9 loop if position not found in this block
beq svmark branch always. beq svmark branch always.
dirpos1 lda (datptr),y get link address of previous or next dirpos1 lda (datptr),y get link address of previous or next
sta bloknml directory block. sta bloknml directory block.
cmp #$01 test for null byte into carry cmp #$01 test for null byte into carry
iny but first be sure there is a link. iny but first be sure there is a link.
lda (datptr),y get the rest of the link. lda (datptr),y get the rest of the link.
bne L3FD8 branch if certain link exists. bne L3FD8 branch if certain link exists.
bcs L3FD8 was the low part null as well ? bcs L3FD8 was the low part null as well ?
lda #MLI.E.EOF something is wrong with directory file! lda #MLI.E.EOF something is wrong with directory file!
@ -541,11 +590,12 @@ rfcbdat lda #$01 read command
ldx #datptr points at address of data buffer. ldx #datptr points at address of data buffer.
jsr fileio1 go do file input. jsr fileio1 go do file input.
bcs L3FF2 error. bcs L3FF2 error.
ldy fcbptr ldy fcbptr
lda bloknml lda bloknml
sta fcbbuf+16,y save block # just read in fcb. sta FCBs+16,y save block # just read in fcb.
lda bloknml+1 lda bloknml+1
sta fcbbuf+17,y sta FCBs+17,y
L3FF2 rts L3FF2 rts
rfcbidx lda #$01 prepare to read index block : read command rfcbidx lda #$01 prepare to read index block : read command
@ -553,11 +603,12 @@ rfcbidx lda #$01 prepare to read index block : read command
ldx #$48 address of current index buffer. ldx #$48 address of current index buffer.
jsr fileio1 go read index block. jsr fileio1 go read index block.
bcs L400C error bcs L400C error
ldy fcbptr ldy fcbptr
lda bloknml lda bloknml
sta fcbbuf+14,y save block address of this index in fcb sta FCBs+14,y save block address of this index in fcb
lda bloknml+1 lda bloknml+1
sta fcbbuf+15,y sta FCBs+15,y
clc clc
L400C rts L400C rts
@ -576,9 +627,9 @@ rfcbfst lda #$01 read command.
ldx #$48 rd block into index portion of file buf ldx #$48 rd block into index portion of file buf
dofileio sta A4L command dofileio sta A4L command
lda fcbbuf,y get disk block address from fcb. lda FCBs,y get disk block address from fcb.
sta bloknml block 0 not legal sta bloknml block 0 not legal
cmp fcbbuf+1,y cmp FCBs+1,y
bne L4031 bne L4031
cmp #$00 are both bytes 0 ? cmp #$00 are both bytes 0 ?
bne L4031 no, continue request bne L4031 no, continue request
@ -586,7 +637,7 @@ dofileio sta A4L command
lda #$0C otherwise, allocation error. lda #$0C otherwise, allocation error.
jsr sysdeath doesn't return... jsr sysdeath doesn't return...
L4031 lda fcbbuf+1,y high address of disk block L4031 lda FCBs+1,y high address of disk block
sta bloknml+1 sta bloknml+1
fileio1 php no interrupts fileio1 php no interrupts
@ -596,7 +647,7 @@ fileio1 php no interrupts
lda $01,x lda $01,x
sta buf+1 and pass address to device handler sta buf+1 and pass address to device handler
ldy fcbptr ldy fcbptr
lda fcbbuf+1,y lda FCBs+1,y
sta devnum along with device #. sta devnum along with device #.
lda #$FF also, set to indicate reg call made to lda #$FF also, set to indicate reg call made to
sta ioaccess device handler. sta ioaccess device handler.
@ -634,8 +685,8 @@ wfcbidx jsr upbmap update bitmap.
bcs L4096 if errors. bcs L4096 if errors.
lda #$7F mark index status as current. lda #$7F mark index status as current.
L408D ldy fcbptr change status byte to reflect L408D ldy fcbptr change status byte to reflect
and fcbbuf+8,y successful disk file update. and FCBs+8,y successful disk file update.
sta fcbbuf+8,y (carry is unaffected) sta FCBs+8,y (carry is unaffected)
L4096 rts L4096 rts
*-------------------------------------- *--------------------------------------
XDOS.Open jsr findfile look up the file. XDOS.Open jsr findfile look up the file.
@ -663,7 +714,7 @@ L40B9 ldx #$1F assign fcb,
lda #0 lda #0
L40BD sta fcbbuf,y but clean it first. L40BD sta FCBs,y but clean it first.
iny iny
dex dex
bpl L40BD bpl L40BD
@ -674,7 +725,7 @@ L40BD sta fcbbuf,y but clean it first.
tay tay
L40CB lda d_dev-1,x move ownership info. L40CB lda d_dev-1,x move ownership info.
sta fcbbuf,y note: this code depends upon the defined sta FCBs,y note: this code depends upon the defined
dey order of both the fcb and directory dey order of both the fcb and directory
dex entry buffer. dex entry buffer.
bne L40CB bne L40CB
@ -685,7 +736,7 @@ L40CB lda d_dev-1,x move ownership info.
lsr lsr
lsr lsr
tax save in x for later comparison tax save in x for later comparison
sta fcbbuf+7,y and in fcb for future access. sta FCBs+7,y and in fcb for future access.
lda d_attr get file's attributes and use it lda d_attr get file's attributes and use it
and #$03 as a default access request. and #$03 as a default access request.
cpx #$0D if directory, don't allow write enable. cpx #$0D if directory, don't allow write enable.
@ -693,7 +744,7 @@ L40CB lda d_dev-1,x move ownership info.
and #$01 read enabled bit and #$01 read enabled bit
L40EB sta fcbbuf+9,y L40EB sta FCBs+9,y
and #$02 check for write enabled request. and #$02 check for write enabled request.
beq L40F7 branch for open as read-only beq L40F7 branch for open as read-only
@ -713,25 +764,25 @@ L4101 sta bloknml+1 of file and current usage count.
ora ofcbtbl,x this is done via a translation table ora ofcbtbl,x this is done via a translation table
tay between directory info and fcb. tay between directory info and fcb.
lda d_frst,x lda d_frst,x
sta fcbbuf,y sta FCBs,y
dex dex
bpl L4101 last loop stores hi address of 1st block bpl L4101 last loop stores hi address of 1st block
sta bloknml and this is the low one. sta bloknml and this is the low one.
ldy fcbptr ldy fcbptr
lda cntent this was set up by 'tstopen'. lda cntent this was set up by 'tstopen'.
sta fcbbuf,y claim fcb for this file. sta FCBs,y claim fcb for this file.
jsr alcbuffr go allocate buffer in memory tables. jsr alcbuffr go allocate buffer in memory tables.
bcs L4147 if errors. bcs L4147 if errors.
jsr fndfcbuf rtn addr of bufs in data & index ptrs. jsr fndfcbuf rtn addr of bufs in data & index ptrs.
lda flevel mark level at which lda flevel mark level at which
sta fcbbuf+27,y file was opened. sta FCBs+27,y file was opened.
lda fcbbuf+7,y file must be positioned at beginning. lda FCBs+7,y file must be positioned at beginning.
cmp #$04 is it a tree file ? cmp #$04 is it a tree file ?
bcs L415E no, assume a directory. bcs L415E no, assume a directory.
lda #$FF fool the position routine into giving lda #$FF fool the position routine into giving
sta fcbbuf+20,y a valid position with preloaded data, sta FCBs+20,y a valid position with preloaded data,
ldy #$02 etc. set desired position to 0. ldy #$02 etc. set desired position to 0.
lda #$00 lda #$00
@ -745,14 +796,14 @@ L413C sta tposll,y
L4147 pha save error code. L4147 pha save error code.
ldy fcbptr free buffer space. ldy fcbptr free buffer space.
lda fcbbuf+11,y lda FCBs+11,y
beq L4156 if no bufnum, ok because never alloc'd. beq L4156 if no bufnum, ok because never alloc'd.
jsr relbuffr go release buffer. jsr relbuffr go release buffer.
ldy fcbptr since error was before file was ldy fcbptr since error was before file was
L4156 lda #$00 successfully opened, then it is L4156 lda #$00 successfully opened, then it is
sta fcbbuf,y necessary to release fcb also. sta FCBs,y necessary to release fcb also.
pla error code. pla error code.
sec sec
rts rts
@ -767,7 +818,7 @@ L4163 ldx vcbptr index to vcb.
* ror VCBs+VCB.OF,x least 1 file active. * ror VCBs+VCB.OF,x least 1 file active.
ldy fcbptr index to fcb. ldy fcbptr index to fcb.
lda fcbbuf,y return ref # to user. lda FCBs,y return ref # to user.
ldy #$05 ldy #$05
sta (A3L),y sta (A3L),y
clc open is successful clc open is successful
@ -784,7 +835,7 @@ L4188 tay index to next fcb.
inc cntent inc cntent
L4191 lda fcbbuf,y is this fcb in use ? L4191 lda FCBs,y is this fcb in use ?
bne L41A3 yes. bne L41A3 yes.
txa if not, should we claim it ? txa if not, should we claim it ?
@ -800,7 +851,7 @@ L41A3 tya add offset to index to ownership info
tay and put it back in y. tay and put it back in y.
ldx #$06 index to directory entry owner info. ldx #$06 index to directory entry owner info.
L41A9 lda fcbbuf,y all bytes must match to say that it's L41A9 lda FCBs,y all bytes must match to say that it's
cmp d_dev-1,x the same file again. cmp d_dev-1,x the same file again.
bne L41C1 if not, then next fcb. bne L41C1 if not, then next fcb.
@ -809,7 +860,7 @@ L41A9 lda fcbbuf,y all bytes must match to say that it's
bne L41A9 loop to check all owner info. bne L41A9 loop to check all owner info.
inc totent file is already open, now see inc totent file is already open, now see
lda fcbbuf+9,y if it's already opened for write. and #$02 if so report file busy (with carry set). lda FCBs+9,y if it's already opened for write. and #$02 if so report file busy (with carry set).
and #$02 if so report file busy (with carry set). and #$02 if so report file busy (with carry set).
beq L41C1 branch if this file is read access only. beq L41C1 branch if this file is read access only.
sec sec

View File

@ -12,11 +12,11 @@ XDOS.Read jsr mvdbufr xfer buffer address and request count
bcc L4205 branch if result mark < eof. adjust bcc L4205 branch if result mark < eof. adjust
ldy fcbptr request to read until just before eof. ldy fcbptr request to read until just before eof.
lda fcbbuf+21,y result = (eof-1) - position lda FCBs+21,y result = (eof-1) - position
sbc tposll sbc tposll
sta cbytes sta cbytes
sta rwreql sta rwreql
lda fcbbuf+22,y lda FCBs+22,y
sbc tposlh sbc tposlh
sta cbytes+1 sta cbytes+1
sta rwreqh sta rwreqh
@ -158,12 +158,12 @@ preprw ldy fcbptr adj pointer to user's buffer to make
sta usrbuf sta usrbuf
bcs L42E9 if no adjustment to hi address needed bcs L42E9 if no adjustment to hi address needed
dec usrbuf+1 dec usrbuf+1
L42E9 lda fcbbuf+31,y test for new line enabled. L42E9 lda FCBs+31,y test for new line enabled.
clc clc
beq L42F9 if new line not enabled. beq L42F9 if new line not enabled.
sec carry indicates new line enabled sec carry indicates new line enabled
sta nlmask sta nlmask
lda fcbbuf+10,y move newline character to more lda FCBs+10,y move newline character to more
sta nlchar accesible spot. sta nlchar accesible spot.
L42F9 ldy tposll index to 1st data. L42F9 ldy tposll index to 1st data.
lda datptr reset low order of position pointer to lda datptr reset low order of position pointer to
@ -279,10 +279,10 @@ dread jsr rdposn
ldy #$00 provide dummy back pointer for future ldy #$00 provide dummy back pointer for future
ldx fcbptr re-position. x = hi byte of last block ldx fcbptr re-position. x = hi byte of last block
L43A6 lda fcbbuf+16,x L43A6 lda FCBs+16,x
sta (datptr),y sta (datptr),y
stz fcbbuf+16,x mark current block as impossible stz FCBs+16,x mark current block as impossible
inx inx
iny inc indexes to do both hi and low bytes iny inc indexes to do both hi and low bytes
cpy #$02 cpy #$02
@ -302,7 +302,7 @@ mvcbytes ldy #$04 move request count to a more accessable location
sta cbytes+1 sta cbytes+1
sta rwreqh sta rwreqh
ldy fcbptr return y = val(fcbptr), ldy fcbptr return y = val(fcbptr),
lda fcbbuf+9,y a = attributes lda FCBs+9,y a = attributes
clc and carry clear... clc and carry clear...
rts rts
@ -314,7 +314,7 @@ mvdbufr ldy #$02 move the pointer to user's buffer
sta usrbuf+1 sta usrbuf+1
gfcbstyp ldy fcbptr return storage type gfcbstyp ldy fcbptr return storage type
lda fcbbuf+7,y lda FCBs+7,y
rts rts
* this subroutine adds the requested byte count to mark and returns sum * this subroutine adds the requested byte count to mark and returns sum
@ -327,7 +327,7 @@ gfcbstyp ldy fcbptr return storage type
calcmrk ldx #$00 calcmrk ldx #$00
ldy fcbptr ldy fcbptr
clc clc
L43EE lda fcbbuf+18,y L43EE lda FCBs+18,y
sta tposll,x sta tposll,x
sta oldmark,x sta oldmark,x
adc cbytes,x adc cbytes,x
@ -341,7 +341,7 @@ L43EE lda fcbbuf+18,y
bne L43EE always. bne L43EE always.
eoftest lda scrtch,x new mark in scrtch. eoftest lda scrtch,x new mark in scrtch.
cmp fcbbuf+21,y is new position > eof ? cmp FCBs+21,y is new position > eof ?
bcc L4414 no, proceed. bcc L4414 no, proceed.
bne L4414 yes, adjust 'cbytes' request bne L4414 yes, adjust 'cbytes' request
@ -354,9 +354,9 @@ L4414 rts
werreof jsr plus2fcb reset eof to pre-error position. werreof jsr plus2fcb reset eof to pre-error position.
L4418 lda oldeof,x place oldeof back into fcb L4418 lda oldeof,x place oldeof back into fcb
sta fcbbuf+21,y sta FCBs+21,y
lda oldmark,x also reset mark to last best lda oldmark,x also reset mark to last best
sta fcbbuf+18,y write position sta FCBs+18,y write position
sta scrtch,x and copy mark to scrtch for test of sta scrtch,x and copy mark to scrtch for test of
dey eof less than mark. dey eof less than mark.
dex dex
@ -369,12 +369,12 @@ L4418 lda oldeof,x place oldeof back into fcb
wadjeof jsr plus2fcb get y=fcbptr+2, x=2, a=y. wadjeof jsr plus2fcb get y=fcbptr+2, x=2, a=y.
L4434 lda fcbbuf+21,y copy eof to old eof L4434 lda FCBs+21,y copy eof to old eof
sta oldeof,x sta oldeof,x
bcc L4442 and if carry set... bcc L4442 and if carry set...
lda scrtch,x then copy scrtch to fcb's eof. lda scrtch,x then copy scrtch to fcb's eof.
sta fcbbuf+21,y sta FCBs+21,y
L4442 dey L4442 dey
dex copy all 3 bytes dex copy all 3 bytes
@ -457,7 +457,7 @@ L44B8 jsr alcwblk go allocate for data block.
jsr gfcbstat clear allocation required bits in status jsr gfcbstat clear allocation required bits in status
ora #$80 but first indicate index block is dirty. ora #$80 but first indicate index block is dirty.
and #$F8 and #$F8
sta fcbbuf+8,y sta FCBs+8,y
lda tposhi calculate position within index block. lda tposhi calculate position within index block.
lsr lsr
lda tposlh lda tposlh
@ -471,9 +471,9 @@ L44B8 jsr alcwblk go allocate for data block.
lda scrtch block. get low block address. lda scrtch block. get low block address.
sta (zpt),y store low address. sta (zpt),y store low address.
ldy fcbptr update fcb to indicate that this block ldy fcbptr update fcb to indicate that this block
sta fcbbuf+16,y is allocated. sta FCBs+16,y is allocated.
txa get high address again. txa get high address again.
sta fcbbuf+17,y sta FCBs+17,y
L44E9 jsr preprw L44E9 jsr preprw
jsr wrtpart jsr wrtpart
@ -541,7 +541,7 @@ L4549 sty tposll save low position
php save statuses php save statuses
jsr gfcbstat jsr gfcbstat
ora #$50 ora #$50
sta fcbbuf+8,y sta FCBs+8,y
clc adjust user's low buffer address clc adjust user's low buffer address
lda tposll lda tposll
adc usrbuf adc usrbuf
@ -583,9 +583,9 @@ L457A jsr alcwblk get another block address for the sap
sta (zpt),y save hi address sta (zpt),y save hi address
dec zpt+1 dec zpt+1
ldy fcbptr make newly allocated block the current ldy fcbptr make newly allocated block the current
sta fcbbuf+15,y index block. sta FCBs+15,y index block.
txa txa
sta fcbbuf+14,y sta FCBs+14,y
jsr wfcbfst save new top of tree jsr wfcbfst save new top of tree
bcs L45B1 bcs L45B1
@ -604,18 +604,18 @@ swapdown jsr alcwblk make current seed into a sapling, allocate a block befo
bcs L45F6 return errors. bcs L45F6 return errors.
ldy fcbptr get previous first block ldy fcbptr get previous first block
lda fcbbuf+12,y address into index block. lda FCBs+12,y address into index block.
pha save temporarily while swapping in new pha save temporarily while swapping in new
lda scrtch top index. get new block address (low) lda scrtch top index. get new block address (low)
tax tax
sta fcbbuf+12,y sta FCBs+12,y
lda fcbbuf+13,y lda FCBs+13,y
pha pha
lda scrtch+1 and high address too lda scrtch+1 and high address too
sta fcbbuf+13,y sta FCBs+13,y
sta fcbbuf+15,y make new top also the current index in sta FCBs+15,y make new top also the current index in
txa memory. get low address again. txa memory. get low address again.
sta fcbbuf+14,y sta FCBs+14,y
inc zpt+1 make previous the 1st entry in sub index inc zpt+1 make previous the 1st entry in sub index
pla pla
sta (zpt) sta (zpt)
@ -627,10 +627,10 @@ swapdown jsr alcwblk make current seed into a sapling, allocate a block befo
jsr gfcbstyp now adjust storage type by adding 1 jsr gfcbstyp now adjust storage type by adding 1
adc #$01 (seed becomes sapling becomes tree) adc #$01 (seed becomes sapling becomes tree)
sta fcbbuf+7,y sta FCBs+7,y
lda fcbbuf+8,y mark storage type modified lda FCBs+8,y mark storage type modified
ora #$08 ora #$08
sta fcbbuf+8,y sta FCBs+8,y
clc no error clc no error
L45F6 rts L45F6 rts
@ -641,14 +641,14 @@ alcwblk jsr alc1blk
jsr gfcbstat mark usage as modified jsr gfcbstat mark usage as modified
ora #$10 ora #$10
sta fcbbuf+8,y sta FCBs+8,y
lda fcbbuf+24,y inc current usage count by 1 lda FCBs+24,y inc current usage count by 1
clc clc
adc #$01 adc #$01
sta fcbbuf+24,y sta FCBs+24,y
lda fcbbuf+25,y lda FCBs+25,y
adc #$00 adc #$00
sta fcbbuf+25,y sta FCBs+25,y
L4615 clc no error L4615 clc no error
L4616 rts L4616 rts
@ -657,7 +657,7 @@ tstwprot jsr gfcbstat check for 'never been modified' condition
and #$F0 and #$F0
bne L4615 ordinary rts if known write ok. bne L4615 ordinary rts if known write ok.
lda fcbbuf+1,y get file's dev #. lda FCBs+1,y get file's dev #.
sta devnum get current status of block device. sta devnum get current status of block device.
twrprot1 sta unitnum make the device status call twrprot1 sta unitnum make the device status call

View File

@ -10,11 +10,11 @@ XDOS.Close ldy #$01 close all ?
L4654 sta fcbptr save current low byte of pointer. L4654 sta fcbptr save current low byte of pointer.
tay get the level at which the file tay get the level at which the file
lda fcbbuf+27,y was opened. lda FCBs+27,y was opened.
cmp flevel if file's level is < global level cmp flevel if file's level is < global level
bcc L4675 then don't close. bcc L4675 then don't close.
lda fcbbuf,y is this reference file open ? lda FCBs,y is this reference file open ?
beq L4675 no, try next. beq L4675 no, try next.
jsr flush2 clean it out... jsr flush2 clean it out...
@ -40,14 +40,14 @@ L4683 jsr flush1 flush file 1st (including updating
bcs L46B6 bitmap). branch if errors. bcs L46B6 bitmap). branch if errors.
close2 ldy fcbptr close2 ldy fcbptr
lda fcbbuf+11,y release file buffer lda FCBs+11,y release file buffer
jsr relbuffr jsr relbuffr
bcs L46B6 bcs L46B6
lda #$00 lda #$00
ldy fcbptr ldy fcbptr
sta fcbbuf,y free fcb too sta FCBs,y free fcb too
lda fcbbuf+1,y lda FCBs+1,y
sta devnum go look for associated vcb sta devnum go look for associated vcb
jsr fnddvcb jsr fnddvcb
@ -71,7 +71,7 @@ XDOS.Flush ldy #$01 flush all ?
lda #$00 start at the beginning. lda #$00 start at the beginning.
L46C3 sta fcbptr save current low byte of pointer. L46C3 sta fcbptr save current low byte of pointer.
tay index to ref #. tay index to ref #.
lda fcbbuf,y is this reference file open ? lda FCBs,y is this reference file open ?
beq L46D1 no, try next. beq L46D1 no, try next.
jsr flush2 clean it out... jsr flush2 clean it out...
@ -97,11 +97,11 @@ flush1 stz cferr for normal refnum flush, clear global error.
jsr findfcb setup pointer to fcb user references. jsr findfcb setup pointer to fcb user references.
bcs L46E6 return any errors. bcs L46E6 return any errors.
L46F1 lda fcbbuf+9,y test to see if file is modified. L46F1 lda FCBs+9,y test to see if file is modified.
and #$02 is it write enabled ? and #$02 is it write enabled ?
beq L46D9 branch if 'read only' beq L46D9 branch if 'read only'
lda fcbbuf+28,y has eof been modified ? lda FCBs+28,y has eof been modified ?
bmi L4704 if yes. bmi L4704 if yes.
jsr gfcbstat has data been modified ? jsr gfcbstat has data been modified ?
@ -126,7 +126,7 @@ L471C lda #$06 prepare to update directory
tax tax
ora fcbptr ora fcbptr
tay tay
L4723 lda fcbbuf,y note: this code depends on the defined L4723 lda FCBs,y note: this code depends on the defined
sta d_dev-1,x order of the file control block and the sta d_dev-1,x order of the file control block and the
dey temporary directory area in 'work space' dey temporary directory area in 'work space'
dex dex
@ -155,24 +155,24 @@ L4755 jsr entcalc buffer. set up pointer to entry.
jsr moventry move entry to temp entry buffer in jsr moventry move entry to temp entry buffer in
ldy fcbptr 'work space'. update 'blocks used' count ldy fcbptr 'work space'. update 'blocks used' count
lda fcbbuf+24,y lda FCBs+24,y
sta d_usage sta d_usage
lda fcbbuf+25,y lda FCBs+25,y
sta d_usage+1 sta d_usage+1
ldx #$00 and move in end of file mark whether ldx #$00 and move in end of file mark whether
L476C lda fcbbuf+21,y needed or not. L476C lda FCBs+21,y needed or not.
sta d_eof,x sta d_eof,x
inx inx
cpx #$03 move all 3 bytes cpx #$03 move all 3 bytes
beq L4780 beq L4780
lda fcbbuf+12,y also move in the address of the file's lda FCBs+12,y also move in the address of the file's
sta d_filid,x first block since it might have changed sta d_filid,x first block since it might have changed
iny since the file first opened. iny since the file first opened.
bne L476C branch always. bne L476C branch always.
L4780 lda fcbbuf+5,y the last thing to update is storage L4780 lda FCBs+5,y the last thing to update is storage
asl type (y=fcbptr+2). shift into high asl type (y=fcbptr+2). shift into high
asl nibble. asl nibble.
asl asl
@ -186,9 +186,9 @@ L4780 lda fcbbuf+5,y the last thing to update is storage
bcs glberr error. bcs glberr error.
ldy fcbptr mark ldy fcbptr mark
lda fcbbuf+28,y fcb/directory lda FCBs+28,y fcb/directory
and #$7F as and #$7F as
sta fcbbuf+28,y undirty. sta FCBs+28,y undirty.
lda d_dev see if bitmap should be written. lda d_dev see if bitmap should be written.
cmp bmadev is it in same as current file ? cmp bmadev is it in same as current file ?
bne L47B2 yes, put it on the disk if necessary. bne L47B2 yes, put it on the disk if necessary.
@ -216,7 +216,7 @@ L47C1 pla
rts rts
gfcbstat ldy fcbptr index to fcb. gfcbstat ldy fcbptr index to fcb.
lda fcbbuf+8,y return status byte. lda FCBs+8,y return status byte.
rts rts
L47CA lda #MLI.E.LOCKED access error L47CA lda #MLI.E.LOCKED access error
@ -232,7 +232,7 @@ XDOS.SetEOF jsr gfcbstyp can only move end of tree, sapling or seed.
asl asl
asl asl
sta stortyp may be used later. sta stortyp may be used later.
lda fcbbuf+9,y lda FCBs+9,y
and #$02 is write enabled to set new eof ? and #$02 is write enabled to set new eof ?
beq L47CA no, access error. beq L47CA no, access error.
@ -244,7 +244,7 @@ XDOS.SetEOF jsr gfcbstyp can only move end of tree, sapling or seed.
iny upon contraction. iny upon contraction.
ldx #$02 all 3 bytes of the eof ldx #$02 all 3 bytes of the eof
L47EF lda fcbbuf+21,y L47EF lda FCBs+21,y
sta oldeof,x sta oldeof,x
dey dey
dex dex
@ -275,7 +275,7 @@ eofset ldy #$04
inx inx
L481C lda (A3L),y L481C lda (A3L),y
sta fcbbuf+21,x sta FCBs+21,x
dex dex
dey dey
cpy #$02 all 3 bytes moved ? cpy #$02 all 3 bytes moved ?
@ -297,7 +297,7 @@ purge jsr flush1 make sure file is current
iny iny
ldx #$02 ldx #$02
L4840 lda fcbbuf+18,y L4840 lda FCBs+18,y
cmp tposll,x compare until not equal or carry clear. cmp tposll,x compare until not equal or carry clear.
bcc L485F branch if eof > mark. bcc L485F branch if eof > mark.
@ -311,7 +311,7 @@ L484E ldy fcbptr
ldx #$00 ldx #$00
L4853 lda tposll,x fake position, correct position will L4853 lda tposll,x fake position, correct position will
sta fcbbuf+18,y be made below... sta FCBs+18,y be made below...
iny iny
inx inx
cpx #$03 move all 3 bytes cpx #$03 move all 3 bytes
@ -348,9 +348,9 @@ L485F jsr tkfrecnt force free block count before releasing
L489F sta dseed+1 L489F sta dseed+1
L48A2 ldy fcbptr also must pass file's 1st block address. L48A2 ldy fcbptr also must pass file's 1st block address.
lda fcbbuf+12,y lda FCBs+12,y
sta firstbl sta firstbl
lda fcbbuf+13,y lda FCBs+13,y
sta firstbh sta firstbh
stz deblock lastly, initialize # of blocks to stz deblock lastly, initialize # of blocks to
stz deblock+1 be free'd. stz deblock+1 be free'd.
@ -362,10 +362,10 @@ L48A2 ldy fcbptr also must pass file's 1st block address.
ldx #$00 ldx #$00
L48C2 lda firstbl,x L48C2 lda firstbl,x
sta fcbbuf+12,y move in possible new first file block sta FCBs+12,y move in possible new first file block
lda fcbbuf+24,y address. adjust usage count also lda FCBs+24,y address. adjust usage count also
sbc deblock,x sbc deblock,x
sta fcbbuf+24,y sta FCBs+24,y
iny iny
inx inx
txa txa
@ -378,7 +378,7 @@ L48C2 lda firstbl,x
lsr lsr
lsr lsr
ldy fcbptr and save it in fcb. ldy fcbptr and save it in fcb.
sta fcbbuf+7,y sta FCBs+7,y
jsr clrstats make it look as though position has jsr clrstats make it look as though position has
jsr dvcbrev nothing allocated, update total blocks jsr dvcbrev nothing allocated, update total blocks
ldy fcbptr in fcb and correct position. ldy fcbptr in fcb and correct position.
@ -386,10 +386,10 @@ L48C2 lda firstbl,x
iny iny
ldx #$02 ldx #$02
L48F2 lda fcbbuf+18,y tell 'rdposn' to go to correct L48F2 lda FCBs+18,y tell 'rdposn' to go to correct
sta tposll,x sta tposll,x
eor #$80 position from incorrect place. eor #$80 position from incorrect place.
sta fcbbuf+18,y sta FCBs+18,y
dey dey
dex dex
bpl L48F2 bpl L48F2
@ -427,7 +427,7 @@ XDOS.GetEOF ldx fcbptr index to end of file mark
ldy #$02 and index to user's call parameters ldy #$02 and index to user's call parameters
L4924 lda fcbbuf+21,x L4924 lda FCBs+21,x
sta (A3L),y sta (A3L),y
inx inx
iny iny
@ -441,49 +441,49 @@ XDOS.NewLine ldy #$02 adjust newline status for open file.
lda (A3L),y on or off ? lda (A3L),y on or off ?
ldx fcbptr it will be 0 if off. ldx fcbptr it will be 0 if off.
sta fcbbuf+31,x set new line mask sta FCBs+31,x set new line mask
iny iny
lda (A3L),y and move in 'new-line' byte lda (A3L),y and move in 'new-line' byte
sta fcbbuf+10,x sta FCBs+10,x
clc no error possible clc no error possible
rts rts
*-------------------------------------- *--------------------------------------
XDOS.GetFileInfoEx XDOS.GetFileInfoEx
jsr findfile see if file exists jsr findfile see if file exists
bcs .9 bcc .1
ldy #3 cmp #MLI.E.INVPATH
lda (A3L),y sec
sta zpt bne .9
iny
lda (A3L),y .1 ldx #S.FIEX.BLKPTR+2-1
sta zpt+1 ldy #S.FIEX.BLKPTR+2-1+3
* ldy #S.FIEX.BLKPTR+2-1 .2 lda d_stor,x
sta (A3L),y
*.1 lda d_filid,y dey
* sta (zpt),y dex
* dey bpl .2
* bpl .1
ldx #7
* ldx #7 ldy #S.FIEX.ACL+7+3
* ldy #S.FIEX.ACL+7
.3 lda h_acl,x
*.2 lda h_acl,x sta (A3L),y
* sta (zpt),y dey
* dex dex
* dey bpl .3
* bpl .2
* clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
XDOS.GetFileInfo XDOS.GetFileInfo
jsr findfile look for file. jsr findfile look for file.
bcc L4988 no error. bcc L4988 no error.
cmp #$40 was it a root directory file ? cmp #MLI.E.INVPATH was it a root directory file ?
sec (in case of no match) sec (in case of no match)
bne L49A4 if not, then error. bne L49A4 if not, then error.
@ -535,9 +535,30 @@ L4994 lda inftabl-3,y
L49A4 rts L49A4 rts
*-------------------------------------- *--------------------------------------
XDOS.SetFileInfoEx XDOS.SetFileInfoEx
jsr findfile
clc bcs .9
rts
ldx #S.FIEX.BLKPTR+2-1
ldy #S.FIEX.BLKPTR+2-1+3
.2 lda (A3L),y
sta d_stor,x
dey
dex
bpl .2
ldx #7
ldy #S.FIEX.ACL+7+3
.3 lda (A3L),y
sta h_acl,x
dey
dex
bpl .3
jmp drevise1
.9 rts
*-------------------------------------- *--------------------------------------
XDOS.SetFileInfo XDOS.SetFileInfo
jsr findfile get the file to work on. jsr findfile get the file to work on.

View File

@ -144,9 +144,9 @@ fcbused pha mark fcb as dirty so the directory will be flushed on 'flush
tya save regs. tya save regs.
pha pha
ldy fcbptr ldy fcbptr
lda fcbbuf+28,y fetch current fcb dirty byte. lda FCBs+28,y fetch current fcb dirty byte.
ora #$80 mark fcb as dirty. ora #$80 mark fcb as dirty.
sta fcbbuf+28,y save it back sta FCBs+28,y save it back
pla and restore regs. pla and restore regs.
tay tay
pla pla
@ -477,9 +477,9 @@ L4DFE dex set proper bits to 1
bne L4DFE bne L4DFE
ldy fcbptr calculate buffer number ldy fcbptr calculate buffer number
lda fcbbuf,y lda FCBs,y
asl buffer number = (entnum) * 2. asl buffer number = (entnum) * 2.
sta fcbbuf+11,y save it in fcb. sta FCBs+11,y save it in fcb.
tax use entnum * 2 as index to global tax use entnum * 2 as index to global
lda datptr+1 buffer addr tables. get addr already lda datptr+1 buffer addr tables. get addr already
sta buftbl-1,x validated as good. store hi addr sta buftbl-1,x validated as good. store hi addr
@ -828,13 +828,13 @@ XDOS.ParamCnt .HS 020202FF parameter counts for the calls
.HS 070102070A0201010303040401010202 .HS 070102070A0201010303040401010202
.HS FF .HS FF
.HS 020202 .HS 020202
* corresponding command function bytes XDOS.CmdFlags .HS A0A1A2
.HS A384
XDOS.CmdFlags .HS A0A1A2A3 .HS 050607
.HS 84050607
.HS 88494A4B .HS 88494A4B
.HS 2C2D4E4F .HS 2C2D
.HS 4E4F
.HS 50515253 .HS 50515253
.HS 9495 .HS 9495
@ -885,13 +885,11 @@ deathmsg .AS "SYS ERR-$0"
deathmsg.LEN .EQ *-deathmsg deathmsg.LEN .EQ *-deathmsg
*-------------------------------------- *--------------------------------------
XDOS.DATA .DUMMY XDOS.DATA .DUMMY
*--------------------------------------
* 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 .HS 0000 own_blk .HS 0000
own_ent .HS 00 own_ent .HS 00
own_len .HS 00 own_len .HS 00
*--------------------------------------
.DO ACL=1 .DO ACL=1
h_acl .BS 8 h_acl .BS 8
.FIN .FIN
@ -903,7 +901,6 @@ h_attr .HS 00 attributes (protect bit, etc.)
h_entln .HS 00 length of each entry in this directory h_entln .HS 00 length of each entry in this directory
h_maxent .HS 00 maximum number of entries per block h_maxent .HS 00 maximum number of entries per block
h_fcnt .HS 0000 current # of files in this directory h_fcnt .HS 0000 current # of files in this directory
h_bmap .HS 0000 address of first allocation bitmap h_bmap .HS 0000 address of first allocation bitmap
h_tblk .HS 0000 total number of blocks on this unit h_tblk .HS 0000 total number of blocks on this unit
*-------------------------------------- *--------------------------------------
@ -911,9 +908,8 @@ d_dev .HS 00 device number of this directory entry
d_head .HS 0000 address of <sub> directory header d_head .HS 0000 address of <sub> directory header
d_entblk .HS 0000 address of block which contains entry d_entblk .HS 0000 address of block which contains entry
d_entnum .HS 00 entry number within block d_entnum .HS 00 entry number within block
*--------------------------------------
d_stor .BS 16 file name d_stor .BS 16 file name
d_filid .HS 00 user's identification byte d_filid .HS 00 user's identification byte
d_frst .HS 0000 first block of file d_frst .HS 0000 first block of file
d_usage .HS 0000 # of blocks allocated to this file d_usage .HS 0000 # of blocks allocated to this file

View File

@ -40,7 +40,12 @@ L59A6 lda XRW.LastUnitUsed
lda montimeh lda montimeh
bne L59A6 bne L59A6
L59BD jsr XRW.AllPhaseOff make sure all motor phases are off. L59BD ldx A2L
bit IO.D2.Ph0Off,x make sure all motor phases are off
bit IO.D2.Ph3Off,x
bit IO.D2.Ph2Off,x
bit IO.D2.Ph1Off,x
lda IO.D2.ReadMode,x turn off write enable X = slot $S0 lda IO.D2.ReadMode,x turn off write enable X = slot $S0
nop nop
@ -142,6 +147,7 @@ L537C plp was motor on ?
* motor was off, wait for it to speed up * motor was off, wait for it to speed up
L537F jsr XRW.Wait100ms wait 100us for each count in montime L537F jsr XRW.Wait100ms wait 100us for each count in montime
lda montimeh lda montimeh
bmi L537F count up to 0000 bmi L537F count up to 0000
@ -745,73 +751,77 @@ XRW.Seek ldx XRW.UnitIndex
ldy #0 ldy #0
.1 lda XRW.CurrentQTrack .1 ldx XRW.CurrentQTrack
cmp XRW.TargetQTrack
beq .3 tya
beq .2
txa
jsr XRW.PhaseOff
bcs .2 .2 cpx XRW.TargetQTrack
beq .8
inc CC, CurrentQTrack>TargetQTrack, must move in bcs .3
inx CC, CurrentQTrack>TargetQTrack, must move in
.HS B0 BCS .HS B0 BCS
.2 dec CS, CurrentQTrack<TargetQTrack, must move out .3 dex CS, CurrentQTrack<TargetQTrack, must move out
sta XRW.CurrentQTrack stx XRW.CurrentQTrack
pha txa
jsr XRW.PhaseOn jsr XRW.PhaseOn
lda #85 8.5 ms lda #104
jsr XRW.Wait100msA Trash X
pla
jsr XRW.PhaseOff
lda #1 0.1 ms
jsr XRW.Wait100msA Trash X jsr XRW.Wait100msA Trash X
iny iny
bra .1 bra .1
.3 tya .8 tya
beq XRW.AllPhaseOff.8 beq XRW.PhaseOff.RTS
lda #0 wait 25.5 ms lda #0 wait 25.6 ms
jmp XRW.Wait100msA Trash X jsr XRW.Wait100msA Trash X
lda XRW.TargetQTrack
*-------------------------------------- *--------------------------------------
XRW.AllPhaseOff ldx A2L XRW.PhaseOff bit #1 1,3,5,7 ?
bit IO.D2.Ph0Off,x beq XRW.PhaseOff.2 only half track
bit IO.D2.Ph3Off,x
bit IO.D2.Ph2Off,x XRW.PhaseOff.1 bit IO.D2.Ph0Off SELF MODIFIED
bit IO.D2.Ph1Off,x XRW.PhaseOff.2 bit IO.D2.Ph0Off SELF MODIFIED
XRW.AllPhaseOff.8
XRW.PhaseOff.RTS
rts rts
*-------------------------------------- *--------------------------------------
XRW.PhaseOn bit #1 1,3,5,7 ? XRW.PhaseOn bit #1 1,3,5,7 ?
beq .7 only half track bne .1 only half track
bcc .1
pha CS : move out
jsr .7 jsr .7
pla bra XRW.PhaseOn.2
inc
bra .7
.1 pha .1 pha
inc
jsr .7 jsr .7
pla pla
inc
jsr .7
bra XRW.PhaseOn.1
.7 and #6 mask for 0,2,4,6 .7 and #6 mask for 0,2,4,6
ora A2L Slot $n0 ora A2L Slot $n0
ora #IO.D2.Ph0On ora #IO.D2.Ph0On
tax tax
bit $C000,x turn on one phase
lda XRW.PhaseOn.2+1
sta XRW.PhaseOn.1+1
stx XRW.PhaseOn.2+1
lda XRW.PhaseOff.2+1 lda XRW.PhaseOff.2+1
sta XRW.PhaseOff.1+1 sta XRW.PhaseOff.1+1
@ -820,11 +830,8 @@ XRW.PhaseOn bit #1 1,3,5,7 ?
stx XRW.PhaseOff.2+1 stx XRW.PhaseOff.2+1
rts rts
*-------------------------------------- *--------------------------------------
XRW.PhaseOff bit #1 1,3,5,7 ? XRW.PhaseOn.1 bit IO.D2.Ph0On SELF MODIFIED
beq XRW.PhaseOff.2 only half track XRW.PhaseOn.2 bit IO.D2.Ph0On SELF MODIFIED
XRW.PhaseOff.1 bit $c000
XRW.PhaseOff.2 bit $c000
rts rts
*-------------------------------------- *--------------------------------------
XRW.Trk2Qtrk asl x2 XRW.Trk2Qtrk asl x2

View File

@ -136,16 +136,31 @@ pathbuf .EQ $D700
XDOS.ClockDrv .EQ $D742 XDOS.ClockDrv .EQ $D742
prefixbuf .EQ $D742+125 prefixbuf .EQ $D742+125
*-------------------------------------- *--------------------------------------
fcbbuf .EQ $D800 fcb buffer FCBs .EQ $D800
FCB.ID .EQ 0
FCB.DEVID .EQ 1
FCB.MARK .EQ 2
FCB.STYPE .EQ 7
FCB.F .EQ 8
FCB.F.STMOD .EQ 8
FCB.NLBYTE .EQ 10
FCB.BUFID .EQ 11
FCB.IBLK .EQ 14
FCB.EOF .EQ 21
FCB.FLEVEL .EQ 27
FCB.NLMASK .EQ 31
FCB .EQ 32
*--------------------------------------
VCBs .EQ $D900 VCBs .EQ $D900
VCB.DEV .EQ 16 VCB.DEV .EQ 16
*VCB.OF .EQ 17 *VCB.OF .EQ 17
VCB.TBLK .EQ 18 VCB.TBLK .EQ 18
VCB.FBLK .EQ 20 VCB.FBLK .EQ 20
VCB.ROOT .EQ 22 VCB.ROOT .EQ 22
VCB.BMAP .EQ 26 VCB.BMAP .EQ 26
VCB.BMAPIDX .EQ 28 VCB.BMAPIDX .EQ 28
VCB.OFCNT .EQ 30 VCB.OFCNT .EQ 30
* *
VCB .EQ 32 VCB .EQ 32
*-------------------------------------- *--------------------------------------

View File

@ -94,7 +94,8 @@ K.S.STAT .EQ $0300 S.STAT for internal kernel operations
Evt.Table .EQ $0340 K.EVT.MAX*S.EVT=4*8=32b Evt.Table .EQ $0340 K.EVT.MAX*S.EVT=4*8=32b
K.S.IOCTL .EQ $0360 9 bytes K.S.IOCTL .EQ $0360 9 bytes
K.MLI.PATH .EQ $0369 64+1 K.MLI.PATH .EQ $0369 64+1
K.MLI.PARAMS .EQ $03AA Main, 18 bytes min for GetFileInfo (ATLK needs MORE!!!...32 max for now) K.MLI.PARAMS .EQ $03AA Main, 18 bytes min for GetFileInfo
* GetFileInfoEx/SetFileInfoEx need 1 + 2 + 48 = 51
*-------------------------------------- *--------------------------------------
K.STACKTOP .EQ $03ED XFer !!! down to $3E0 K.STACKTOP .EQ $03ED XFer !!! down to $3E0
*-------------------------------------- *--------------------------------------

View File

@ -163,6 +163,17 @@ SHARED.GetPDrv ldy #S.FD.DEV.DRVPTR
sta pDRV+1 sta pDRV+1
rts rts
*-------------------------------------- *--------------------------------------
SHARED.ClrStat ldx #S.STAT-1
.1 stz K.S.STAT,x
dex
bpl .1
lda CORE.FSID
sta K.S.STAT+S.STAT.FSID
rts
*--------------------------------------
DEV.FIFO .AS "/dev/fifo" STAT,UNISTD DEV.FIFO .AS "/dev/fifo" STAT,UNISTD
*-------------------------------------- *--------------------------------------
MAN MAN

View File

@ -323,7 +323,18 @@ STAT.PullPathAndMode
>PULLW ZPPtr1 pathname >PULLW ZPPtr1 pathname
rts rts
*-------------------------------------- *--------------------------------------
SHARED.Stat.I >MLICALL MLIGETFILEINFO SHARED.Stat.I bit CORE.FSID
bpl .1
>MLICALL MLIGETFILEINFOEX
bcs K.Pipe.RTS
>LDYAI K.MLI.PARAMS+3
>STYA ZPPtr3
bra SHARED.DirEnt2Stat
.1 >MLICALL MLIGETFILEINFO
bcs K.Pipe.RTS bcs K.Pipe.RTS
SHARED.GFI2Stat jsr SHARED.ClrStat SHARED.GFI2Stat jsr SHARED.ClrStat
@ -381,17 +392,6 @@ SHARED.DirEnt2Stat
ldx #K.S.STAT+S.STAT.MTIME ldx #K.S.STAT+S.STAT.MTIME
jmp SHARED.PTime2StatAX jmp SHARED.PTime2StatAX
*-------------------------------------- *--------------------------------------
SHARED.ClrStat ldx #S.STAT-1
.1 stz K.S.STAT,x
dex
bpl .1
lda CORE.FSID
sta K.S.STAT+S.STAT.FSID
rts
*--------------------------------------
SHARED.Mode2Access SHARED.Mode2Access
clc clc
rts rts
@ -457,6 +457,6 @@ SHARED.Stat.Dst .DA #S.STAT.P.TYPE,#S.STAT.P.AUXTYPE,#S.STAT.P.AUXTYPE+1
.DA #S.STAT.SIZE,#S.STAT.SIZE+1,#S.STAT.SIZE+2 .DA #S.STAT.SIZE,#S.STAT.SIZE+1,#S.STAT.SIZE+2
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/SYS/KERNEL.S.STAT SAVE usr/src/sys/kernel.s.stat
LOAD USR/SRC/SYS/KERNEL.S LOAD usr/src/sys/kernel.s
ASM ASM