facebook linkedin twitter youtube Arts,Design&VirtualWorlds Mazinger Museum

VXCPU - Simple Virtual CPU Machine


OPCODE Name Operand1 Operand2 Operand3 Istruction
10MOVRReg DestReg SrcLoads the value from regsrc into regdst.
11MOVVReg DestValueLoads the numeric value into register regdst.
20ADDReg DestReg SrcAdds the value from regsrc to the value of regdst and store the result in reg_dst
21SUBReg DestReg SrcSubtracts the value of regsrc from the value of regdst and store the result in reg_dst
30PUSHReg SrcPushes the value of reg_src on the stack
31POPReg DestPops the last value from stack and loads it into register reg_dst
40JPAddressJumps the execution to address addr.
41JLReg1Reg2AddressJump to the address addr only if the value from reg1 < reg2 (IF reg1 < reg2 THEN JP addr)
42CALLAddressPushes onto the stack the address of instruction that follows CALL and then jumps to address addr
50RETPops from the stack the last number, assumes is an address and jump to that address
60PRINTRegPrint on the screen the value contained in the register reg
61PRINTCRegPrint on the screen the char value contained in the register reg
255HALTStop the CPU.The virtual CPU doesn't execute instructions once HALT is encountered.

INSTRUCTION FORMAT: OPCODE,Operand1,Operand2,Operand3,... (following opcodes instructions with comma , text character each other between)

Write below your bytecode and click run to execute.

- Publication VXCPU(09.3.24)
- Updates(28.4.24)

Copyright 2024© All Right Reserved Visitors: 349648 Site Map You visited us:1 times