Especially handy if the bootloader occupies the area where
the udata block will reside.
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
.globl istack_top
.globl istack_switched_sp
- .area .udata
+ .area .udata,bss
_ub: ; first 512 bytes: starts with struct u_block, with the kernel stack working down from above
_udata:
main: orcc #0x10 ; interrupts definitely off
lds #kstack_top
+ clra
+ ldx #__sectionbase_.udata__
+udata_wipe: sta ,x+
+ cmpx #__sectionbase_.udata__+__sectionlen_.udata__
+ blo udata_wipe
ldx #__sectionbase_.bss__
ldy #__sectionlen_.bss__
- clra
bss_wipe: sta ,x+
leay -1,y
bne bss_wipe