Wikia

ROM Hack City

SPC-700

Talk0
83pages on
this wiki

The SPC-700 processor is a 16-bit processor. The SPC-700 does 8-bit arithmetic, does 16-bit arithmetic, has a 16-bit memory address space, has an 8-bit IO address space, and also features the SPC-700 timers. The SPC-700 came from Sony, so the initials SPC might mean Sony processor.

Sony possibly had other uses for the SPC-700, but ROM hackers know the SPC-700 for exactly one purpose: the SPC-700 is the audio coprocessor inside the SNES. (This was before the Sony Playstation, when the Nintendo SNES contained a Sony chip.) The SNES attaches the SPC-700 to a digital sequencer. A program uses the SPC-700 timers to set the tempo and the digital sequencer to make music from sound samples.

Contents

From 65816 to SPC-700 Edit

Assembly hackers tend to learn the 65816 (the central processor of the SNES) before they learn the SPC-700. The two processors share some ideas.

The 65816 belongs to the 65xx family. The SPC-700 is not a 65xx processor, but some of the concepts and instructions are similar, so the SPC-700 is like a "Kaizo" 65xx. Some of the SPC-700 instructions are exactly like 65816 instructions, except that the opcode is different and the assembly syntax fits a different pattern. For example,

  • the SPC-700 mov A, $nn (opcode $e4) is like the 65816 sta $nn (opcode $85).
  • the SPC-700 mov $nn, A (opcode $c4) is like the 65816 lda $nn (opcode $a5).
  • the SPC-700 mov $nn, $nn (opcode $fa) is new.

Like the 65816, the SPC-700 has an accumulator A and two index registers X and Y. The SPC-700 has no 16-bit mode for these registers, so A and X and Y are always 8-bit. Instead, registers Y and A of the SPC-700 combine to form 16-bit register YA. The SPC-700 has separate 8-bit and 16-bit instructions.

Like the 65816, the SPC-700 has a direct page for 8-bit addresses. Unlike the 65816, the SPC-700 can use the direct page locations like 8-bit accumulators. So the SPC-700 provides both adc A, #$nn and adc $nn, #$nn. With two direct page addresses in registers X and Y, the SPC-700 provides adc (X),(Y). In SPC-700 assembly language, the round parentheses (...) use a direct page address, while the square brackets [...] use a 16-bit address. The SPC-700 never uses any 24-bit addresses.

Assemblers like wla-spc700 require every 16-bit operand to start with an exclamation point. This distinguishes adc A, $nn from adc, A, !$nnnn.

Wiki pages Edit

Mnemonics Edit

Mnemonic SPC-700 instruction
adc ADd with Carry
addw ADD Word
and1  ?
and bitwise AND
asl Arithmetic Shift Left
bbc  ?
bbs  ?
bcc Branch if Carry Clear
bcs Branch if Carry Set
beq Branch if EQual to zero
bmi Branch if MInus
bne Branch if Not Equal to zero
bpl Branch if PLus
bra BRanch Always
brk BReaKpoint interrupt
bvc Branch if oVerflow Clear
bvs Branch if oVerflow Set
call CALL subroutine
cbne  ?
clr1  ?
clrc CLeaR Carry flag
clrp  ?
clrv CLeaR oVerflow flag
cmp CoMPare
cmpw CoMPare Word
daa Decimal Adjust Addition
das Decimal Adjust Subtract
dbnz  ?
dec DECrement
decw DECrement Word
di  ?
div DIVide
ei  ?
eor1  ?
eor bitwise Exclusive OR
inc INCrement
incw INCrement Word
jmp JuMP to address
lsr Logical Shift Right
mov1  ?
mov MOVe (to destination from source)
movw MOVe Word (to destination from source)
mul MULtiply
nop No OPeration
not1  ?
notc  ?
or1  ?
or bitwise OR
pcall  ?
pop POP (pull) from stack
push PUSH to stack
ret1  ?
ret RETurn from subroutine
rol ROtate Left
ror ROtate Right
sbc SuBtract with Carry
set1  ?
setc SET Carry flag
setp  ?
sleep SLEEP processor
stop STOP processor
subw SUBtact Word
tcall  ?
tclr1  ?
tset1  ?
xcn eXChange Nibbles
This box is {{mtable.spc700}}.

References Edit

Advertisement | Your ad here

Photos

Add a Photo
10photos on this wiki
See all photos >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki