You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In CPUOpcodes.h, I found there are opcodes and respective hex number in enum OperationImplied, but other enums like Operation1, Operation2..., there are only opcodes defined, no hex number at all. So I am wondering why we can still use opcodes(should be a hex number) in 'Switch-Case' to match the codes in these enum?
Say enum Operation1
{
ORA, /* there's no hex like ORA = E9 defined ?*/
AND,
EOR,
ADC,
STA,
LDA,
CMP,
SBC,
};
In CPU.cc:
switch (op){
case ORA:
// do some stuff
break;
}
The text was updated successfully, but these errors were encountered:
In the opcode, operation is represented by the highest 3 bits. Thus if you mask the opcode by 11100000b (0xE0) and shift by 5, you get the operation which is a number from 0 to 7. The enum value is just this number.
Hi,
In CPUOpcodes.h, I found there are opcodes and respective hex number in enum OperationImplied, but other enums like Operation1, Operation2..., there are only opcodes defined, no hex number at all. So I am wondering why we can still use opcodes(should be a hex number) in 'Switch-Case' to match the codes in these enum?
Say enum Operation1
{
ORA, /* there's no hex like ORA = E9 defined ?*/
AND,
EOR,
ADC,
STA,
LDA,
CMP,
SBC,
};
In CPU.cc:
switch (op){
case ORA:
// do some stuff
break;
}
The text was updated successfully, but these errors were encountered: