mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-23 15:29:24 +00:00
Add CWAI command to the 6809
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
b4abd7c739
commit
0882513762
@ -184,6 +184,7 @@ namespace EightBit {
|
||||
void cmp(uint8_t operand, uint8_t data);
|
||||
void cmp(register16_t operand, register16_t data);
|
||||
uint8_t com(uint8_t operand);
|
||||
void cwai(uint8_t data);
|
||||
uint8_t neg(uint8_t operand);
|
||||
|
||||
register16_t m_d;
|
||||
|
@ -155,6 +155,9 @@ int EightBit::mc6809::executeUnprefixed(uint8_t opcode) {
|
||||
case 0x63: addCycles(6); BUS().write(com(AM_indexed_byte())); break; // COM (COM indexed)
|
||||
case 0x73: addCycles(7); BUS().write(com(AM_extended_byte())); break; // COM (COM extended)
|
||||
|
||||
// CWAI
|
||||
case 0x3c: addCycles(20); cwai(AM_direct_byte()); break; // CWAI (CWAI direct)
|
||||
|
||||
default:
|
||||
UNREACHABLE;
|
||||
}
|
||||
@ -449,3 +452,16 @@ uint8_t EightBit::mc6809::com(uint8_t operand) {
|
||||
setFlag(CC(), CF);
|
||||
return result;
|
||||
}
|
||||
|
||||
void EightBit::mc6809::cwai(uint8_t data) {
|
||||
CC() &= data;
|
||||
pushWord(PC());
|
||||
pushWord(U());
|
||||
pushWord(Y());
|
||||
pushWord(X());
|
||||
push(DP());
|
||||
push(B());
|
||||
push(A());
|
||||
push(CC());
|
||||
halt();
|
||||
}
|
Loading…
Reference in New Issue
Block a user