To add new cpu opcodes we need only to change two files: simulate.H and simulate.C
So we have to proceed with these steps:
(1) modify the file simulate.H
Go to the bottom of this file under the comment //New Opcodes and add your new opcode ABC as last and before the end_ops constant.
For example:
//New Opcodes
MDIV , // MDIV R, 10, M : (S>D) -- Calc Modulus and Division putting them into destination Registers
STX , // STX 0xFF , M : (S>D) -- Store immed. value into contents of [MemoryAddress] pointed by Register
+ ABC , // short description
(2) modify the file simulate.C
Go at line 325 of this file under the comment //New Opcodes and add your macro that represent the opcode ABC
For example:
define ABC_opcode _cpuREG( cpuIMM_ARG(1) ) = cpuIMM_ARG(2); \
currPC_add( x )
Go at line 482 of this file under the comment //New Opcodes and add your macro that represent the opcode ABC
For example:
__def_opcall( ABC );
Anonymous