rework #4

Merged
Steins7 merged 88 commits from rework into dev 2024-04-20 18:20:23 +00:00
2 changed files with 23 additions and 4 deletions
Showing only changes of commit 086f9155f7 - Show all commits

View File

@ -64,7 +64,10 @@ SECTIONS
.bss : .bss :
{ {
. = ALIGN(4); . = ALIGN(4);
_sbss = .;
*(.bss) *(.bss)
. = ALIGN(4);
_ebss = .;
} > RAM } > RAM
/* memory space allocated to stack. The stack is situated at the very end of /* memory space allocated to stack. The stack is situated at the very end of

View File

@ -34,19 +34,35 @@ hdr_reset:
ldr r1, = _sdata ldr r1, = _sdata
ldr r2, = _edata ldr r2, = _edata
subs r2, r2, r1 subs r2, r2, r1
bcc startup_init_end bcc data_init_end
ldr r3, = _sromdata ldr r3, = _sromdata
movs r0, #0 movs r0, #0
startup_init_loop: data_init_loop:
ldr r4, [r3, r0] ldr r4, [r3, r0]
str r4, [r1, r0] str r4, [r1, r0]
adds r0, r0, #4 adds r0, r0, #4
cmp r0, r2 cmp r0, r2
bcc startup_init_loop bcc data_init_loop
startup_init_end: data_init_end:
//initialize RAM to zero
ldr r1, = _sbss
ldr r2, = _ebss
subs r2, r2, r1
bcc bss_init_end
movs r3, #0
movs r0, #0
bss_init_loop:
str r3, [r1, r0]
adds r0, r0, #4
cmp r0, r2
bcc bss_init_loop
bss_init_end:
b main b main
b hdr_reset b hdr_reset