spt-assembler-explorer
Interactive assemble-and-inspect workflow for the SPT3.8 toolchain (as-spt, objdump-spt). Assembles SPT3.8 source (.spt files), adds the correct .include directives and -I path for predefined memory s
Files1
View on GitHubSKILL.mdskills/compiler/spt-assembler-explorer/SKILL.md
GitHubSPT3.8 Assembler Explorer (NXP SPT / Radar Signal Processing Toolbox)
Assemble SPT3.8 source code using a locally installed SPT3.8 toolchain, produce the ELF
output, and disassemble it with objdump-spt. Everything -- syntax, mnemonics, operand
order, .include directives -- must match the SPT3.8 Assembler Manual.
SPT is a radar signal processing accelerator on S32R. There is no C/C++ compiler. Do not use
-mcpu=,-O*, or any ARM flags.
When to use
Use this skill when:
- User asks "assemble this SPT snippet"
- User asks "how does the SPT assembler encode this instruction?"
- User asks "which absolute address does
OR_2_5_3map to?" - User wants an example of an SPT instruction
Do not use this skill for:
- C/C++ compilation for LAX or ARM
- Section/symbol size analysis -> use
spt-binary-analysis
Available Capabilities
| Type | Name | Invocation |
|---|---|---|
This skill uses the standardized search_actions + execute_action MCP tool surface. |
| Action name | Purpose |
|---|---|
compiler.list_spt_tools |
Discover toolchain and inc/ folder; call first |
compiler.spt_execute |
Run as-spt, objdump-spt, and other SPT binutils |
Quickstart
1. Discover toolchain
Tool: list_spt_compiler_tools
Output: toolchain_bin_dir, path to inc/ folder (wr.inc, spr.inc, tram.inc, oram.inc)
2. Assemble
Tool: spt_execute, binary="as-spt"
Input: args="-I<path_to_inc>", input_code="<source with .include>", input_language="spt"
Output: a.out (ELF)
3. Disassemble
Tool: spt_execute, binary="objdump-spt", args="-Dr a.out"
Output: 128-bit instruction listing with 4x32-bit encoding words
Configuration
Include-file mapping (always add the matching .include for symbols used):
| Symbol prefix | Include file |
|---|---|
WR_0..WR_63 |
wr.inc |
SPR_*, HW_SPR_*, EVT_SPR_*, CHRP_SPR_* |
spr.inc |
TR_<bank>_<col>_<slice> |
tram.inc |
OR_<bank>_<col>_<slice> |
oram.inc |
Assembler key facts:
- Source files must use the
.sptextension - Immediates use
#prefix onadd,cmp,loop,set,sub - Operand order is fixed per the manual; do not rearrange
- Output is ARM EABI compatible ELF (32-bit default,
-a64for 64-bit)
Guardrails
Scope
- Only calls
list_spt_compiler_toolsandspt_execute. No user files modified.
Destructive actions
- All output goes to the tool's isolated scratch directory.
Refuse-and-escalate
- If no SPT3.8 toolchain found, stop and tell the user.
- Do not invent mnemonics, operand values, or instruction forms not in the manual.
- Do not feed C/C++ source to
as-spt-- it is assembly-only. - Do not use stock GNU
objdumpon SPT ELFs -- useobjdump-spt.
Resource limits
- Limit each assembly session to a single snippet or small file.
Secrets
- Do not log source content that may contain sensitive material.
Workflow
Step 1 -- Discover toolchain
Call list_spt_compiler_tools(). Identify toolchain_bin_dir and the inc/ folder.
Step 2 -- Draft the source
- Identify every symbol prefix used (
WR_*,SPR_*,TR_*,OR_*). - Add matching
.include "<file.inc>"at the top. - Use
#<value>for immediates onadd,cmp,loop,set,sub. - Keep operand order exactly as in the manual.
- Name the file
.spt(setinput_language: "spt").
Step 3 -- Assemble
{
"toolchain_bin_dir": "<bin dir>",
"binary": "as-spt",
"args": "-I<path_to_inc>",
"input_code": "<source with .include directives>",
"input_language": "spt"
}
Step 4 -- Disassemble
{
"toolchain_bin_dir": "<bin dir>",
"binary": "objdump-spt",
"args": "-Dr <artifact_path>"
}
Each 128-bit SPT instruction prints on one line with 4 x 32-bit encoding words. Omitted operands appear explicitly with their implicit encoded value.
Step 5 -- Explain the result
Reprint the disassembly, cite field slicing from the manual, note which operands were
omitted and their implicit values, and explain which .include was needed and why.
Validation loop
list_spt_compiler_tools()returns a non-empty toolchain list.- Every predefined symbol in the source has a matching
.includeat the top. as-sptexits 0.objdump-spt -Droutput is non-empty and encoding is explained.
Out of scope
- C/C++ compilation (SPT3.8 has no C compiler)
- Section-level size analysis (use
spt-binary-analysis)
See Also
spt-binary-analysis-- section and symbol size analysis