feat: add lab-rv32i-c-smalloc-sbrk-libc card
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
.section .text.startup,"ax",@progbits
|
||||
.global _start
|
||||
.type _start, @function
|
||||
|
||||
_start:
|
||||
.option push
|
||||
.option norelax
|
||||
la gp, __global_pointer$
|
||||
.option pop
|
||||
|
||||
/* One static TLS block is enough for this single-hart lab. */
|
||||
la tp, __tls_start
|
||||
|
||||
la a0, __tbss_start
|
||||
la a1, __tbss_end
|
||||
clear_tbss:
|
||||
bgeu a0, a1, finish_tbss
|
||||
sb zero, 0(a0)
|
||||
addi a0, a0, 1
|
||||
j clear_tbss
|
||||
finish_tbss:
|
||||
|
||||
la a0, __bss_start
|
||||
la a1, __bss_end
|
||||
clear_bss:
|
||||
bgeu a0, a1, finish_bss
|
||||
sb zero, 0(a0)
|
||||
addi a0, a0, 1
|
||||
j clear_bss
|
||||
finish_bss:
|
||||
|
||||
call main
|
||||
tail _exit
|
||||
|
||||
.size _start, .-_start
|
||||
|
||||
Reference in New Issue
Block a user