A2osX/SYS/KERNEL.S.PWD.txt

73 lines
1.2 KiB
Plaintext
Raw Normal View History

2019-10-11 13:06:33 +00:00
NEW
AUTO 3,1
*--------------------------------------
K.FlushEtcPasswd
lda PWD.DBPtr
sta A1L
clc
adc PWD.DBSize
sta A2L
lda PWD.DBPtr+1
sta A1L+1
adc PWD.DBSize+1
sta A2L+1
>LDYA PWD.DBSize
>SYSCALL2 GetMem
bcs .9
stx .8+1
>STYA A4L Save Destination Address in MAIN
clc Aux To Main
jsr AuxMove
>PUSHWZ Aux type
>PUSHBI S.FI.T.TXT
>PUSHBI O.WRONLY+O.CREATE
>LDYAI PWD.FILE
ldx #SYS.FOpen
jsr K.SYSCALL2
bcc .1
pha
jsr .8
pla
sec
.9 rts
.1 sta .7+1
>PUSHW PWD.DBSize
lda .8+1
jsr K.getmemptr
>PUSHYA
lda .7+1
ldx #SYS.FWrite
jsr K.SYSCALL2
bcc .7
pha
jsr .7
pla
sec
rts
.7 lda #$ff SELF MODIFIED
ldx #SYS.fclose
jsr K.SYSCALL2
.8 lda #$ff
jmp K.freemem SELF MODIFIED
*--------------------------------------
PWD.hDB .BS 1
PWD.DBPtr .BS 2
PWD.DBSize .BS 2
2019-12-05 15:09:38 +00:00
PWD.FILE .AZ "${ROOT}etc/passwd"
2019-10-11 13:06:33 +00:00
*--------------------------------------
MAN
SAVE USR/SRC/SYS/KERNEL.S.PWD
LOAD USR/SRC/SYS/KERNEL.S
ASM