mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-26 13:49:18 +00:00
115 lines
2.0 KiB
Plaintext
115 lines
2.0 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*/--------------------------------------
|
||
* # GetPWUID
|
||
* ## C
|
||
* `int getpwuid(short int uid, S.PW* passwd );`
|
||
* ## ASM
|
||
* `>PUSHW passwd`
|
||
* `lda uid`
|
||
* `>SYSCALL getpwuid`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.GetPWUID
|
||
*/--------------------------------------
|
||
* # GetPWName
|
||
* ## C
|
||
* `int getpwname(const char* name, S.PW* passwd );`
|
||
* ## ASM
|
||
* `>PUSHW passwd`
|
||
* `>LDYA name`
|
||
* `>SYSCALL getpwname`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.GetPWName jsr MEM.SPtr1PPtr2
|
||
|
||
bra K.PutPW.1
|
||
*/--------------------------------------
|
||
* # PutPW
|
||
* ## C
|
||
* `int putpw( S.PW* passwd );`
|
||
* ## ASM
|
||
* `>LDYA passwd`
|
||
* `>SYSCALL putpw`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.PutPW >STYA ZPPtr2
|
||
|
||
K.PutPW.1 sta SETREADAUX
|
||
sta SETWRITEAUX
|
||
|
||
jsr X.PWD
|
||
|
||
sta CLRREADAUX
|
||
sta CLRWRITEAUX
|
||
bcs .9
|
||
|
||
lda PWD.bDirty
|
||
beq .9
|
||
|
||
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
|
||
jsr K.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.BANK
|
||
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.BANK
|
||
bcc .2
|
||
|
||
pha
|
||
jsr .7
|
||
pla
|
||
sec
|
||
rts
|
||
|
||
.2 stz PWD.bDirty
|
||
|
||
.7 lda #$ff SELF MODIFIED
|
||
ldx #SYS.fclose
|
||
jsr K.SYSCALL2.BANK
|
||
|
||
.8 lda #$ff
|
||
jmp K.freemem SELF MODIFIED
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE USR/SRC/SYS/KERNEL.S.PWD
|
||
LOAD USR/SRC/SYS/KERNEL.S
|
||
ASM
|