Custom Intel Assembler Backend
Budget: $250 – $750 USD
My scope-based assembler already parses labels and nests subsections, but it still lacks a true Intel encoding backend. I now need all encode functions written in beautiful, pure C—no LLVM, no external code generators—matching the intermediate level of complexity I have been following in the rest of the project.
Each instruction must resolve to the right opcode map across 16-, 32- and 64-bit modes. You will wire those encode_* helpers into the existing parser and extend main() so the current “-b” switch (raw binary stream) is joined by a second flag that lets me choose between a flat binary and an object file suitable for ld later on.
Inside every label scope the assembler already understands custom sections rather than the usual .data/.text/.bss. Your work must honour the following exact section names: assign, declare, code, literal, arch_16, arch_32 and arch_64. Operand size, relocation placeholders and symbol resolution must all stay aware of these scopes so that labels remain local to their parent block. This includes arrays which allow you to fill in the array separately from the size.
Deliverables – acceptance criteria
• encode_intel.c / encode_intel.h implementing full Intel map with 16/32/64 support
• Patched main.c adding the new output-format flag, updating usage string and help text
• Minimal test source that shows assign/declare/code/literal and emits both flat binary and linkable object without breaking existing “-b” behaviour
If your patch compiles cleanly with gcc ‑std=c11, produces byte-for-byte correct output and keeps the codebase dependency-free, I can merge right away. All variable and functions names must be lower case and if needed separated by an underscore for better description if names that are longer.
Each instruction must resolve to the right opcode map across 16-, 32- and 64-bit modes. You will wire those encode_* helpers into the existing parser and extend main() so the current “-b” switch (raw binary stream) is joined by a second flag that lets me choose between a flat binary and an object file suitable for ld later on.
Inside every label scope the assembler already understands custom sections rather than the usual .data/.text/.bss. Your work must honour the following exact section names: assign, declare, code, literal, arch_16, arch_32 and arch_64. Operand size, relocation placeholders and symbol resolution must all stay aware of these scopes so that labels remain local to their parent block. This includes arrays which allow you to fill in the array separately from the size.
Deliverables – acceptance criteria
• encode_intel.c / encode_intel.h implementing full Intel map with 16/32/64 support
• Patched main.c adding the new output-format flag, updating usage string and help text
• Minimal test source that shows assign/declare/code/literal and emits both flat binary and linkable object without breaking existing “-b” behaviour
If your patch compiles cleanly with gcc ‑std=c11, produces byte-for-byte correct output and keeps the codebase dependency-free, I can merge right away. All variable and functions names must be lower case and if needed separated by an underscore for better description if names that are longer.