trunk/src/emu/cpu/i8085/i8085cpu.h
| r18531 | r18532 | |
| 68 | 68 | |
| 69 | 69 | /* increase / decrease */ |
| 70 | 70 | #define M_INR(R) {UINT8 hc = ((R & 0x0f) == 0x0f) ? HF : 0; ++R; cpustate->AF.b.l= (cpustate->AF.b.l & CF ) | ZSP[R] | hc; } |
| 71 | | #define M_DCR(R) {UINT8 hc = ((R & 0x0f) == 0x00) ? HF : 0; --R; cpustate->AF.b.l= (cpustate->AF.b.l & CF ) | ZSP[R] | hc | VF; } |
| 71 | #define M_DCR(R) {UINT8 hc = ((R & 0x0f) != 0x00) ? HF : 0; --R; cpustate->AF.b.l= (cpustate->AF.b.l & CF ) | ZSP[R] | hc | VF; } |
| 72 | 72 | |
| 73 | 73 | /* arithmetic */ |
| 74 | 74 | #define M_ADD(R) { \ |
| r18531 | r18532 | |
| 100 | 100 | cpustate->AF.b.l=ZSP[q&255]|((q>>8)&CF)|((cpustate->AF.b.h^q^R)&HF)|VF; \ |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | | #define M_DAD(R) { \ |
| 104 | | int q = cpustate->HL.d + cpustate->R.d; \ |
| 105 | | cpustate->AF.b.l = ( cpustate->AF.b.l & ~(HF+CF) ) | \ |
| 106 | | ( ((cpustate->HL.d^q^cpustate->R.d) >> 8) & HF ) | \ |
| 107 | | ( (q>>16) & CF ); \ |
| 103 | #define M_DAD(R) { \ |
| 104 | int q = cpustate->HL.d + cpustate->R.d; \ |
| 105 | cpustate->AF.b.l = (cpustate->AF.b.l & ~CF) | (q>>16 & CF ); \ |
| 108 | 106 | cpustate->HL.w.l = q; \ |
| 109 | 107 | } |
| 110 | 108 | |