less hacky way to get the addr mode
This commit is contained in:
@@ -1645,15 +1645,27 @@ static void PutBitBranch_m740 (const InsDesc* Ins)
|
|||||||
/* Evaluate the addressing mode used */
|
/* Evaluate the addressing mode used */
|
||||||
GetEA(&A);
|
GetEA(&A);
|
||||||
|
|
||||||
A.AddrMode = 2; /* HACK */
|
/* From the possible addressing modes, remove the ones that are invalid
|
||||||
|
** for this instruction or CPU.
|
||||||
|
*/
|
||||||
|
A.AddrModeSet &= Ins->AddrMode;
|
||||||
|
|
||||||
|
/* Check if we have any adressing modes left */
|
||||||
|
if (A.AddrModeSet == 0) {
|
||||||
|
Error ("Illegal addressing mode");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
A.AddrMode = BitFind (A.AddrModeSet);
|
||||||
|
|
||||||
A.Opcode = Ins->BaseCode;
|
A.Opcode = Ins->BaseCode;
|
||||||
|
|
||||||
if (A.AddrModeSet == 0x00000002) {
|
if (A.AddrMode == AM65I_ACCU) {
|
||||||
/* Accu */
|
/* Accu */
|
||||||
Emit0 (A.Opcode);
|
Emit0 (A.Opcode);
|
||||||
ConsumeComma ();
|
ConsumeComma ();
|
||||||
EmitSigned (GenBranchExpr (2), 1);
|
EmitSigned (GenBranchExpr (2), 1);
|
||||||
} else if (A.AddrModeSet == 0x10000000) {
|
} else if (A.AddrMode == AM65I_ZP_REL) {
|
||||||
|
/* FIXME: hacky, the comma was already consumed here */
|
||||||
A.Opcode += 0x04;
|
A.Opcode += 0x04;
|
||||||
/* Zeropage */
|
/* Zeropage */
|
||||||
Emit0 (A.Opcode);
|
Emit0 (A.Opcode);
|
||||||
|
|||||||
Reference in New Issue
Block a user