.include "instr.inc" .text .set org, 0xf753 .global _start _start: # Relocate ld_r1 (stack - main) ld_r2 main ld_r3 (main - 0x2000 + org) call MemCpy jp main main: # Receive a replacement monitor rom ld_r3 0xf000 main_loop: copr_getc strb_r0_r3 inc_r3 cp_r3 0 jp_ne main_loop jp 0xf000 .fill (0xfe00 - org) - (. - _start), 1, 0x00 stack: .byte 0x12, 0x34, 0x56, 0x78 # Replace with stack cookie .fill (0x100 / 2) - 2, 2, org