35.2. Syntax

35.2.1. Special Characters

! is the line comment character.

You can use ; instead of a newline to separate statements.

Since $ has no special meaning, you may use it in symbol names.

35.2.2. Register Names

You can use the predefined symbols r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, and r15 to refer to the SH registers.

The SH also has these control registers:


procedure register (holds return address)


program counter

mach, macl

high and low multiply accumulator registers


status register


global base register


vector base register (for interrupt vectors)

35.2.3. Addressing Modes

as understands the following addressing modes for the SH. Rn in the following refers to any of the numbered registers, but not the control registers.


Register direct


Register indirect


Register indirect with pre-decrement


Register indirect with post-increment

@(disp, Rn)

Register indirect with displacement

@(R0, Rn)

Register indexed

@(disp, GBR)

GBR offset

@(R0, GBR)

GBR indexed

addr, @(disp, PC)

PC relative address (for branch or for addressing memory). The as implementation allows you to use the simpler form addr anywhere a PC relative address is called for; the alternate form is supported for compatibility with other assemblers.


Immediate data