Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neo6502: Output .neo file format (#344) #345

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion mos-platform/neo6502/link.ld
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ASSERT(__rc31 == 0x001f, "Inconsistent zero page map.")

MEMORY {
zp : ORIGIN = __rc31 + 1, LENGTH = 0x100 - (__rc31 + 1)
ram (rw) : ORIGIN = 0x0800, LENGTH = 0xf600 - 0x0800
ram (rw) : ORIGIN = 0x0200, LENGTH = 0xf600 - 0x0200
}

REGION_ALIAS("c_readonly", ram)
Expand All @@ -26,6 +26,21 @@ SECTIONS {
/* Set initial soft stack address to just above last memory address. (It grows down.) */
__stack = 0xf600;

/*
* .neo file format
* http://neo6502.com/reference/formats/#neo-load-file-format
*/
OUTPUT_FORMAT {
BYTE(0x03) /* magic cookie (not a valid 65c02 opcode) */
BYTE(0x4E) /* 'N' */
BYTE(0x45) /* 'E' */
BYTE(0x4F) /* 'O' */
BYTE(0x00) /* min version - major */
BYTE(0x00) /* min version - minor */
SHORT(_start) /* execute address */
BYTE(0x00) /* ctrl bits. bit 7=another block follows */
SHORT(ORIGIN(ram)) /* load address */
SHORT(__data_end - ORIGIN(ram)) /* size in bytes */
BYTE(0x00) /* string - comment, filename, whatever */
TRIM(ram)
}