| 8114 | } |
| 8115 | |
| 8116 | U32 getTestLeftRight(struct Op* op, char* left, char* right) { |
| 8117 | U32 same = 0; |
| 8118 | |
| 8119 | if (op->func == testr8r8) { |
| 8120 | strcpy(left, r8(op->r1)); |
| 8121 | strcpy(right, r8(op->r2)); |
| 8122 | if (op->r1 == op->r2) |
| 8123 | same = 1; |
| 8124 | } else if (op->func == teste8r8_16) { |
| 8125 | strcpy(left, "readb(cpu->thread, "); |
| 8126 | strcat(left, getEaa16(op)); |
| 8127 | strcat(left, ")"); |
| 8128 | strcpy(right, r8(op->r1)); |
| 8129 | } else if (op->func == teste8r8_32) { |
| 8130 | strcpy(left, "readb(cpu->thread, "); |
| 8131 | strcat(left, getEaa32(op)); |
| 8132 | strcat(left, ")"); |
| 8133 | strcpy(right, r8(op->r1)); |
| 8134 | } else if (op->func == test8_reg) { |
| 8135 | strcpy(left, r8(op->r1)); |
| 8136 | strcpy(right, "0x"); |
| 8137 | itoa(op->data1 & 0xFF, right+2, 16); |
| 8138 | } else if (op->func == test8_mem16) { |
| 8139 | strcpy(left, "readb(cpu->thread, "); |
| 8140 | strcat(left, getEaa16(op)); |
| 8141 | strcat(left, ")"); |
| 8142 | strcpy(right, "0x"); |
| 8143 | itoa(op->data1 & 0xFF, right+2, 16); |
| 8144 | } else if (op->func == test8_mem32) { |
| 8145 | strcpy(left, "readb(cpu->thread, "); |
| 8146 | strcat(left, getEaa32(op)); |
| 8147 | strcat(left, ")"); |
| 8148 | strcpy(right, "0x"); |
| 8149 | itoa(op->data1 & 0xFF, right+2, 16); |
| 8150 | } else if (op->func == testr16r16) { |
| 8151 | strcpy(left, r16(op->r1)); |
| 8152 | strcpy(right, r16(op->r2)); |
| 8153 | if (op->r1 == op->r2) |
| 8154 | same = 1; |
| 8155 | } else if (op->func == teste16r16_16) { |
| 8156 | strcpy(left, "readw(cpu->thread, "); |
| 8157 | strcat(left, getEaa16(op)); |
| 8158 | strcat(left, ")"); |
| 8159 | strcpy(right, r16(op->r1)); |
| 8160 | } else if (op->func == teste16r16_32) { |
| 8161 | strcpy(left, "readw(cpu->thread, "); |
| 8162 | strcat(left, getEaa32(op)); |
| 8163 | strcat(left, ")"); |
| 8164 | strcpy(right, r16(op->r1)); |
| 8165 | } else if (op->func == test16_reg) { |
| 8166 | strcpy(left, r16(op->r1)); |
| 8167 | strcpy(right, "0x"); |
| 8168 | itoa(op->data1 & 0xFFFF, right+2, 16); |
| 8169 | } else if (op->func == test16_mem16) { |
| 8170 | strcpy(left, "readw(cpu->thread, "); |
| 8171 | strcat(left, getEaa16(op)); |
| 8172 | strcat(left, ")"); |
| 8173 | strcpy(right, "0x"); |