; hence core lib

.define NULL, 0
.define VOID, NULL

.define FALSE, NULL
.define TRUE, 1

.define CORE_U8_MAX, 0x00ff
.define CORE_U16_MAX, 0xffff

.define CORE_KB, 1024

.define CORE_MEM_PRG, (0 * CORE_KB)
.define CORE_MEM_PRG_END, (32 * CORE_KB)
.define CORE_MEM_ST, CORE_MEM_PRG_END
.define CORE_MEM_MEM, (40 * CORE_KB)
.define CORE_MEM_OUT, (48 * CORE_KB)
.define CORE_MEM_CHR, (CORE_MEM_OUT + 1)
.define CORE_MEM_KEY, (CORE_MEM_CHR + 2)

.define CORE_REG_PC,  0x0
.define CORE_REG_OPC, 0x1
.define CORE_REG_ARG, 0x2
.define CORE_REG_S,   0x3
.define CORE_REG_SP,  0x4
.define CORE_REG_A,   0x5
.define CORE_REG_B,   0x6
.define CORE_REG_C,   0x7
.define CORE_REG_D,   0x8

.define CORE_ALU_NOT,   0x00
.define CORE_ALU_AND,   0x01
.define CORE_ALU_OR,    0x02
.define CORE_ALU_XOR,   0x03
.define CORE_ALU_LSH,   0x04
.define CORE_ALU_RSH,   0x05
.define CORE_ALU_ADD,  0x06
.define CORE_ALU_SUB,   0x07
.define CORE_ALU_MUL,   0x08
.define CORE_ALU_DIV,   0x09
.define CORE_ALU_CMP,   0x0a
.define CORE_ALU_EQ,    0x0b
.define CORE_ALU_LT,    0x0c
.define CORE_ALU_GT,    0x0d
.define CORE_ALU_LEQ,   0x0e
.define CORE_ALU_GEQ,   0x0f
.define CORE_ALU_BOL,   0x10
.define CORE_ALU_INV,   0x11
.define CORE_ALU_RND,   0x12
.define CORE_ALU_TME,   0x13
