Created
January 1, 2023 23:16
-
-
Save buhman/43948b44ac81bbc33ef3a591c9e01b8e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m68k-none-elf-as -g main.s -o main.o | |
m68k-none-elf-ld -T main.lds main.o -o main.elf | |
m68k-none-elf-objcopy -O binary main.elf main.bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") | |
OUTPUT_ARCH(m68k) | |
MEMORY | |
{ | |
rom (arx) : ORIGIN = 0x0000000, LENGTH = 4M | |
} | |
SECTIONS | |
{ | |
.text : | |
{ | |
. = 0x000; | |
KEEP(*(.vectors)) | |
. = 0x100; | |
KEEP(*(.header)) | |
. = 0x200; | |
*(.text) | |
} > rom | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.section .vectors | |
.long 0x0 /* Reset - initial stack pointer */ | |
.long start /* Reset - initial program counter */ | |
.long start /* Bus error */ | |
.long start /* Address error */ | |
.long start /* Illegal instruction */ | |
.long start /* Divide by zero */ | |
.long start /* CHK exception */ | |
.long start /* TRAPV exception */ | |
.long start /* Privilege violation */ | |
.long start /* Trace */ | |
.long start /* Line 1010 emulator */ | |
.long start /* Line 1111 emulator */ | |
.long start /* reserved */ | |
.long start /* co-processor protocol violation */ | |
.long start /* format error */ | |
.long start /* Uninitialized interrupt */ | |
.long start /* reserved */ | |
.long start /* reserved */ | |
.long start /* reserved */ | |
.long start /* reserved */ | |
.long start /* reserved */ | |
.long start /* reserved */ | |
.long start /* reserved */ | |
.long start /* reserved */ | |
.long start /* Spurious interrupt */ | |
.long start /* Level 1 interrupt autovector */ | |
.long start /* Level 2 interrupt autovector */ | |
.long start /* Level 3 interrupt autovector */ | |
.long start /* Level 4 interrupt autovector (vdp horizontal) */ | |
.long start /* Level 5 interrupt autovector */ | |
.long start /* Level 6 interrupt autovector (vdp vertical) */ | |
.long start /* Level 7 interrupt autovector */ | |
.long start /* Trap #0 vector */ | |
.long start /* Trap #1 vector */ | |
.long start /* Trap #2 vector */ | |
.long start /* Trap #3 vector */ | |
.long start /* Trap #4 vector */ | |
.long start /* Trap #5 vector */ | |
.long start /* Trap #6 vector */ | |
.long start /* Trap #7 vector */ | |
.long start /* Trap #8 vector */ | |
.long start /* Trap #9 vector */ | |
.long start /* Trap #10 vector */ | |
.long start /* Trap #11 vector */ | |
.long start /* Trap #12 vector */ | |
.long start /* Trap #13 vector */ | |
.long start /* Trap #14 vector */ | |
.long start /* Trap #15 vector */ | |
.long start /* (fp) branch or set on unordered condition */ | |
.long start /* (fp) inexact result */ | |
.long start /* (fp) divide by zero */ | |
.long start /* (fp) underflow */ | |
.long start /* (fp) operand error */ | |
.long start /* (fp) overflow */ | |
.long start /* (fp) signaling nan */ | |
.long start /* (fp) unimplemented data type */ | |
.long start /* mmu configuration error */ | |
.long start /* mmu illegal operation error */ | |
.long start /* mmu access violation error */ | |
.long start /* reserved (not used) */ | |
.long start /* reserved (not used) */ | |
.long start /* reserved (not used) */ | |
.long start /* reserved (not used) */ | |
.long start /* reserved (not used) */ | |
.section .header | |
.ascii "SEGA GENESIS " | |
.ascii " " /* Release year.month */ | |
.ascii " " /* Japan Title */ | |
.ascii " " /* */ | |
.ascii " " /* */ | |
.ascii " " /* US Title */ | |
.ascii " " /* */ | |
.ascii " " /* */ | |
.ascii " " /* product #, version */ | |
.word 0 /* check sum */ | |
.ascii "J " /* controller */ | |
.long 0x00000000, 0x0007ffff /* ROM address range */ | |
.long 0x00ff0000, 0x00ffffff /* RAM address range */ | |
.ascii " " /* */ | |
.ascii " " /* */ | |
.ascii " " /* */ | |
.ascii " " /* */ | |
.ascii "U " /* region support */ | |
.section .text | |
start: | |
nop | |
jmp start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment