Specifications

2-8 Programmer’s Guide Sega
Psy-Q Development System
ASMSH Specific Features
For details of SH series assembler opcodes you should refer to the official Sega
documentation. These Psy-Q assemblers have pseudo-ops which are largely similar to
those of the Psy-Q 68000 assembler. All Data definition directives are the same as for
the 68000 (e.g. DC.size, DS.size, DCB.size, RS.size; where size is either .b, .w, or
.l).
Additional features of ASMSH which are specific to this version include:-
Default data size of an instruction is longword (32 bits). So beware:-
mov @r1+,r2 ; this instruction moves a longword into r2,
; not a word.
The SH does not have an op-code for immediate subtraction. However the
ASMSH assembler will allow you to use such an instruction and will instead
generate and immediate add with a negative quantity:-
sub #1,r1 ;generates opcode for add #-1,r1
Instructions that have only one legal size may have that size specified:-
add.l r1,r2
Immediate operands in the range 128 to 255 are allowed with a warning since
these will be sign extended when loaded. e.g.
mov #200,r1 ;will give a warning.
This could be changed so that if you use .b or .w as the instruction size, then you
will only get an error if the operand doesn’t fit in the specified size.
You can use the following pseudo-ops from the Hitachi assembler:-
.equ
.org
.align
.arepeat
.aendr
.end
Instructions with PC relative operands check the alignment of their operands.
The assembler checks that you do not put an illegal instruction in a delay slot.