amiga: replace magic numbers in startup.S with named constants#2
Merged
reinauer merged 1 commit intoreinauer:mainfrom Apr 15, 2026
Merged
Conversation
Use #defines for exec library LVOs, Task struct offsets, StackSwap
struct layout, and AllocMem flags. The NDK's own exec/tasks.i and
lvo/exec_lib.i use classic Amiga assembler syntax (IFND/SET/STRUCTURE
/EQU) that GNU AS doesn't parse, so we redefine just what we need at
the top of the file with a pointer to the NDK headers they came from.
Generated code is byte-identical to the previous version.
Two m68k GAS quirks worth noting for future edits:
- '|' is the line-comment character, so MEMF_PUBLIC|MEMF_CLEAR must
be written as MEMF_PUBLIC+MEMF_CLEAR (safe here since the bits
don't overlap).
- Parenthesised expressions in immediates (e.g. #(A|B)) don't parse
cleanly either.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#definesexec/tasks.iandlvo/exec_lib.iuse classic Amiga assembler syntax (IFND/SET/STRUCTURE/EQU) that GNU AS doesn't parse, so the defines are inlined at the top of the file with pointers to the NDK headers they came fromobjdump -d)Test plan
make amigabuilds clean with m68k-amigaos-gccobjdump -d startup.ooutput matches the previous version byte-for-byte