mirror of
https://github.com/A2osX/A2osX.git
synced 2024-09-10 22:54:59 +00:00
80 lines
1.6 KiB
Plaintext
80 lines
1.6 KiB
Plaintext
|
PR#3
|
|||
|
PREFIX /A2OSX.BUILD
|
|||
|
LOMEM $A00
|
|||
|
INC 1
|
|||
|
AUTO 6
|
|||
|
*/--------------------------------------
|
|||
|
* # Stat
|
|||
|
* Return information about a file
|
|||
|
* ## In :
|
|||
|
* PUSHW = PTR to S.STAT buffer
|
|||
|
* PUSHW = PTR to Filename (PSTR)
|
|||
|
* ## Out :
|
|||
|
*\--------------------------------------
|
|||
|
K.Stat jsr PFT.CheckPathSTK
|
|||
|
jsr STDIO.PullMLIPath
|
|||
|
>PULLW ZPPtr2
|
|||
|
>MLICALL MLIGETFILEINFO
|
|||
|
bcs .9
|
|||
|
|
|||
|
ldx K.MLI.PARAMS+S.FILEINFO.ACCESS
|
|||
|
|
|||
|
lda #S.STAT.MODE.XO+S.STAT.MODE.WO+S.STAT.MODE.RO
|
|||
|
cpx #S.FILEINFO.ACCESS.FULL
|
|||
|
beq .2
|
|||
|
|
|||
|
lda #S.STAT.MODE.XO+S.STAT.MODE.RO
|
|||
|
cpx #S.FILEINFO.ACCESS.R
|
|||
|
beq .2
|
|||
|
|
|||
|
lda #0
|
|||
|
|
|||
|
.2 ldy #S.STAT.MODE
|
|||
|
sta (ZPPtr2),y
|
|||
|
|
|||
|
ldx #K.Stat.DST-K.Stat.SRC
|
|||
|
|
|||
|
.3 ldy K.Stat.SRC-1,x
|
|||
|
lda K.MLI.PARAMS,y
|
|||
|
ldy K.Stat.DST-1,x
|
|||
|
sta (ZPPtr2),y
|
|||
|
dex
|
|||
|
bne .3
|
|||
|
|
|||
|
ldy #S.STAT.SIZE
|
|||
|
lda #0
|
|||
|
sta (ZPPtr2),y
|
|||
|
|
|||
|
iny
|
|||
|
|
|||
|
lda K.MLI.PARAMS+S.FILEINFO.BLOCKSUSED
|
|||
|
asl
|
|||
|
sta (ZPPtr2),y
|
|||
|
|
|||
|
iny
|
|||
|
|
|||
|
lda K.MLI.PARAMS+S.FILEINFO.BLOCKSUSED+1
|
|||
|
rol
|
|||
|
sta (ZPPtr2),y
|
|||
|
|
|||
|
iny
|
|||
|
|
|||
|
lda #0
|
|||
|
rol
|
|||
|
sta (ZPPtr2),y
|
|||
|
|
|||
|
clc
|
|||
|
.9 rts
|
|||
|
*--------------------------------------
|
|||
|
K.Stat.SRC .DA #S.FILEINFO.TYPE
|
|||
|
.DA #S.FILEINFO.AUXTYPE,#S.FILEINFO.AUXTYPE+1
|
|||
|
.DA #S.FILEINFO.BLOCKSUSED,#S.FILEINFO.BLOCKSUSED+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
|
|||
|
*--------------------------------------
|
|||
|
MAN
|
|||
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.STAT
|
|||
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
|||
|
ASM
|