[ << ] [ >> ]           [] [] [] [ ? ]

27 SPC700 cpu module

This chapter documents the backend for the SONY SPC700 CPU.


27.1 Legal

This module is written in 2025 by Frank Wille and is covered by the vasm copyright without modifications.


27.2 Additional options for this module

This module provides the following additional options:

-am

Automatically mask values to match their data size or the size of immediate addressing, which effectively disables any range checks on immediate and data values in the assembler and linker.

-dpo

Generate 8-bit offset instead of absolute relocations when accessing a zero- or direct-page symbol.

-opt-branch

Enables translation of B<cc> branches into sequences of B<!cc> *+5 ; JMP label when necessary. BRA is directly translated into a JMP when out of range. It also performs optimization of JMP to BRA, whenever possible.


27.3 General

This backend accepts SPC700 instructions using the official names and syntax as provided by Sony.

The target address type is 16 bits.

Instructions consist of one up to three bytes and require no alignment. There is also no alignment requirement for sections and data.


27.4 Extensions

This backend provides the following specific extensions:

This backend extends the selected syntax module by the following directives:

<symbol> equd <expr>

Works exactly like the equ directive, but marks <symbol> as a direct page symbol and use direct page addressing whenever <symbol> is used in a memory addressing mode.

p0

Informs the assembler about the current state of the P flag. P0 assumes the direct page to reside at $0000 (default). This information is used to decide whether absolute address references can be optimized to direct page addressing modes.

p1

Informs the assembler about the current state of the P flag. P1 assumes the direct page to reside at $0100. This information is used to decide whether absolute address references can be optimized to direct page addressing modes.

direct

Switch to a direct page section called direct or .direct, which has the type bss with attributes "aurwz". Accesses to symbols from this section will default to direct page addressing mode.

dpage <symbol1> [,<symbol2>...]

Mark symbols as direct page and use direct page addressing for expressions based on this symbol, unless overridden by the addressing mode selector !.

All these directives are also available in the form starting with a dot (.).


27.5 Optimizations

This backend performs the following operand optimizations and translations:


27.6 Known Problems

Some known problems of this module at the moment:


27.7 Error Messages

This module has the following error messages:


[ << ] [ >> ]           [] [] [] [ ? ]