Skip to content

Commit

Permalink
Merge pull request #37 from asmblur/fixed-crt0
Browse files Browse the repository at this point in the history
Fixed crt0.s .bss clearing loop. It would write a qword even if .bss …
  • Loading branch information
uyjulian authored Jul 17, 2023
2 parents 82bbedf + 0df0ab4 commit ec87a9a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions stub/crt0.s
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ zerobss:
la $2, _fbss
la $3, _end
loop:
sltu $1,$2,$3
beq $1,$0,zbss_done
nop
nop
nop
sq $0,($2)
sltu $1,$2,$3
bne $1,$0,loop
sq $0,($2)
bgez $0, loop
addiu $2,$2,16

zbss_done:

# Some program loaders (such as Pukklink) execute programs as a thread, but
# support passing argc and argv values via a0. This also indicates that when
# the program terminates, control should be returned to the program loader
Expand Down

0 comments on commit ec87a9a

Please sign in to comment.