Japanese
HARDWARE ManualSCU User's Manual
BackForward
SCU User's Manual/Chapter 4 DSP Control

■4.2 Command list

Below is a list of instructions used in SCU-DSP.

◆Arithmetic instructions

ALU control

NOP
I won't do anything.
AND
Performs a logical AND between [ACL] and [PL].
OR
Performs the logical OR of [ACL] and [PL].
XOR
Performs exclusive OR of [ACL] and [PL].
ADD
Add [ACL] and [PL].
SUB
Subtract [PL] from [ACL].
AD2
Add [ACH][ACL] and [PH][PL].
S.R.
Shift [ACL] to the right by 1 bit and store the LSB in the carry flag.
RR
Rotate [ACL] to the right by 1 bit and store the LSB in the carry flag.
SL
Shift [ACL] to the left by 1 bit and store 0 in the LSB of [ACL] and the MSB in the carry flag.
R.L.
Rotate [ACL] to the left by 1 bit and store the MSB in the carry flag.
RL8
Rotate [ACL] to the left by 8 bits and store b24 in the carry flag.

X-Bus control

NOP
I won't do anything.
MOV[s],X
Transfer data from data RAM to [RX].
MOV MUL,P
Transfer the data of [MULTIPLIER] to [PH][PL].
MOV[s],P
Transfer data from data RAM to [PL].

Y-Bus control

NOP
I won't do anything.
MOV[s],Y
Transfer data from data RAM to [RY].
CLR A
Clear [ACH] and [ACL] to 0.
MOV ALU,A
Transfer the data of [ALU] to [ACH][ACL].
MOV[s],A
Transfer data from data RAM to [ACL].

D1-Bus control

NOP
I won't do anything.
MOV SImm,[d]
Stores the SImm (short immediate) data in the data RAM or register specified by [d].
MOV [s],[d]
Transfers data from the data RAM or register specified by [s] to the data RAM or register specified by [d].

◆Load immediate instruction

MVI Imm,[d]
Stores the Imm (immediate) data in the data RAM or register specified by [d].
MVI Imm,[d],Z
Only when Z (zero flag) of the program control port is 1, Imm (immediate) data is stored in the data RAM or register specified by [d].
MVI Imm,[d],NZ
Only when Z (zero flag) of the program control port is 0, Imm (immediate) data is stored in the data RAM or register specified by [d].
MVI Imm,[d],S
Only when S (sign flag) of the program control port is 1, Imm (immediate) data is stored in the data RAM or register specified by [d].
MVI Imm,[d],NS
Only when S (sign flag) of the program control port is 0, Imm (immediate) data is stored in the data RAM or register specified by [d].
MVI Imm,[d],C
Only when C (carry flag) of the program control port is 1, Imm (immediate) data is stored in the data RAM or register specified by [d].
MVI Imm,[d],NC
Only when C (carry flag) of the program control port is 0, Imm (immediate) data is stored in the data RAM or register specified by [d].
MVI Imm,[d],TO
Only when TO (D0 bus DMA execution flag) of the program control port is 1, Imm (immediate) data is stored in the data RAM or register specified by [d].
MVI Imm,[d],NTO
Only when TO (D0 bus DMA execution flag) of the program control port is 0, Imm (immediate) data is stored in the data RAM or register specified by [d].
MVI Imm,[d],ZS
Only when either Z (zero flag) or S (sign flag) of the program control port is 1, Imm (immediate) data is stored in the data RAM or register specified by [d].
MVI Imm,[d],NZS
Only when Z (zero flag) and S (sign flag) of the program control port are both 0, Imm (immediate) data is stored in the data RAM or register specified by [d].

◆DMA instruction

DMA D0,[RAM],SImm
Set the SImm (short immediate) data as a transfer counter in the transfer word counter ([TN0]), and use the D0 bus to transfer the data from the outside to the RAM area specified by [RAM]. The transfer start address ([RA0]) and transfer word counter ([TN0]) are updated to the values at the end of the transfer.
DMA [RAM],D0,SImm
Set the SImm (short immediate) data as a transfer counter in the transfer word counter ([TN0]), and transfer the data externally from the RAM area specified by [RAM] using the D0 bus. The transfer start address ([WA0]) and transfer word counter ([TN0]) are updated to the values at the end of the transfer.
DMA D0,[RAM],[s]
Set the data in the data RAM specified by [s] to the transfer word counter ([TN0]) as a transfer counter, and use the D0 bus to externally transfer the data to the RAM area specified by [RAM]. forward. The transfer start address ([RA0]) and transfer word counter ([TN0]) are updated to the values at the end of the transfer.
DMA [RAM],D0,[s]
Set the data in the data RAM specified by [s] to the transfer word counter ([TN0]) as a transfer counter, and transfer the data externally from the RAM area specified by [RAM] using the D0 bus. forward. The transfer start address ([WA0]) and transfer word counter ([TN0]) are updated to the values at the end of the transfer.
DMAH D0,[RAM],SImm
Set the SImm (short immediate) data as a transfer counter in the transfer word counter ([TN0]), and transfer the data from the outside to the RAM area specified by [RAM] using the D0 bus. The transfer start address ([RA0]) and transfer word count counter ([TN0]) retain the values they had when the transfer started.
DMAH [RAM],D0,SImm
Set the SImm (short immediate) data as a transfer counter in the transfer word counter ([TN0]), and transfer the data externally from the RAM area specified by [RAM] using the D0 bus. The transfer start address ([WA0]) and transfer word count counter ([TN0]) retain the values they had when the transfer started.
DMAH D0,[RAM],[s]
Set the data in the data RAM specified by [s] to the transfer word counter ([TN0]) as a transfer counter, and use the D0 bus to externally transfer the data to the RAM area specified by [RAM]. forward. The transfer start address ([RA0]) and transfer word count counter ([TN0]) retain the values they had when the transfer started.
DMAH [RAM],D0,[s]
Set the data in the data RAM specified by [s] to the transfer word counter ([TN0]) as a transfer counter, and transfer the data externally from the RAM area specified by [RAM] using the D0 bus. forward. The transfer start address ([WA0]) and transfer word count counter ([TN0]) retain the values they had when the transfer started.

◆JUMP instruction

JMP Imm
Move to the address indicated by Imm (immediate).
JMP Z,Imm
When Z (zero flag) of the program control port is 1, move to the address indicated by Imm (immediate).
JMP NZ,Imm
When Z (zero flag) of the program control port is 0, move to the address indicated by Imm (immediate).
JMP S,Imm
When S (sign flag) of the program control port is 1, move to the address indicated by Imm (immediate).
JMP NS,Imm
When S (sign flag) of the program control port is 0, move to the address indicated by Imm (immediate).
JMP C,Imm
When C (carry flag) of the program control port is 1, it moves to the address indicated by Imm (immediate).
JMP NC,Imm
When C (carry flag) of the program control port is 0, move to the address indicated by Imm (immediate).
JMP TO,Imm
When TO (D0 bus DMA execution flag) of the program control port is 1, move to the address indicated by Imm (immediate).
JMP NTO,Imm
When TO (D0 bus DMA execution flag) of the program control port is 0, move to the address indicated by Imm (immediate).
JMP ZS,Imm
When either Z (zero flag) or S (sign flag) of the program control port is 1, move to the address indicated by Imm (immediate).
JMP NZS,Imm
When Z (zero flag) and S (sign flag) of the program control port are both 0, move to the address indicated by Imm (immediate).

◆LOOP BOTTOM instruction

BTM
When the loop counter ([LOP]) is other than 0, the top address register ([TOP]) is stored in the program counter and the loop counter ([LOP]) is decremented. When it is 0, it does nothing.
LPS
When the loop counter ([LOP]) is other than 0, stop the program counter, execute the next instruction, decrement the loop counter ([LOP]), and repeat until the loop counter reaches 0.

◆END command

END
Stop the program and reset the EX (program execution control flag) of the program control port.
ENDI
Stop the program, reset EX (program execution control flag) of the program control port, and set E (program end interrupt flag).

●Description of DSP program

For constants or assembler descriptions, please refer to the " SCU DSP Arambula User's Manual " in the appendix.


BackForward
HARDWARE ManualSCU User's Manual
Copyright SEGA ENTERPRISES, LTD., 1997