CPU.xlsx - The main spreadsheet which contains the CPU ROM.xlsx - The ROM spreadsheet used read by the CPU when the read ROM switch is turned on InstructionSet.xlsx - Explains the ISA of the CPU compileExcelASM16.py - The Excel-ASM16 compiler Excel-ASM16.xml - Markdown for the Excel-ASM16 language compatible with Notepad++ Sample Programs - Folder of sample programs for the Excel CPU
REG ; refers to any of the 16 general purpose registers E.G. R0, R1, R15 &c.
MEM ; refers to any 16-bit addressable memory unit (formatted in hexadecimal) E.G. @0000, @F000, @FFFF, &c.
IMD ; refers to an immediate number usually 16-bits long, except in the case of ROL and ROR ; can be defined either in decimal or hexadecimal E.G. #0000, $0CCC, #60340, $FF10, &c.
LOAD
1 2 3
LOAD REG MEM ; loads the specified memory unit into REG LOAD REG IMD ; load specified 16-bit immediate value into REG LOAD REG REG ; loads memory unit at the address stored in REGB into REGA
STORE
1 2
STORE REG MEM ; stores the value of REG to the address specified STORE REG REG ; stores the value of REGA into the memory unit at the address in REGB
JUMP
1 2 3 4
JMP IMD ; sets PC to the immediate 16-bit value JEQ IMD ; if ZF = 0, sets PC to the immediate 16-bit value JLT IMD ; if CF = 0, sets PC to the immediate 16-bit value JGE IMD ; if CF = 1 or ZF = 1, sets PC to the immediate 16-bit value
TRAN
1
TRAN REG REG ; transfers value from REGA to REGB
代数指令
ADD
1
ADD REG REG ; REGA + REGB + CF, result stored in REGA
SUB
1
SUB REG REG ; (REGA - REGB) - CF, result stored in REGA
MUL
1
MULT REG REG ; REGA * REGB, low 16-bit result stored in REGA, high 16-bit result stored in REGB
DIV
1
DIV REG REG ; REGA / REGB result stored in REGA, REGA MOD REGB stored in REGB
INC
1
INC REG ; REGA++, CF not affected
DEC
1
DEC REG ; REGA--, CF not affected
位指令
AND
1
AND REG REG ; REGA AND REGB, result stored in REGA
OR
1
OR REG REG ; REGA OR REGB, result stored in REGA
XOR
1
XOR REG REG ; REGA XOR REGB, result stored in REGA
NOT
1
NOT REG ; NOT REGA, result stored in REGA
移位指令
ROL
1 2
ROL REG IMD ; leftwise roll of bits of REGA carried out IMD times ; IMD is a 4-bit value
ROR
1 2
ROR REG IMD ; rightwise roll of bits of REGA carried out IMD times ; IMD is a 4-bit value
标志指令
1 2
CLC ; sets CF to 0 STC ; sets CF to 1
NOP
1
NOP ; does not effect any registers or memory
ORG
1 2
ORG IMD ; sets the location of the next instruction ; must be further than the current length of program
INC
1
INC "file.bin" ; copies the binary file into the program