package
0.0.0-20230405025934-acc62890dc3b
Repository: https://github.com/coolcoder613eb/go.vm.git
Documentation: pkg.go.dev

# Functions

NewOpcode creates a new Opcode.

# Variables

ADD_OP performs an ADD operation against two registers.
AND_OP performs a logical AND operation against two registers.
CMP_IMMEDIATE compares a register contents with a number.
CMP_REG compares two registers.
CMP_STRING compares a register contents with a string.
DEC_OP decrements the given register by one.
DIV_OP performs a DIVIDE operation against two registers.
EXIT is our first opcode.
INC_OP increments the given register by one.
INT_PRINT is used to print the integer contents of a register.
INT_RANDOM generates a random number.
INT_STORE allows an integer to be stored in a register.
INT_TOSTRING converts an integer-register value to a string.
IS_INTEGER tests if a register contains an integer.
IS_MORE_REG compares reg1 > reg2.
IS_STRING tests if a register contains a string.
JUMP_NZ jumps if the Z-flag is NOT set.
JUMP_TO is an unconditional jump.
JUMP_Z jumps if the Z-flag is set.
MEMCPY copies a region of RAM.
MUL_OP performs a MULTIPLY operation against two registers.
NOP_OP does nothing.
OR_OP performs a logical OR operation against two registers.
PEEK reads from memory.
POKE sets an address-content.
REG_STORE stores the contents of one register in another.
STACK_CALL calls a subroutine.
STACK_POP retrieves a value from the stack.
STACK_PUSH pushes the given register-contents onto the stack.
STACK_RET returns from a CALL.
STRING_CONCAT joins two strings.
STRING_PRINT prints the string contents of a register.
STRING_STORE stores a string in a register.
STRING_SYSTEM executes the system binary stored in the given string-register.
STRING_TOINT converts the given string-register contents to an int.
SUB_OP performs an MINUS operation against two registers.
TRAP_OP invokes a CPU trap.
XOR_OP performs an XOR operation against two registers.

# Structs

Opcode is a holder for a single instruction.