gipu/cpp/opcodes.h

45 lines
545 B
C
Raw Normal View History

2017-05-17 17:32:05 +01:00
/*
MEMORY LOCATIONS AND IMMEDIATES ARE 16 BITS LONG
*/
2017-05-17 17:58:00 +01:00
enum OPS_STARTING_VALUES {
2017-05-17 17:32:05 +01:00
MOVI,
MOVR,
LOAD,
STOR,
ADDI,
ADDR,
SUBI,
SUBR,
XORI,
XORR,
NOTR,
MULI,
MULR,
DIVI,
DIVR,
PUSH,
POOP,
2017-05-17 18:31:27 +01:00
COMP,
2017-05-17 17:32:05 +01:00
JUMP,
2017-05-17 18:31:27 +01:00
JMPA,
JMPB,
JMPE,
2017-05-17 17:32:05 +01:00
SHIT,
NOPE,
GERM,
NUM_OPS
};
uint8_t OPS[NUM_OPS];
2017-05-17 18:31:27 +01:00
#define REG2REG 2
#define IMM2REG 4
#define REG2IMM 4
#define UNARY 1
#define MOVI_SIZE IMM2REG
#define MOVR_SIZE REG2REG
#define LOAD_SIZE IMM2REG
#define STOR_SIZE REG2IMM
#define ADDI_SIZE IMM2REG
#define ADDR_SIZE REG2REG