36.2. Syntax

36.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.

36.2.2. Register Names

You can use the predefined symbols r0 through r63 to refer to the SH64 general registers, cr0 through cr63 for control registers, tr0 through tr7 for target address registers, fr0 through fr63 for single-precision floating point registers, dr0 through dr62 (even numbered registers only) for double-precision floating point registers, fv0 through fv60 (multiples of four only) for single-precision floating point vectors, fp0 through fp62 (even numbered registers only) for single-precision floating point pairs, mtrx0 through mtrx48 (multiples of 16 only) for 4x4 matrices of single-precision floating point registers, pc for the program counter, and fpscr for the floating point status and control register.

You can also refer to the control registers by the mnemonics sr, ssr, pssr, intevt, expevt, pexpevt, tra, spc, pspc, resvec, vbr, tea, dcr, kcr0, kcr1, ctc, and usr.

36.2.3. Addressing Modes

SH64 operands consist of either a register or immediate value. The immediate value can be a constant or label reference (or portion of a label reference), as in this example:

	movi	4,r2
	pt	function, tr4
	movi	(function >> 16) & 65535,r0
	shori	function & 65535, r0
	ld.l	r0,4,r0

Instruction label references can reference labels in either SHmedia or SHcompact. To differentiate between the two, labels in SHmedia sections will always have the least significant bit set (i.e. they will be odd), which SHcompact labels will have the least significant bit reset (i.e. they will be even). If you need to reference the actual address of a label, you can use the datalabel modifier, as in this example:

	.long	function
	.long	datalabel function

In that example, the first longword may or may not have the least significant bit set depending on whether the label is an SHmedia label or an SHcompact label. The second longword will be the actual address of the label, regardless of what type of label it is.