Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-12-02 08:09:58 +01:00
parent d77722aaa4
commit f0feab9c03
12 changed files with 241 additions and 194 deletions

View File

@ -116,10 +116,11 @@ CS.RUN.DUMP lda ArgFile
>LDYA L.MSG.Mode
>SYSCALL printf
>PUSHL.G StatBuf+S.STAT.BLOCKS
>PUSHL.G StatBuf+S.STAT.SIZE
>PUSHW.G StatBuf+S.STAT.GID
>PUSHW.G StatBuf+S.STAT.UID
>PUSHBI 8
>PUSHBI 12
>LDYA L.MSG.UIDGIDSIZE
>SYSCALL printf
@ -181,7 +182,7 @@ CS.RUN.PrintAMCTime
>LDA.G StatBuf+S.STAT.ATIME+S.TIME.MONTH
beq .1 Month=0.....invalid date/time
>PUSHW.G StatBuf+S.STAT.ATIME
>PUSHEA.G StatBuf+S.STAT.ATIME
>PUSHW L.FMT.DateTime
>LEA.G TIME.Access
>SYSCALL StrFTime
@ -189,7 +190,7 @@ CS.RUN.PrintAMCTime
.1 >LDA.G StatBuf+S.STAT.MTIME+S.TIME.MONTH
beq .2 Month=0.....invalid date/time
>PUSHW.G StatBuf+S.STAT.MTIME
>PUSHEA.G StatBuf+S.STAT.MTIME
>PUSHW L.FMT.DateTime
>LEA.G TIME.Mod
>SYSCALL StrFTime
@ -197,7 +198,7 @@ CS.RUN.PrintAMCTime
.2 >LDA.G StatBuf+S.STAT.CTIME+S.TIME.MONTH
beq .8 Month=0.....invalid date/time
>PUSHW.G StatBuf+S.STAT.CTIME
>PUSHEA.G StatBuf+S.STAT.CTIME
>PUSHW L.FMT.DateTime
>LEA.G TIME.Create
>SYSCALL StrFTime
@ -254,25 +255,26 @@ OptionList .AS "Cc"
OptionVars .DA #bFormatStr,#bFormatStr
TYPES .AS "-dbclssp"
ACCESS .AS "rwxrwxrwx"
MSG.NODATE .AZ " <No-Date> "
FMT.DateTime .AZ "%d-%b-%y %H:%M"
MSG.NODATE .AZ "<No-Date>"
FMT.DateTime .AZ "%d-%b-%y %H:%M:%S"
*--------------------------------------
MSG.USAGE .AS "Usage : STAT File\r\n"
.AZ " -C : "Format Sting"\r\n"
MSG.Filename .AZ "Filename : %s\r\n"
MSG.Mode .AZ "Access : %s\r\n"
MSG.UIDGIDSIZE .AS "UID : %D\r\n"
.AS "GID : %D\r\n"
.AZ "Filesize : %u\r\n"
MSG.AMCTimes .AS "Access time : %s\r\n"
.AS "Mod time : %s\r\n"
.AZ "Creation time : %s\r\n"
MSG.UIDGIDSIZE .AS "UID : %10D\r\n"
.AS "GID : %10D\r\n"
.AS "Size : %10u\r\n"
.AZ "Blocks : %10u\r\n"
MSG.AMCTimes .AS "Accessed : %s\r\n"
.AS "Modified : %s\r\n"
.AZ "Created : %s\r\n"
*--------------------------------------
.DUMMY
.OR 0
DS.START
StatBuf .BS S.STAT
MOD .BS 11 drwxrwxrwx0
MOD .BS 11 drwxrwxrwx + \0
TIME.Access .BS 20
TIME.Mod .BS 20
TIME.Create .BS 20

View File

@ -7,54 +7,40 @@ ILDR.START jsr MLI check for file 'atinit'
bcc gfi_ok branch if 'atinit' file found
cmp #MLI.E.FNOTFND
beq H23DF if so, continue loading interpreter
bne H23E2
beq ILDR.SYSTEM if so, continue loading interpreter
ATINIT.KO ldx #ATINIT.ERR.LEN-1
.1 lda ATINIT.ERR,x
sta vline16,x
dex
bne .1
beq *
gfi_ok lda gfi_type
cmp #$E2 is 'atinit' correct file type?
bne H23E2 error - wrong file type
bne ATINIT.KO error - wrong file type
jsr MLI open 'atinit' file
.DA #MLIOPEN
.DA atopen
bne H23E2 error
bne ATINIT.KO error
lda #$9F max size = 39.75k ($2000-$BF00)
sta rdlen+1
stz rdlen
jsr MLI read 'atinit' file to 'sysentry'
.DA #MLIREAD
.DA rdparm
bne H23E2 error - too big
bne ATINIT.KO error - too big
jsr MLI close 'atinit' file
.DA #MLICLOSE
.DA clparm
bne H23E2 error
bne ATINIT.KO error
lda RROMBNK2 enable ROM
jsr sysentry execute ATinit
H23DF jmp ILDR.SYSTEM execute .system file
*--------------------------------------
H23E2 ldx ATINIT.ERR
H23E5 lda ATINIT.ERR,x
sta vline16,x
dex
bne H23E5
beq *
ATINIT.ERR .DA #$1A length of message
.AS -"Unable to load ATInit file"
gfi_list .DA #$0A
.DA atinitname
.HS 00
gfi_type .HS 00000000
.HS 0000000000000000
.HS 0000
atopen .HS 03
.DA atinitname
.DA iobuf i/o buffer
.HS 01 ref# hard coded since no other files
atinitname .DA #06 length of name
.AS -"atinit" name of appletalk config file
*--------------------------------------
ILDR.SYSTEM lda /dbuf search directory buffer
sta idxl+1
@ -161,7 +147,7 @@ H24FA lda iomess,y
bpl H24FA
bra *
toolong ldy #$1E
toolong ldy #lgmess.len
H2508 lda lgmess,y
sta vline16+5,y
@ -169,8 +155,24 @@ H2508 lda lgmess,y
bpl H2508
bra *
*--------------------------------------
ATINIT.ERR .AS -"Unable to load ATInit file"
ATINIT.ERR.LEN .EQ *-ATINIT.ERR
gfi_list .DA #$0A
.DA atinitname
.HS 00
gfi_type .HS 00000000
.HS 0000000000000000
.HS 0000
atopen .HS 03
.DA atinitname
.DA iobuf i/o buffer
.HS 01 ref# hard coded since no other files
atinitname .DA #06 length of name
.AS -"atinit" name of appletalk config file
*--------------------------------------
lgmess .AS -"** System program too large **"
lgmess.len .EQ *-lgmess
iomess .AS -"** Unable to load"
.AS -" X.System *********"
ierlen .HS 00

View File

@ -7,8 +7,6 @@ NEW
sta $C010
.EM
*--------------------------------------
READCAT .EQ 0 Boot Block read Catalog at $C00
*--------------------------------------
H2000 jmp prostart
jmp atalkset
jmp p16start
@ -172,12 +170,12 @@ m128k sta idapple Save MACHID in temp location
.1
* stz $D700,x
stz $D800,x
stz $D900,x
stz $DA00,x
stz $DB00,x
stz $DC00,x
stz $DD00,x
stz fcbbuf,x
stz vcbbuf,x
* stz $DA00,x
* stz $DB00,x
* stz $DC00,x
* stz $DD00,x
inx
bne .1

View File

@ -5,6 +5,7 @@ NEW
.OR $2000
.TF PRODOS.FX,TSYS
*--------------------------------------
READCAT .EQ 0 Boot Block read Catalog at $C00
ENHFILENAME .EQ 1
LOWERCASE .EQ 1
FASTSEEK .EQ 0

View File

@ -126,7 +126,8 @@ K.ReadDir.ROOT
bne .4
txa Add ending 0 for C String
jsr K.ReadDir.AddToBuf
jsr K.ReadDir.ClrStat
jsr SHARED.ClrStat
lda (ZPPtr2)
asl DRIVE in Carry
@ -176,6 +177,7 @@ K.ReadDir.DIR sta K.MLI.PARAMS+1 A=#S.DIR.PRODOS.REF
>LDYAI 512 Get a 512 bytes buffer for reading dir...
jsr K.GetMem
bcs .99
stx K.ReadDir.hMem
>STYA K.MLI.PARAMS+2 For reading
pha
@ -188,28 +190,35 @@ K.ReadDir.DIR sta K.MLI.PARAMS+1 A=#S.DIR.PRODOS.REF
adc #0
sta ZPPtr2+1 PTR to Buffer for PASS #1
sta ZPPtr3+1 PTR to Buffer for PASS #2
>LDYAI 512
>STYA K.MLI.PARAMS+4
>MLICALL MLIREAD Read A block from directory
bcs .98
ldy #S.FD.DIR.EL Check if first run....
lda (pFD),y
bne .2 no, we have all we need....
ldy #$1f+3
ldx #3
.1 lda (ZPPtr2),y Get K.ReadDir.EL.... From Block
sta K.ReadDir.EL,x
dey
dex
bpl .1
inc K.ReadDir.EC Add one to EC because we include VOL/DIR Header
bne .4
inc K.ReadDir.EC+1 ...and ProDOS does NOT include header entry in EC
bra .4
.98 jsr K.ReadDir.CLN
sec
.99 rts
.2 ldy #S.FD.DIR.EL+3
ldx #3
@ -218,6 +227,7 @@ K.ReadDir.DIR sta K.MLI.PARAMS+1 A=#S.DIR.PRODOS.REF
dey
dex
bpl .3
.4 lda K.ReadDir.EC
eor #$ff
tax
@ -228,6 +238,7 @@ K.ReadDir.DIR sta K.MLI.PARAMS+1 A=#S.DIR.PRODOS.REF
inx Any entry remaining ?
bne .5
iny
beq .98 no...exit
* pass #1 compute BufSize...
@ -237,13 +248,17 @@ K.ReadDir.DIR sta K.MLI.PARAMS+1 A=#S.DIR.PRODOS.REF
lda #1 For Ending 0
sta K.ReadDir.BufSize
stz K.ReadDir.BufSize+1
K.ReadDir.DIR1 lda (ZPPtr2) X = EntryCount In This Block
beq .7 Free slot....goto next
and #$F0 get storage_type
cmp #$F0 Volume header ?
beq .1
cmp #$E0 directory header ?
beq .2
lda (ZPPtr2) regular DIR or File, get LEN
and #$F compute filename len
sec add "#<filename>" + S.STAT
@ -257,46 +272,59 @@ K.ReadDir.DIR1 lda (ZPPtr2) X = EntryCount In This Block
adc K.ReadDir.BufSize
sta K.ReadDir.BufSize
bcc .3
inc K.ReadDir.BufSize+1
.3 inx
bne .7
iny
bra K.ReadDir.DIR2 we reached last entry in whole DIR
.7 lda ZPPtr2
clc
adc K.ReadDir.EL
sta ZPPtr2
bcc .8
inc ZPPtr2+1
.8 dec K.ReadDir.ECIB
bne K.ReadDir.DIR1
* pass #2 Fill Buffer...(ZPPtr1 & Ptr2 can now be trashed)
K.ReadDir.DIR2 jsr K.ReadDir.GetBuf
bcs .9
lda K.ReadDir.EPB
sta K.ReadDir.ECIB
.1 lda (ZPPtr3)
beq .7 Empty slot, skip
and #$F0
cmp #$F0 Vol Header ?
bne .2
jsr K.ReadDir.ADD.
bra .6
.2 cmp #$E0 Dir Header ?
bne .3
jsr K.ReadDir.ADD.
jsr K.ReadDir.ADD..
bra .6
.3 jsr K.ReadDir.AddFNToBuf
jsr K.ReadDir.ClrStat
jsr SHARED.ClrStat
lda (ZPPtr3)
and #$F0
cmp #$D0 Directory ?
bne .5
jsr K.ReadDir.ADDD
bra .6
.5 jsr K.ReadDir.ADDF
.6 lda K.ReadDir.EC decrease global counter...
@ -308,6 +336,7 @@ K.ReadDir.DIR2 jsr K.ReadDir.GetBuf
sta K.ReadDir.EC+1
ora K.ReadDir.EC
beq .8 0! no more files in DIR
.7 dec K.ReadDir.ECIB 0! no more file in block
beq .8
@ -316,25 +345,26 @@ K.ReadDir.DIR2 jsr K.ReadDir.GetBuf
adc K.ReadDir.EL
sta ZPPtr3
bcc .1
inc ZPPtr3+1
bra .1
.9 jsr K.ReadDir.CLN
sec
rts
.8
* lda #0 S.MEM.F.INIT0 already did this
* sta (ZPPtr4) Ending 0
ldx #3
.8 ldx #3
ldy #S.FD.DIR.EL+3
.81 lda K.ReadDir.EL,x Store back this session prameters to S.DIR
sta (pFD),y
dey
dex
bpl .81
jsr K.ReadDir.CLN Discard READBUFFER
K.ReadDir.EXIT
ldx #$ff Self Modified : hDIRENT
K.ReadDir.EXIT ldx #$ff Self Modified : hDIRENT
txa
jmp K.GetMemPtr
*--------------------------------------
@ -357,12 +387,14 @@ K.ReadDir.ADD. ldx #1 filename="1."
K.ReadDir.ADD..
ldx #2 filename="2.."
lda #'.'
.1 jsr K.ReadDir.AddToBuf Add X dot(s)
dex
bne .1
txa
jsr K.ReadDir.AddToBuf Add Ending 0
jsr K.ReadDir.ClrStat
jsr SHARED.ClrStat
* ldy #$25 total_blocks
* lda (ZPPtr3),y
* sta K.S.STAT+S.STAT.BLOCKS
@ -370,8 +402,7 @@ K.ReadDir.ADD..
* lda (ZPPtr3),y
* sta K.S.STAT+S.STAT.BLOCKS+1
*--------------------------------------
K.ReadDir.ADDD
lda #$0F
K.ReadDir.ADDD lda #$0F
sta K.S.STAT+S.STAT.P.TYPE
lda /S.STAT.MODE.DIR
@ -379,8 +410,8 @@ K.ReadDir.ADDD
bra K.ReadDir.AddAccess
*--------------------------------------
K.ReadDir.ADDF
lda /S.STAT.MODE.REG
sta K.S.STAT+S.STAT.MODE+1
* lda /S.STAT.MODE.REG 0
* sta K.S.STAT+S.STAT.MODE+1
ldx #ADDF.DST-ADDF.SRC
.1 ldy ADDF.SRC-1,x
@ -397,11 +428,7 @@ K.ReadDir.AddAccess
ldy #$1E ProDOS Access
lda (ZPPtr3),y
jsr STAT.Access2Mode
sta K.S.STAT+S.STAT.MODE
tya
ora K.S.STAT+S.STAT.MODE+1 preserve DIR
sta K.S.STAT+S.STAT.MODE+1
jsr SHARED.Stat.Access2Mode
*--------------------------------------
K.ReadDir.AddTime
>PUSHWI K.S.STAT+S.STAT.CTIME
@ -414,17 +441,13 @@ K.ReadDir.AddTime
*--------------------------------------
K.ReadDir.AddStat
ldy #S.STAT-1
.1 lda K.S.STAT,y
sta (ZPPtr4),y
jsr K.ReadDir.AddToBuf
dey
bpl .1
lda ZPPtr4
clc
adc #S.STAT
sta ZPPtr4
bcc .8
inc ZPPtr4+1
.8 rts
rts
*--------------------------------------
ADDF.SRC .HS 1013141516171f20
ADDF.DST .DA #S.STAT.P.TYPE
@ -432,13 +455,6 @@ ADDF.DST .DA #S.STAT.P.TYPE
.DA #S.STAT.SIZE,#S.STAT.SIZE+1,#S.STAT.SIZE+2
.DA #S.STAT.P.AUXTYPE,#S.STAT.P.AUXTYPE+1
*--------------------------------------
K.ReadDir.ClrStat
ldx #S.STAT-1
.1 stz K.S.STAT,x
dex
bpl .1
rts
*--------------------------------------
K.ReadDir.AddFNToBuf
ldy #$1C version/min_version for lowercase bitmap
lda (ZPPtr3),y check bxxxxxxx.xxxxxxxx...

View File

@ -62,7 +62,7 @@ PFT.CheckPathYA stx .6+1 Save SYSCALL #
cpx #K.FLT.MAX
bne .1
.80 >LDYAI K.Buf256
>LDYAI K.Buf256
*--------------------------------------
PFT.YAToMLIPATH >STYA .1+1

View File

@ -152,8 +152,93 @@ SHARED.NextCharPtr2
SHARED.PullYA sta CLRREADAUX
>PULLYA
sta SETREADAUX
SHARED.PullYA.RTS
rts
*--------------------------------------
SHARED.Stat jsr PFT.CheckPathYA
bcs SHARED.PullYA.RTS
SHARED.Stat.I jsr SHARED.ClrStat
>MLICALL MLIGETFILEINFO
bcs SHARED.PullYA.RTS
lda K.MLI.PARAMS+S.FI.A
jsr SHARED.Stat.Access2Mode
ldx #SHARED.Stat.DST-SHARED.Stat.SRC
.3 ldy SHARED.Stat.SRC-1,x
lda K.MLI.PARAMS,y
ldy SHARED.Stat.DST-1,x
sta K.S.STAT,y
dex
bne .3
* >PUSHWI K.S.STAT+S.STAT.CTIME
* >LDYAI K.MLI.PARAMS+S.FI.CDATE
* >SYSCALL2 PTime2Time BANK2
* >PUSHWI K.S.STAT+S.STAT.MTIME
* >LDYAI K.MLI.PARAMS+S.FI.MDATE
* >SYSCALL2 PTime2Time BANK2
clc
rts
*--------------------------------------
SHARED.DirEnt2Stat
clc
rts
*--------------------------------------
SHARED.ClrStat ldx #S.STAT-1
.1 stz K.S.STAT,x
dex
bpl .1
rts
*--------------------------------------
SHARED.Stat.Access2Mode
and #S.FI.A.FULL
cmp #S.FI.A.FULL
beq .7
tay
ldx #S.STAT.MODE.RO+S.STAT.MODE.RG+S.STAT.MODE.RU+S.STAT.MODE.XO+S.STAT.MODE.XG+S.STAT.MODE.XU
bit #S.FI.A.W
beq .1
txa
ora #S.STAT.MODE.WO
tax
tya
.1 asl D in C
bpl .2 RN in N
txa
ora #S.STAT.MODE.WG
tax
.2 txa
bcc .8
ora #S.STAT.MODE.WU
.HS 2C BIT ABS
.7 lda #S.STAT.MODE.FO+S.STAT.MODE.FG+S.STAT.MODE.FU rwxrwxrwx
.8 sta K.S.STAT+S.STAT.MODE
lda /S.STAT.MODE.RU ??????R??
ora K.S.STAT+S.STAT.MODE+1 preserve DIR
sta K.S.STAT+S.STAT.MODE+1
rts
*--------------------------------------
SHARED.Stat.SRC .DA #S.FI.T
.DA #S.FI.AUXTYPE,#S.FI.AUXTYPE+1
.DA #S.FI.UBLKS,#S.FI.UBLKS+1
SHARED.Stat.DST .DA #S.STAT.P.TYPE
.DA #S.STAT.P.AUXTYPE,#S.STAT.P.AUXTYPE+1
.DA #S.STAT.BLOCKS,#S.STAT.BLOCKS+1
*--------------------------------------
MAN
SAVE USR/SRC/SYS/KERNEL.S.SHARED
LOAD USR/SRC/SYS/KERNEL.S

View File

@ -15,7 +15,7 @@ NEW
* only 777-555
*--------------------------------------
K.ChMod jsr PFT.CheckPathYA
bcs K.FStat.9
bcs K.ChMod.RET2
>PULLW K.S.STAT+S.STAT.MODE
lda K.S.STAT+S.STAT.MODE+1
@ -58,7 +58,7 @@ K.ChMod jsr PFT.CheckPathYA
.9 lda #E.SYN
sec
.90 rts
K.FStat.9 >RET 2 discard statbuf
K.ChMod.RET2 >RET 2 discard statbuf
*--------------------------------------
* # FStat
* Return information about a hFILE
@ -72,31 +72,44 @@ K.FStat.9 >RET 2 discard statbuf
* ## RETURN VALUE
*--------------------------------------
K.FStat jsr PFT.CheckNodeA
bcs K.FStat.9
bcs K.ChMod.RET2
tax
lda OF.Table.hPath-1,x
jsr K.GetMemPtr
jsr PFT.YAToMLIPATH
jsr K.Stat.I
bcs K.Stat.9
>PULLW K.Stat.Store.2+1
jsr SHARED.Stat.I
bcs K.Stat.Store.RTS
lda (pFD) #S.FD.T
bne K.Stat.BLK2SIZE
bne K.Stat.Store
ldy #S.FD.REG.REF
lda (pFD),y
sta K.MLI.PARAMS+1
>MLICALL MLIGETEOF
bcs K.Stat.BLK2SIZE
ldy #S.STAT.SIZE+3
lda #0
sta (ZPPtr1),y
bcs K.Stat.Store.RTS
ldx #2
.1 lda K.MLI.PARAMS+2,x
dey
sta (ZPPtr1),y
sta K.S.STAT+S.STAT.SIZE,x
dex
bpl .1
K.Stat.Store ldy #S.STAT-1
K.Stat.Store.1 lda K.S.STAT,y
K.Stat.Store.2 sta $ffff,y SELF MODIFIED
dey
bpl K.Stat.Store.1
* clc
K.Stat.Store.RTS
rts
*/--------------------------------------
* # Stat
@ -111,85 +124,13 @@ K.FStat jsr PFT.CheckNodeA
* ## RETURN VALUE
*\--------------------------------------
K.Stat jsr PFT.CheckPathYA
bcs K.FStat.9 go discard statbuf
jsr K.Stat.I
bcs K.Stat.9
K.Stat.BLK2SIZE ldy #S.STAT.SIZE
lda #0
sta (ZPPtr1),y
iny
lda K.MLI.PARAMS+S.FI.UBLKS
asl
sta (ZPPtr1),y
iny
lda K.MLI.PARAMS+S.FI.UBLKS+1
rol
sta (ZPPtr1),y
iny
lda #0
rol
sta (ZPPtr1),y
* clc
K.Stat.9 rts
bcs K.ChMod.RET2 go discard statbuf
K.Stat.I >PULLW ZPPtr1 Get StatBuf
>MLICALL MLIGETFILEINFO
bcs .9
>PULLW K.Stat.Store.2+1
lda K.MLI.PARAMS+S.FI.A
jsr STAT.Access2Mode
.2 phy
ldy #S.STAT.MODE
sta (ZPPtr1),y
iny
pla
sta (ZPPtr1),y
ldx #K.Stat.DST-K.Stat.SRC
jsr SHARED.Stat.I
bcc K.Stat.Store
.3 ldy K.Stat.SRC-1,x
lda K.MLI.PARAMS,y
ldy K.Stat.DST-1,x
sta (ZPPtr1),y
dex
bne .3
clc
.9 rts
*--------------------------------------
K.Stat.SRC .DA #S.FI.T
.DA #S.FI.AUXTYPE,#S.FI.AUXTYPE+1
.DA #S.FI.UBLKS,#S.FI.UBLKS+1
K.Stat.DST .DA #S.STAT.P.TYPE
.DA #S.STAT.P.AUXTYPE,#S.STAT.P.AUXTYPE+1
.DA #S.STAT.BLOCKS,#S.STAT.BLOCKS+1
*--------------------------------------
STAT.Access2Mode
and #S.FI.A.FULL
cmp #S.FI.A.FULL
beq .7
tay
ldx #S.STAT.MODE.RO+S.STAT.MODE.RG+S.STAT.MODE.RU+S.STAT.MODE.XO+S.STAT.MODE.XG+S.STAT.MODE.XU
bit #S.FI.A.W
beq .1
txa
ora #S.STAT.MODE.WO
tax
tya
.1 asl D in C
bpl .2 RN in N
txa
ora #S.STAT.MODE.WG
tax
.2 txa
bcc .8
ora #S.STAT.MODE.WU
.HS 2C BIT ABS
.7 lda #S.STAT.MODE.FO+S.STAT.MODE.FG+S.STAT.MODE.FU rwxrwxrwx
.8 ldy /S.STAT.MODE.RU ??????R??
STAT.Access2Mode.RTS
rts
*/-------------------------------------
* # MKDir
@ -207,7 +148,7 @@ STAT.Access2Mode.RTS
* A = EC
*\-------------------------------------
K.MKDir jsr PFT.CheckPathYA
bcs STAT.Access2Mode.RTS
bcs K.Stat.Store.RTS
lda #S.FI.T.DIR
sta K.MLI.PARAMS+4
stz K.MLI.PARAMS+5
@ -232,7 +173,7 @@ K.MKFIFO >STYA ZPPtr1 pathname buffer
>PULLW K.S.STAT+S.STAT.MODE
>LDYAI 512
jsr K.pipe
bcs STAT.Access2Mode.RTS
bcs K.Stat.Store.RTS
ldy #0
.1 lda IO.DEV.FIFO,y

View File

@ -32,16 +32,18 @@ K.Time >PUSHYA
* `>SYSCALL PTime2Time`
* ## RETURN VALUE
*\--------------------------------------
K.PTime2Time jsr SHARED.SPtr1PPtr2
K.PTime2Time >STYA ARG32
>PULLW ARG32+2
* jsr SHARED.SPtr1PPtr2
ldy #1
lda (ZPPtr1),y Get Year
lda (ARG32),y Get Year
lsr C is high bit of month
ldy #S.Time.YEAR
sta (ZPPtr2),y set year
sta (ARG32+2),y set year
sta ACC32+3 for computing Century/WDAY later
sta ACC32+3 for conputing Century/WDAY later
lda (ZPPtr1) Get Month/day
lda (ARG32) Get Month/day
pha save Day
ror
@ -50,11 +52,11 @@ K.PTime2Time jsr SHARED.SPtr1PPtr2
lsr
lsr
ldy #S.Time.MONTH
sta (ZPPtr2),y set month
sta (ARG32+2),y set month
pla get back day
and #$1F
iny
sta (ZPPtr2),y set day
sta (ARG32+2),y set day
lda ACC32+3 get back year
cmp #69 if before 70 CC,if > 70, CS
@ -62,22 +64,22 @@ K.PTime2Time jsr SHARED.SPtr1PPtr2
rol get back C in bit 0
eor #1 toggle C
adc #19 set date before 1970 -> 20xx
sta (ZPPtr2) set Century
sta (ARG32+2) set Century
sta ACC32+2 for computing WDAY later
ldy #2
lda (ZPPtr1),y Get Min
lda (ARG32),y Get Min
tax
iny
lda (ZPPtr1),y Get Hour
lda (ARG32),y Get Hour
ldy #S.Time.HOUR
sta (ZPPtr2),y set hour
sta (ARG32+2),y set hour
iny
txa
sta (ZPPtr2),y set min
sta (ARG32+2),y set min
iny
lda #0
sta (ZPPtr2),y set seconds (ProDOS does not provide it)
sta (ARG32+2),y set seconds (ProDOS does not provide it)
*--------------------------------------
* 1/1/1970 was Thursday...if not leap, add one, if leap add 2
*--------------------------------------
@ -116,7 +118,7 @@ K.ComputeWDAY lda #DAY0-1 Thursday : 4 (-1 for mod 7)
bra .1
*--------------------------------------
.4 ldy #S.Time.MONTH
lda (ZPPtr2),y get month
lda (ARG32+2),y get month
tax
dex don't include actual month
@ -145,7 +147,7 @@ K.ComputeWDAY lda #DAY0-1 Thursday : 4 (-1 for mod 7)
.71 pla
ldy #S.Time.DAY
clc
adc (ZPPtr2),y get day in month (1..31)
adc (ARG32+2),y get day in month (1..31)
dec adjust range 0.30 for MOD 7
.8 cmp #7 MOD 7
@ -155,7 +157,7 @@ K.ComputeWDAY lda #DAY0-1 Thursday : 4 (-1 for mod 7)
.80 inc adjust range 1..7
ldy #S.Time.WDAY
sta (ZPPtr2),y
sta (ARG32+2),y
clc
rts
*/--------------------------------------

View File

@ -81,7 +81,6 @@ A2osX.D2 .DA #0
.INB USR/SRC/SYS/KERNEL.S.BIN
.INB USR/SRC/SYS/KERNEL.S.PS
.INB USR/SRC/SYS/KERNEL.S.ARG
.INB USR/SRC/SYS/KERNEL.S.ENV
.EP
A2osX.E0 .DA #0
@ -99,6 +98,7 @@ A2osX.E0 .DA #0
.INB USR/SRC/SYS/KERNEL.S.IO
.INB USR/SRC/SYS/KERNEL.S.PIPE
********* TMP ***** go to A2osX.D2
.INB USR/SRC/SYS/KERNEL.S.ENV
*--------------------------------------
DevMgr.Stat .DA DevMgr.FreeMem
DevMgr.Free .DA DevMgr.FreeMem

View File

View File