CPU->pzR16[0] = pzBC;\r
CPU->pzR16[1] = pzDE;\r
CPU->pzR16[2] = pzHL;\r
- CPU->pzR16[3] = pzAF;\r
+ CPU->pzR16[3] = pzFA;\r
\r
zIX = zIY = 0xffff;\r
\r
{\r
case CZ80_PC: return (CPU->PC - CPU->BasePC);\r
case CZ80_SP: return zSP;\r
- case CZ80_AF: return zAF;\r
+ case CZ80_FA: return zFA;\r
case CZ80_BC: return zBC;\r
case CZ80_DE: return zDE;\r
case CZ80_HL: return zHL;\r
case CZ80_IX: return zIX;\r
case CZ80_IY: return zIY;\r
- case CZ80_AF2: return zAF2;\r
+ case CZ80_FA2: return zFA2;\r
case CZ80_BC2: return zBC2;\r
case CZ80_DE2: return zDE2;\r
case CZ80_HL2: return zHL2;\r
break;\r
\r
case CZ80_SP: zSP = val; break;\r
- case CZ80_AF: zAF = val; break;\r
+ case CZ80_FA: zFA = val; break;\r
case CZ80_BC: zBC = val; break;\r
case CZ80_DE: zDE = val; break;\r
case CZ80_HL: zHL = val; break;\r
case CZ80_IX: zIX = val; break;\r
case CZ80_IY: zIY = val; break;\r
- case CZ80_AF2: zAF2 = val; break;\r
+ case CZ80_FA2: zFA2 = val; break;\r
case CZ80_BC2: zBC2 = val; break;\r
case CZ80_DE2: zDE2 = val; break;\r
case CZ80_HL2: zHL2 = val; break;\r
#define zR8(A) (*CPU->pzR8[A])\r
#define zR16(A) (CPU->pzR16[A]->W)\r
\r
-#define pzAF &(CPU->AF)\r
-#define zAF CPU->AF.W\r
-#define zlAF CPU->AF.B.L\r
-#define zhAF CPU->AF.B.H\r
-#define zA zhAF\r
-#define zF zlAF\r
+#define pzFA &(CPU->FA)\r
+#define zFA CPU->FA.W\r
+#define zlFA CPU->FA.B.L\r
+#define zhFA CPU->FA.B.H\r
+#define zA zlFA\r
+#define zF zhFA\r
\r
#define pzBC &(CPU->BC)\r
#define zBC CPU->BC.W\r
#define zH zhHL\r
#define zL zlHL\r
\r
-#define zAF2 CPU->AF2.W\r
-#define zlAF2 CPU->AF2.B.L\r
-#define zhAF2 CPU->AF2.B.H\r
-#define zA2 zhAF2\r
-#define zF2 zlAF2\r
+#define zFA2 CPU->FA2.W\r
+#define zlFA2 CPU->FA2.B.L\r
+#define zhFA2 CPU->FA2.B.H\r
+#define zA2 zhFA2\r
+#define zF2 zlFA2\r
\r
#define zBC2 CPU->BC2.W\r
#define zDE2 CPU->DE2.W\r
{\r
CZ80_PC = 1,\r
CZ80_SP,\r
- CZ80_AF,\r
+ CZ80_FA,\r
CZ80_BC,\r
CZ80_DE,\r
CZ80_HL,\r
CZ80_IX,\r
CZ80_IY,\r
- CZ80_AF2,\r
+ CZ80_FA2,\r
CZ80_BC2,\r
CZ80_DE2,\r
CZ80_HL2,\r
union16 BC;\r
union16 DE;\r
union16 HL;\r
- union16 AF;\r
+ union16 FA;\r
};\r
};\r
\r
union16 BC2;\r
union16 DE2;\r
union16 HL2;\r
- union16 AF2;\r
+ union16 FA2;\r
\r
union16 R;\r
union16 IFF;\r
POP\r
-----------------------------------------*/\r
\r
+ OP(0xf1): // POP AF\r
+OP_POP_AF:\r
+ POP_16(res)\r
+ zA = res >> 8;\r
+ zF = res & 0xFF;\r
+ RET(10)\r
+\r
OP(0xc1): // POP BC\r
OP(0xd1): // POP DE\r
- OP(0xf1): // POP AF\r
OP_POP_RR:\r
data = CPU->pzR16[(Opcode >> 4) & 3];\r
\r
PUSH\r
-----------------------------------------*/\r
\r
+ OP(0xf5): // PUSH AF\r
+OP_PUSH_AF:\r
+ PUSH_16((zA << 8) | zF);\r
+ RET(11)\r
+\r
+\r
OP(0xc5): // PUSH BC\r
OP(0xd5): // PUSH DE\r
- OP(0xf5): // PUSH AF\r
OP_PUSH_RR:\r
data = CPU->pzR16[(Opcode >> 4) & 3];\r
\r
\r
OP(0x08): // EX AF,AF'\r
OP_EX_AF_AF2:\r
- res = zAF;\r
- zAF = zAF2;\r
- zAF2 = res;\r
+ res = zFA;\r
+ zFA = zFA2;\r
+ zFA2 = res;\r
RET(4)\r
\r
OP(0xeb): // EX DE,HL\r