| vi:filetype=gas68k: .text .extern main .global start .global halt_cpu start: jsr disable_intr | write SEGA to 0xa14000 to convience the TMSS to run us move.l 0x100, %d0 move.l %d0, 0xa14000 | copy .data section from ROM to RAM move.l #_data_lma, %a0 move.l #_data_start, %a1 move.l #_data_end, %a2 cmp.l %a1, %a2 beq.s 1f | skip data copy if the section is empty 0: move.l (%a0)+, (%a1)+ cmp.l %a1, %a2 bne.s 0b 1: | zero the .bss section move.l #_bss_start, %a0 move.l #_bss_end, %a1 cmp.l %a0, %a1 beq.s 1f | skip bss zeroing if the section is empty 0: clr.l (%a0)+ cmp.l %a0, %a1 bne.s 0b 1: | setup the stack pointer stack move.l #_stacktop, %sp | now that we have a stack, we can enable interrupts jsr enable_intr jsr main halt_cpu: stop #0x2700