portal64-still-alive/asm/entry.s
Matt Penny 42a9189c95 CMake: get assembly working
* Assemble through `gcc` instead of `as` directly, so source files are
  preprocessed (i.e., `#include`)
* `gcc` does not pass `-I` include directories to `as`. This can
  supposedly be fixed by recompiling `gcc` with `--with-gnu-as`. Popular
  N64 toolchain binary distributions don't do this, and to lower the
  barrier to entry I don't want to force users to have to compile their
  own. Work around it by passing `-Wa,-I`.
* CMake only finds assembly dependencies when preprocessing, not when
  assembling. Use `#include` instead of `.include` to work around this.
  The `.incbin`s used by `sound_data.s` are covered by the
  sound_data_tables target dependency.
2024-10-19 16:30:58 -04:00

19 lines
374 B
ArmAsm

#include "../src/defs.h"
#include "macros.inc"
.section .text, "ax"
.glabel entry_point
la $t0, _codeSegmentNoLoadStart
la $t1, _codeSegmentNoLoadSize
.bss_clear:
sw $zero, ($t0)
sw $zero, 4($t0)
addi $t0, $t0, 8
addi $t1, $t1, -8
bnez $t1, .bss_clear
la $sp, mainStack + STACKSIZEBYTES
j boot