holey-bytes/src/bytecode/ops.rs

44 lines
676 B
Rust
Raw Normal View History

2023-04-18 23:08:30 +00:00
#[repr(u8)]
pub enum Operations {
NOP = 0,
ADD = 1,
SUB = 2,
MUL = 3,
DIV = 4,
2023-04-22 18:00:19 +00:00
// LOADs a memory address/constant into a register
LOAD = 5,
// STOREs a register/constant into a memory address
STORE = 6,
2023-04-18 23:08:30 +00:00
JUMP = 100,
2023-04-22 18:00:19 +00:00
JumpCond = 101,
2023-04-18 23:08:30 +00:00
RET = 103,
}
2023-04-22 18:00:19 +00:00
pub enum SubTypes {
2023-04-18 23:08:30 +00:00
EightBit = 1,
SixtyFourBit = 2,
2023-04-22 18:00:19 +00:00
Register8 = 3,
Register64 = 4,
}
pub enum MathOpSubTypes {
Unsigned = 0,
Signed = 1,
FloatingPoint = 2,
}
pub enum RWSubTypes {
AddrToReg = 0,
RegToAddr,
ConstToReg,
ConstToAddr,
2023-04-18 23:08:30 +00:00
}
2023-04-22 18:00:19 +00:00
pub enum JumpConditionals {
Equal = 0,
NotEqual = 1,
LessThan = 2,
GreaterThan = 3,
2023-04-18 23:08:30 +00:00
}