Pyfwalo Bytecode

My compiler can output bytecode for a stack based virtual machine. These are all the instructions:

Byte Instruction Name Description
0x00NOPDoes nothing
0x01DUPDuplicates the top value and pushes it on the stack
0x02SWAPSwaps the top two values on the stack
0x03IGNOREPops the top value from the stack
0x04ZEROPushes a 0 on the stack
0x05MINUS_ONEPushes a -1 on the stack
0x06ONEPushes a 1 on the stack
0x07CONSTT xPushes tiny constant x on the stack
0x08CONSTS xPushes short constant x on the stack
0x09CONSTL xPushes long constant x on the stack
0x0aCONSTI xPushes int constant x on the stack
0x0bINSTR xPushes instruction address x on the stack
0x0cINSTRF xPushes address of foreign instruction index x on the stack
0x0dDATA xPushes data address x on the stack (relative to data segment)
0x0eLOCAL xPushes local address x on the stack (relative to stack frame)
0x0fGLOBAL xPushes global address x on the stack (relative to global allocation)
0x10GLOBALF xPushes address of foreign global index x on the stack
0x11LOADTPushes tiny at top address on the stack
0x12LOADSPushes short at top address on the stack
0x13LOADLPushes long at top address on the stack
0x14LOADIPushes int at top address on the stack
0x15LOADTLOCAL xPushes tiny at local address x on the stack
0x16LOADSLOCAL xPushes short at local address x on the stack
0x17LOADLLOCAL xPushes long at local address x on the stack
0x18LOADILOCAL xPushes int at local address x on the stack
0x19LOADTGLOBAL xPushes tiny at global address x on the stack
0x1aLOADSGLOBAL xPushes short at global address x on the stack
0x1bLOADLGLOBAL xPushes long at global address x on the stack
0x1cLOADIGLOBAL xPushes int at global address x on the stack
0x1dSTORETStores tiny at top address at second into top address
0x1eSTORESStores short at top address at second into top address
0x1fSTORELStores long at top address at second into top address
0x20STOREIStores int at top address at second into top address
0x21STORETLOCAL xStores tiny from local address x into top address
0x22STORESLOCAL xStores short from local address x into top address
0x23STORELLOCAL xStores long from local address x into top address
0x24STOREILOCAL xStores int from local address x into top address
0x25STORETGLOBAL xStores tiny from global address x into top address
0x26STORESGLOBAL xStores short from global address x into top address
0x27STORELGLOBAL xStores long from global address x into top address
0x28STOREIGLOBAL xStores int from global address x into top address
0x29MOVETMoves tiny at top address into second to top address
0x2aMOVESMoves short at top address into second to top address
0x2bMOVELMoves long at top address into second to top address
0x2cMOVEIMoves int at top address into second to top address
0x2dDROP xReads top pointer and pushes x bytes to stack
0x2eTAKE xPops x bytes from stack and stores at top pointer
0x2fCOPY xCopies x bytes from top pointer to second to top pointer on the stack
0x30CLEAR xClears x bytes at top pointer
0x31SET x ySets x bytes to y at top pointer
0x32JMP xJumps to instruction x
0x33JMPF xJumps to instruction x if top value is 0
0x34JMPT xJumps to instruction x if top value is 1
0x35JMPDJumps to top value
0x36ADDAdds top two values
0x37SUBSubtracts top two values
0x38MULMultiplies
0x39DIVDivides
0x3aMODModulus
0x3bUDIVPerforms unsigned division
0x3cUMODPerforms unsigned modulus
0x3dADDFAdds float values
0x3eADDRAdds real values
0x3fSUBFSubtracts float values
0x40SUBRSubtracts real values
0x41MULFMultiplies float values
0x42MULRMultiplies real values
0x43DIVFDivides float values
0x44DIVRDivides real values
0x45INCIncrements top value
0x46DECDecrements top value
0x47NEGNegates int
0x48NEGFNegates float
0x49NEGRNegates real
0x4aLNOTLogical not
0x4bSIGNTSign extends tiny
0x4cSIGNSSign extends short
0x4dSIGNLSign extends long
0x4eTRUNCTTruncates to tiny
0x4fTRUNCSTruncates to short
0x50TRUNCLTruncates to long
0x51ANDBitwise and
0x52ORBitwise or
0x53XORBitwise xor
0x54NOTBitwise not
0x55LSHLeft shift
0x56RSHRight shift
0x57LTLess than
0x58LTEQLess than or equal
0x59ULTUnsigned less than
0x5aULTEQUnsigned less than or equal
0x5bEQEqual
0x5cNEQNot equal
0x5dEQAEqual (array)
0x5eNEQANot equal (array)
0x5fLTFLess than (float)
0x60LTRLess than (real)
0x61LTEQFLess than or equal (float)
0x62LTEQRLess than or equal (real)
0x63EQFEqual (float)
0x64EQREqual (real)
0x65NEQFNot equal (float)
0x66NEQRNot equal (real)
0x67F2IConverts float to int
0x68I2FConverts int to float
0x69R2IConverts real to int
0x6aI2RConverts int to real
0x6bF2RConverts float to real
0x6cR2FConverts real to float
0x6dCALL xCalls instruction x
0x6eCALLF xCalls foreign instruction index x
0x6fCALLDCalls top value
0x70PUSH xPushes stack frame x bytes
0x71PARAM xPops stack frame x bytes to place x bytes of parameters into stack frame
0x72RETVPops the stack frame and returns the top value
0x73RETB xPops the stack frame and returns x bytes
0x74RETPops the stack frame and returns
0x75HALTHalts program

Arguments of instructions are always 32-bit integers, unless stated otherwise in the description. For example, the CONSTT instruction takes a signed 8-bit integer. Also, all numbers are stored in little-endian format. To get a clearer idea of how this virtual machine works, you can also look at the source code of my simple virtual machine.