1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 04:30:10 +00:00
cc65/libsrc/common/_environ.s
Oliver Schmidt 1d1ba3ed3b Adjusted constructors.
The constructors are _NOT_ allowed anymore to access the BSS. Rather they must use the DATA segment or the INIT segment. The latter isn't cleared at any point so the constructors may use it to expose values to the main program. However they must make sure to always write the values as they are not pre-initialized.
2016-03-16 16:28:32 +01:00

29 lines
614 B
ArmAsm

;
; Ullrich von Bassewitz, 2005-04-21
;
; extern char** _environ;
;
;
; __environ is a pointer to the environment.
; __envcount is the number of entries in the environment.
; __envsize is the size of the allocated array.
;
; The maximum number of environment entries is 64. putenv() will set errno
; to ENOMEM when trying to increase the number beyond this limit.
;
.export __environ, __envcount, __envsize
.import initenv
.constructor env_init
env_init := initenv
.data
__environ:
.addr 0
__envcount:
.byte 0
__envsize:
.byte 0