You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
498 B

2 years ago
.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