mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-29 17:50:18 +00:00
73 lines
1.2 KiB
Plaintext
73 lines
1.2 KiB
Plaintext
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
|
||
PWD.FILE .AZ "${ROOT}ETC/PASSWD"
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE USR/SRC/SYS/KERNEL.S.PWD
|
||
LOAD USR/SRC/SYS/KERNEL.S
|
||
ASM
|