A2osX/SYS/KERNEL.S.ENV.txt

81 lines
1.8 KiB
Plaintext
Raw Normal View History

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