A2osX/SYS/KERNEL.S.ENV.txt

81 lines
1.8 KiB
Plaintext
Raw Normal View History

2017-12-22 21:24:30 +00:00
NEW
2019-05-25 19:24:07 +00:00
AUTO 3,1
*/--------------------------------------
* # SetEnv
2018-09-06 15:36:44 +00:00
* Change or add an environment variable
2020-02-14 07:21:56 +00:00
* ## C / CSH
2018-09-06 15:36:44 +00:00
* `int setenv(const char *name, const char *value);`
* ## ASM
2020-01-17 07:31:00 +00:00
* `>PUSHW name`
2018-09-06 15:36:44 +00:00
* `>PUSHW value`
* `>SYSCALL setenv`
2018-10-11 15:23:06 +00:00
* ## RETURN VALUE
*\--------------------------------------
2020-02-06 16:23:59 +00:00
K.SetEnv
* >PULLW FORPNT value
* >PULLW TXTPTR name
2020-02-03 15:17:34 +00:00
2020-02-06 16:23:59 +00:00
* ldy #S.PS.hENV
2020-02-28 07:21:46 +00:00
* lda (pPS),y
2020-02-06 16:23:59 +00:00
* jmp K.SYSCALL.JMPX
*/--------------------------------------
2018-06-21 15:12:10 +00:00
* # GetEnv
2018-09-06 15:36:44 +00:00
* searches the environment list to find the environment variable name,
* and returns a pointer to the corresponding value string.
2020-02-14 07:21:56 +00:00
* ## C / CSH
2020-01-15 07:10:24 +00:00
* `char *getenv(const char *name, char *value);`
2018-09-06 15:36:44 +00:00
* ## ASM
2020-01-15 07:10:24 +00:00
* `>PUSHW name`
* `>PUSHW value`
2018-10-11 15:23:06 +00:00
* `>SYSCALL getenv`
* ## RETURN VALUE
2018-09-06 15:36:44 +00:00
* CC : Y,A = PTR to VALUE (C-String)
2016-08-17 06:25:58 +00:00
* CS : not found
*\--------------------------------------
2020-01-15 09:50:04 +00:00
K.GetEnv >PULLW FORPNT value
2020-02-06 16:23:59 +00:00
*/--------------------------------------
* # PutEnv
* Change or add an environment variable, string is 'NAME=VALUE'
2020-02-14 07:21:56 +00:00
* ## C / CSH
2020-02-06 16:23:59 +00:00
* `int putenv(char *string);`
* ## ASM
* **In:**
* `>PUSHW string`
* `>SYSCALL putenv`
* ## RETURN VALUE
*\--------------------------------------
2020-03-13 16:10:36 +00:00
K.PutEnv
* >PULLW TXTPTR name=value
*/--------------------------------------
2018-06-21 15:12:10 +00:00
* # UnsetEnv
2018-09-06 15:36:44 +00:00
* Remove an environment variable
2020-02-14 07:21:56 +00:00
* ## C / CSH
2018-09-06 15:36:44 +00:00
* `int unsetenv(const char *name);`
* ## ASM
2020-01-17 11:23:11 +00:00
* `>PUSHW name`
2018-09-06 15:36:44 +00:00
* `>SYSCALL unsetenv`
2018-10-11 15:23:06 +00:00
* ## RETURN VALUE
*\--------------------------------------
2020-03-13 16:10:36 +00:00
K.UnsetEnv >PULLW TXTPTR name
2020-01-17 13:25:59 +00:00
2020-03-13 16:10:36 +00:00
K.GetEnv.I ldy #S.PS.hENV FROM STDLIB:EXPAND
2020-02-28 07:21:46 +00:00
lda (pPS),y
2020-03-12 16:44:11 +00:00
pha
ldy #S.PS.hSession
lda (pPS),y
2020-03-13 16:10:36 +00:00
2020-03-12 16:44:11 +00:00
tay
lda S.Table.hSID-1,y
2020-03-13 16:10:36 +00:00
2020-08-12 19:31:36 +00:00
tay Y = hSID
pla A = hENV
2020-02-03 15:17:34 +00:00
2020-02-06 16:23:59 +00:00
jmp K.SYSCALL.JMPX
2016-08-17 06:25:58 +00:00
*--------------------------------------
2015-03-14 21:48:35 +00:00
MAN
2020-12-15 13:23:22 +00:00
SAVE usr/src/sys/kernel.s.env
LOAD usr/src/sys/kernel.s
2015-03-14 21:48:35 +00:00
ASM