Instruction Set

From Spartan Blue CPU

Jump to: navigation, search
Instruction	
Mnemonic	Opcode
HLT	0000            Halt
NOP	0001            No operation
NOT	0002            ACC=~ACC
RAL	0003            Rotate Left ACC
INCA	0005            Increment Accumulator
DECA	0006            Decrement Accumulator
RAR	0007            Rotate Right ACC
FRAME	0008            Load IX with SP
LDXA	0009            Load A with [IX]
SKIP	001X            Skip (takes 3 bit condition code, plus "not" bit
SKIPPN	0020/21         (See below for all skips)
QOFF	0022            Turn Q off
QON	0023            Turn Q on
QTOG	0024            Toggle Q
LDI	0025            Load Immediate
INCX	0030            Increment IX
DECX	0031            Decrement IX
STX	0032            ACC=IX
JMPA	0033            Jump to accumulator value
SWAP	0034            Swap ACC bytes
POP	0040            Pop from stack
RET	0041            Return from subroutine
POPX	0042            Pop to IX
POPF	0043            Pop to Flags
PUSH	0050            Push to stack
PUSHX	0052            Push IX
PUSHF	0053            Push Flags
ADD	1XXX            Add Acc+[XXX]
XOR	2XXX            XOR Acc x [XXX]
AND	3XXX            And Acc & [XXX]
IOR	4XXX            Inclusive OR Acc|[XXX]
CMP	5XXX            Compare ACC-[XXX] (discard result, just flags)
LDA	6XXX            Load A with [XXX]
STA	7XXX            Store A to [XXX]
CALL	8XXX            Call XXX
SUB	9XXX            Subtract Acc-[XXX]
JMP	AXXX            Jump to XXX
LDX	BXXX            Load X with XXX
LDS	CXXX            Load Stack pointer with XXX
---	DXXX            Not used
LDAX	EXXX            ACC=[XXX+IX]
STAX	FXXX            [XXX+IX]=ACC
	
	
SO	0011     Skip Overflow
SZ	0012     Skip Zero
SZO	0013     Skip Zero or Overflow
SC	0014     Skip Carry
SCO	0015     Skip Carry or Overflow
SCZ	0016     Skip Carry or Zero
SCZO	0017     Skip Carry or Zero or Overflow
SNO	0019     Skip no Overflow
SNZ	001A     Skip no Zero
SNZO	001B     Skip no zero and no overflow
SNC	001C     Skip no carry
SNCO	001D     Skip no carry and no overflow
SNCZ	001E     Skip no Carry and no Zero
SNCZO	001F     Skip no Carry and no Zero and no Overflow
SNEG	0020     Skip Negative
SPOS	0021     Skip Positive
Personal tools