A2osX/SYS/KERNEL.S.PWD.txt
2019-10-11 15:06:33 +02:00

73 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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