Topics

UTTORI ASM · IN DEVELOPMENT

SNES directive reference

Browse SNES mapper, data, source, struct, and output directives.

The active SNES target combines core directives with plugin directives. “No-op” below means accepted for source compatibility without the Asar side effect.

Command Syntax Status & Effect
db, dc.b db value[,value...] Emit 8-bit values or mapped string characters
dw, dc.w dw value[,value...] Emit little-endian 16-bit values
dl, dc.l dl value[,value...] Emit little-endian 24-bit values
dd dd value[,value...] Emit little-endian 32-bit values
fillbyte/word/long/dword fillbyte value Set repeating fill pattern width/value
fill fill count Emit bytes from the current fill pattern
padbyte/word/long/dword padbyte value Set pad unit width/value
pad pad [address] Pad to a mapped address or next 64 KiB boundary
incsrc incsrc "file" Assemble a source file inline
include include "file" Include a source file inline
includeonce includeonce Guard the current file once per stage
incbin incbin "file"[:range] [-> target] Embed binary bytes, optionally sliced or relocated
base base address|off Change or restore logical base address
org org address Set mapped write position
pushbase, pullbase no operands Save/restore logical base address
pushpc, pullpc no operands Save/restore the full PC state
arch arch name Select 65816, SPC700 mode, or Super FX
lorom, hirom no operands Select standard SNES ROM map
exlorom, exhirom no operands Select extended SNES ROM map
sfxrom no operands Select Super FX ROM map
norom no operands Select flat 1:1 output. Disables checksum/freespace
sa1rom sa1rom [a,b,c,d] Select SA-1 map and optional decimal bank selectors
fullsa1rom no operands Select full/big SA-1 map
fastrom no operands Accepted no-op
namespace namespace [name|off|nested on|nested off] Set or configure label namespace
pushns, pullns no operands Save/restore namespace state
table table "file"[,ltr|rtl] Replace character mappings from a table file
cleartable no operands Restore identity fallback
pushtable, pulltable no operands Save/restore character mapping
freecode, freedata, freespace no operands Append one RATS-protected allocation
freespacebyte freespacebyte value Set freespace/output expansion byte
prot prot label[,label...] Emit a RATS protection record
spcblock spcblock destination [nspc] Begin ROM-embedded SPC block
endspcblock endspcblock [execute address] Finish SPC block and optionally emit execute record
startpos startpos address Save execute address for active SPC block
struct struct name [base|extends parent] Begin non-emitting layout definition
skip .member: skip size Advance current struct member offset
endstruct endstruct [align value] Finalize struct size/stride
dataStruct dataStruct Record[index], { field = value } Emit a complete named record at its bound address
dataStructs dataStructs Record Begin consecutive [index] = { field = value } rows
endDataStructs endDataStructs End a non-empty named-record table
undef undef [!]name Remove a textual define
global global Label: Define a namespace-independent global label
character assignment "A" = value Set one active character mapping
if, elseif, else, endif block syntax Conditional assembly
while, endwhile block syntax Conditional repeated assembly
for, endfor for name = start..end Inclusive counted assembly loop
macro, endmacro macro name(args) Define a command macro
function function name(args) = expression Define a numeric expression function
assert assert condition[,message...] Fail when condition is zero
error error [message...] Always fail
warnpc warnpc address Fail when PC exceeds address
check check title or check bankcross mode Enable reads or configure bank boundary policy
optimize optimize dp none|ram|always Configure direct-page size optimization; other forms ignored
dpbase any Accepted no-op
warnings any Accepted no-op
print any Accepted no-op
warn any Accepted no-op
autoclean, autoclear any Accepted no-op
includefrom any Accepted no-op
asar any Accepted no-op
reset, {, } any Accepted no-op