Split files

This commit is contained in:
Ian Gulliver
2021-11-15 20:44:26 -10:00
parent be6b726851
commit 6b1da92a3a
6 changed files with 254 additions and 291 deletions

51
opcode.go Normal file
View File

@@ -0,0 +1,51 @@
package vm
type OpCodeType uint32
const (
OpNoOp OpCodeType = 0x00000000
OpNop = OpNoOp
OpCall = 0x00000001
OpCal = OpCall
OpReturn = 0x00000002
OpRet = OpReturn
OpMove = 0x00000100
OpMov = OpMove
OpAdd = 0x00000200
OpSubtract = 0x00000201
OpSub = OpSubtract
OpMultiply = 0x00000202
OpMul = OpMultiply
OpDivideUnsigned = 0x00000203
OpDivU = OpDivideUnsigned
OpDivideSigned = 0x00000204
OpDivS = OpDivideSigned
OpIsEqual = 0x00000300
OpEq = OpIsEqual
OpIsLessThanUnsigned = 0x00000301
OpLTU = OpIsLessThanUnsigned
OpIsLessThanSigned = 0x00000302
OpLTS = OpIsLessThanSigned
OpIsGreaterThanUnsigned = 0x00000303
OpGTU = OpIsGreaterThanUnsigned
OpIsGreaterThanSigned = 0x00000304
OpGTS = OpIsGreaterThanSigned
OpIsLessThanOrEqualUnsigned = 0x00000305
OpLTEU = OpIsLessThanOrEqualUnsigned
OpIsLessThanOrEqualSigned = 0x00000306
OpLTES = OpIsLessThanOrEqualSigned
OpIsGreaterThanOrEqualUnsigned = 0x00000307
OpGTEU = OpIsGreaterThanOrEqualUnsigned
OpIsGreaterThanOrEqualSigned = 0x00000308
OpGTES = OpIsGreaterThanOrEqualSigned
OpJump = 0x00000400
OpJmp = OpJump
OpJumpIfTrue = 0x00000401
OpJmpT = OpJumpIfTrue
OpJumpIfFalse = 0x00000402
OpJmpF = OpJumpIfFalse
)