2024-06-06 06:58:09 +00:00
|
|
|
.text
|
|
|
|
.global _start
|
|
|
|
.type _start, @function
|
|
|
|
|
|
|
|
_start:
|
|
|
|
# Initialize global pointer
|
|
|
|
.option push
|
|
|
|
.option norelax
|
|
|
|
la gp, __global_pointer$
|
|
|
|
.option pop
|
|
|
|
|
2024-06-06 07:02:16 +00:00
|
|
|
<<<<<<< HEAD
|
2024-06-06 06:58:09 +00:00
|
|
|
li sp, 0x800ffff0
|
|
|
|
|
2024-06-06 07:02:16 +00:00
|
|
|
=======
|
2024-05-23 10:49:57 +00:00
|
|
|
li sp, 0x80020000
|
2024-06-06 07:02:16 +00:00
|
|
|
>>>>>>> origin/fabian
|
2024-06-06 06:58:09 +00:00
|
|
|
# Clear the bss segment
|
|
|
|
la a0, __bss_start
|
|
|
|
la a1, __BSS_END__
|
|
|
|
|
2024-06-06 07:02:16 +00:00
|
|
|
<<<<<<< HEAD
|
|
|
|
=======
|
2024-05-23 10:49:57 +00:00
|
|
|
j finish_bss
|
2024-06-06 07:02:16 +00:00
|
|
|
>>>>>>> origin/fabian
|
2024-06-06 06:58:09 +00:00
|
|
|
clear_bss:
|
|
|
|
bgeu a0, a1, finish_bss
|
|
|
|
sb x0, 0(a0)
|
|
|
|
addi a0, a0, 1
|
|
|
|
beq x0, x0, clear_bss
|
|
|
|
finish_bss:
|
|
|
|
|
|
|
|
nop //!
|
|
|
|
|
|
|
|
call main
|
|
|
|
|
|
|
|
nop //!
|
|
|
|
|
|
|
|
# abort execution here
|
|
|
|
ebreak
|
|
|
|
|
|
|
|
.section .rodata
|
|
|
|
alfabet:
|
|
|
|
.string "abcdefghijklmnopqrstuwxyz"
|
|
|
|
slowo:
|
|
|
|
|
|
|
|
.section .data
|
|
|
|
wynik:
|
|
|
|
.string "mpabi"
|
|
|
|
.space 26 # rezerwuje 26 bajtów dla wyniku, zainicjowane na 0
|