src/emu/cpu/z8000/z8000ops.c
| r15120 | r15121 | |
| 33 | 33 | { |
| 34 | 34 | if (fcw & F_S_N) { /* system mode now? */ |
| 35 | 35 | if (!(cpustate->fcw & F_S_N)) { /* and not before? */ |
| 36 | | UINT16 tmp = cpustate->RW(SP); |
| 37 | | cpustate->RW(SP) = cpustate->nsp; |
| 38 | | cpustate->nsp = tmp; |
| 36 | if (cpustate->device->type() == Z8001) { |
| 37 | UINT16 tmp = cpustate->RW(15); |
| 38 | cpustate->RW(15) = cpustate->nspoff; |
| 39 | cpustate->nspoff = tmp; |
| 40 | tmp = cpustate->RW(14); |
| 41 | cpustate->RW(14) = cpustate->nspseg; |
| 42 | cpustate->nspseg = tmp; |
| 43 | } |
| 44 | else { |
| 45 | UINT16 tmp = cpustate->RW(SP); |
| 46 | cpustate->RW(SP) = cpustate->nspoff; |
| 47 | cpustate->nspoff = tmp; |
| 48 | } |
| 39 | 49 | } |
| 40 | 50 | } else { /* user mode now */ |
| 41 | 51 | if (cpustate->fcw & F_S_N) { /* and not before? */ |
| 42 | | UINT16 tmp = cpustate->RW(SP); |
| 43 | | cpustate->RW(SP) = cpustate->nsp; |
| 44 | | cpustate->nsp = tmp; |
| 52 | if (cpustate->device->type() == Z8001) { |
| 53 | UINT16 tmp = cpustate->RW(15); |
| 54 | cpustate->RW(15) = cpustate->nspoff; |
| 55 | cpustate->nspoff = tmp; |
| 56 | tmp = cpustate->RW(14); |
| 57 | cpustate->RW(14) = cpustate->nspseg; |
| 58 | cpustate->nspseg = tmp; |
| 59 | } |
| 60 | else { |
| 61 | UINT16 tmp = cpustate->RW(SP); |
| 62 | cpustate->RW(SP) = cpustate->nspoff; |
| 63 | cpustate->nspoff = tmp; |
| 64 | } |
| 45 | 65 | } |
| 46 | 66 | } |
| 47 | 67 | if (!(cpustate->fcw & F_NVIE) && (fcw & F_NVIE) && (cpustate->irq_state[0] != CLEAR_LINE)) |
| r15120 | r15121 | |
| 51 | 71 | cpustate->fcw = fcw; /* set new cpustate->fcw */ |
| 52 | 72 | } |
| 53 | 73 | |
| 74 | INLINE UINT32 make_segmented_addr(UINT32 addr) |
| 75 | { |
| 76 | return ((addr & 0xffff0000) << 8) | (addr & 0xffff); |
| 77 | } |
| 78 | |
| 79 | INLINE UINT32 segmented_addr(UINT32 addr) |
| 80 | { |
| 81 | return ((addr & 0x7f000000) >> 8) | (addr & 0xffff); |
| 82 | } |
| 83 | |
| 84 | INLINE UINT32 addr_from_reg(z8000_state *cpustate, int regno) |
| 85 | { |
| 86 | if (segmented_mode(cpustate)) |
| 87 | return segmented_addr(cpustate->RL(regno)); |
| 88 | else |
| 89 | return cpustate->RW(regno); |
| 90 | } |
| 91 | |
| 92 | INLINE void addr_to_reg(z8000_state *cpustate, int regno, UINT32 addr) |
| 93 | { |
| 94 | if (segmented_mode(cpustate)) |
| 95 | cpustate->RL(regno) = /*(cpustate->RL(regno) & 0x00ff0000) |*/ make_segmented_addr(addr); |
| 96 | else |
| 97 | cpustate->RW(regno) = addr; |
| 98 | } |
| 99 | |
| 54 | 100 | INLINE void PUSHW(z8000_state *cpustate, UINT8 dst, UINT16 value) |
| 55 | 101 | { |
| 56 | | cpustate->RW(dst) -= 2; |
| 57 | | WRMEM_W(cpustate, cpustate->RW(dst), value); |
| 102 | if (segmented_mode(cpustate)) |
| 103 | cpustate->RW(dst | 1) -= 2; |
| 104 | else |
| 105 | cpustate->RW(dst) -= 2; |
| 106 | WRMEM_W(cpustate, addr_from_reg(cpustate, dst), value); |
| 58 | 107 | } |
| 59 | 108 | |
| 60 | 109 | INLINE UINT16 POPW(z8000_state *cpustate, UINT8 src) |
| 61 | 110 | { |
| 62 | | UINT16 result = RDMEM_W(cpustate, cpustate->RW(src)); |
| 63 | | cpustate->RW(src) += 2; |
| 111 | UINT16 result = RDMEM_W(cpustate, addr_from_reg(cpustate, src)); |
| 112 | if (segmented_mode(cpustate)) |
| 113 | cpustate->RW(src | 1) += 2; |
| 114 | else |
| 115 | cpustate->RW(src) += 2; |
| 64 | 116 | return result; |
| 65 | 117 | } |
| 66 | 118 | |
| 67 | 119 | INLINE void PUSHL(z8000_state *cpustate, UINT8 dst, UINT32 value) |
| 68 | 120 | { |
| 69 | | cpustate->RW(dst) -= 4; |
| 70 | | WRMEM_L(cpustate, cpustate->RW(dst), value); |
| 121 | if (segmented_mode(cpustate)) |
| 122 | cpustate->RW(dst | 1) -= 4; |
| 123 | else |
| 124 | cpustate->RW(dst) -= 4; |
| 125 | WRMEM_L(cpustate, addr_from_reg(cpustate, dst), value); |
| 71 | 126 | } |
| 72 | 127 | |
| 73 | 128 | INLINE UINT32 POPL(z8000_state *cpustate, UINT8 src) |
| 74 | 129 | { |
| 75 | | UINT32 result = RDMEM_L(cpustate, cpustate->RW(src)); |
| 76 | | cpustate->RW(src) += 4; |
| 130 | UINT32 result = RDMEM_L(cpustate, addr_from_reg(cpustate, src)); |
| 131 | if (segmented_mode(cpustate)) |
| 132 | cpustate->RW(src | 1) += 4; |
| 133 | else |
| 134 | cpustate->RW(src) += 4; |
| 77 | 135 | return result; |
| 78 | 136 | } |
| 79 | 137 | |
| r15120 | r15121 | |
| 1121 | 1179 | { |
| 1122 | 1180 | GET_DST(OP0,NIB3); |
| 1123 | 1181 | GET_SRC(OP0,NIB2); |
| 1124 | | cpustate->RB(dst) = ADDB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, cpustate->RW(src))); |
| 1182 | cpustate->RB(dst) = ADDB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 1125 | 1183 | } |
| 1126 | 1184 | |
| 1127 | 1185 | /****************************************** |
| r15120 | r15121 | |
| 1143 | 1201 | { |
| 1144 | 1202 | GET_DST(OP0,NIB3); |
| 1145 | 1203 | GET_SRC(OP0,NIB2); |
| 1146 | | cpustate->RW(dst) = ADDW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 1204 | cpustate->RW(dst) = ADDW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 1147 | 1205 | } |
| 1148 | 1206 | |
| 1149 | 1207 | /****************************************** |
| r15120 | r15121 | |
| 1165 | 1223 | { |
| 1166 | 1224 | GET_DST(OP0,NIB3); |
| 1167 | 1225 | GET_SRC(OP0,NIB2); |
| 1168 | | cpustate->RB(dst) = SUBB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, cpustate->RW(src))); /* EHC */ |
| 1226 | cpustate->RB(dst) = SUBB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); /* EHC */ |
| 1169 | 1227 | } |
| 1170 | 1228 | |
| 1171 | 1229 | /****************************************** |
| r15120 | r15121 | |
| 1187 | 1245 | { |
| 1188 | 1246 | GET_DST(OP0,NIB3); |
| 1189 | 1247 | GET_SRC(OP0,NIB2); |
| 1190 | | cpustate->RW(dst) = SUBW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 1248 | cpustate->RW(dst) = SUBW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 1191 | 1249 | } |
| 1192 | 1250 | |
| 1193 | 1251 | /****************************************** |
| r15120 | r15121 | |
| 1209 | 1267 | { |
| 1210 | 1268 | GET_DST(OP0,NIB3); |
| 1211 | 1269 | GET_SRC(OP0,NIB2); |
| 1212 | | cpustate->RB(dst) = ORB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, cpustate->RW(src))); |
| 1270 | cpustate->RB(dst) = ORB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 1213 | 1271 | } |
| 1214 | 1272 | |
| 1215 | 1273 | /****************************************** |
| r15120 | r15121 | |
| 1231 | 1289 | { |
| 1232 | 1290 | GET_DST(OP0,NIB3); |
| 1233 | 1291 | GET_SRC(OP0,NIB2); |
| 1234 | | cpustate->RW(dst) = ORW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 1292 | cpustate->RW(dst) = ORW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 1235 | 1293 | } |
| 1236 | 1294 | |
| 1237 | 1295 | /****************************************** |
| r15120 | r15121 | |
| 1253 | 1311 | { |
| 1254 | 1312 | GET_DST(OP0,NIB3); |
| 1255 | 1313 | GET_SRC(OP0,NIB2); |
| 1256 | | cpustate->RB(dst) = ANDB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, cpustate->RW(src))); |
| 1314 | cpustate->RB(dst) = ANDB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 1257 | 1315 | } |
| 1258 | 1316 | |
| 1259 | 1317 | /****************************************** |
| r15120 | r15121 | |
| 1275 | 1333 | { |
| 1276 | 1334 | GET_DST(OP0,NIB3); |
| 1277 | 1335 | GET_SRC(OP0,NIB2); |
| 1278 | | cpustate->RW(dst) = ANDW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 1336 | cpustate->RW(dst) = ANDW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 1279 | 1337 | } |
| 1280 | 1338 | |
| 1281 | 1339 | /****************************************** |
| r15120 | r15121 | |
| 1297 | 1355 | { |
| 1298 | 1356 | GET_DST(OP0,NIB3); |
| 1299 | 1357 | GET_SRC(OP0,NIB2); |
| 1300 | | cpustate->RB(dst) = XORB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, cpustate->RW(src))); |
| 1358 | cpustate->RB(dst) = XORB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 1301 | 1359 | } |
| 1302 | 1360 | |
| 1303 | 1361 | /****************************************** |
| r15120 | r15121 | |
| 1319 | 1377 | { |
| 1320 | 1378 | GET_DST(OP0,NIB3); |
| 1321 | 1379 | GET_SRC(OP0,NIB2); |
| 1322 | | cpustate->RW(dst) = XORW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 1380 | cpustate->RW(dst) = XORW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 1323 | 1381 | } |
| 1324 | 1382 | |
| 1325 | 1383 | /****************************************** |
| r15120 | r15121 | |
| 1341 | 1399 | { |
| 1342 | 1400 | GET_DST(OP0,NIB3); |
| 1343 | 1401 | GET_SRC(OP0,NIB2); |
| 1344 | | CPB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, cpustate->RW(src))); |
| 1402 | CPB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 1345 | 1403 | } |
| 1346 | 1404 | |
| 1347 | 1405 | /****************************************** |
| r15120 | r15121 | |
| 1363 | 1421 | { |
| 1364 | 1422 | GET_DST(OP0,NIB3); |
| 1365 | 1423 | GET_SRC(OP0,NIB2); |
| 1366 | | CPW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 1424 | CPW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr_from_reg(cpustate,src))); |
| 1367 | 1425 | } |
| 1368 | 1426 | |
| 1369 | 1427 | /****************************************** |
| r15120 | r15121 | |
| 1373 | 1431 | static void Z0C_ddN0_0000(z8000_state *cpustate) |
| 1374 | 1432 | { |
| 1375 | 1433 | GET_DST(OP0,NIB3); |
| 1376 | | WRMEM_B(cpustate, cpustate->RW(dst), COMB(cpustate, RDMEM_B(cpustate, cpustate->RW(dst)))); |
| 1434 | WRMEM_B(cpustate, cpustate->RW(dst), COMB(cpustate, RDMEM_B(cpustate, addr_from_reg(cpustate, dst)))); |
| 1377 | 1435 | } |
| 1378 | 1436 | |
| 1379 | 1437 | /****************************************** |
| r15120 | r15121 | |
| 1384 | 1442 | { |
| 1385 | 1443 | GET_DST(OP0,NIB2); |
| 1386 | 1444 | GET_IMM8(OP1); |
| 1387 | | CPB(cpustate, cpustate->RB(dst), imm8); |
| 1445 | CPB(cpustate, RDMEM_B(cpustate, addr_from_reg(cpustate, dst)), imm8); // @@@done |
| 1388 | 1446 | } |
| 1389 | 1447 | |
| 1390 | 1448 | /****************************************** |
| r15120 | r15121 | |
| 1394 | 1452 | static void Z0C_ddN0_0010(z8000_state *cpustate) |
| 1395 | 1453 | { |
| 1396 | 1454 | GET_DST(OP0,NIB2); |
| 1397 | | WRMEM_B(cpustate, cpustate->RW(dst), NEGB(cpustate, RDMEM_B(cpustate, cpustate->RW(dst)))); |
| 1455 | UINT32 addr = addr_from_reg(cpustate, dst); |
| 1456 | WRMEM_B(cpustate, addr, NEGB(cpustate, RDMEM_B(cpustate, addr))); |
| 1398 | 1457 | } |
| 1399 | 1458 | |
| 1400 | 1459 | /****************************************** |
| r15120 | r15121 | |
| 1404 | 1463 | static void Z0C_ddN0_0100(z8000_state *cpustate) |
| 1405 | 1464 | { |
| 1406 | 1465 | GET_DST(OP0,NIB2); |
| 1407 | | TESTB(cpustate, RDMEM_B(cpustate, cpustate->RW(dst))); |
| 1466 | TESTB(cpustate, RDMEM_B(cpustate, addr_from_reg(cpustate, dst))); |
| 1408 | 1467 | } |
| 1409 | 1468 | |
| 1410 | 1469 | /****************************************** |
| r15120 | r15121 | |
| 1415 | 1474 | { |
| 1416 | 1475 | GET_DST(OP0,NIB2); |
| 1417 | 1476 | GET_IMM8(OP1); |
| 1418 | | WRMEM_B(cpustate, cpustate->RW(dst), imm8); |
| 1477 | WRMEM_B(cpustate, addr_from_reg(cpustate, dst), imm8); |
| 1419 | 1478 | } |
| 1420 | 1479 | |
| 1421 | 1480 | /****************************************** |
| r15120 | r15121 | |
| 1425 | 1484 | static void Z0C_ddN0_0110(z8000_state *cpustate) |
| 1426 | 1485 | { |
| 1427 | 1486 | GET_DST(OP0,NIB2); |
| 1428 | | if (RDMEM_B(cpustate, cpustate->RW(dst)) & S08) SET_S; else CLR_S; |
| 1429 | | WRMEM_B(cpustate, cpustate->RW(dst), 0xff); |
| 1487 | UINT32 addr = addr_from_reg(cpustate, dst); |
| 1488 | if (RDMEM_B(cpustate, addr) & S08) SET_S; else CLR_S; |
| 1489 | WRMEM_B(cpustate, addr, 0xff); |
| 1430 | 1490 | } |
| 1431 | 1491 | |
| 1432 | 1492 | /****************************************** |
| r15120 | r15121 | |
| 1436 | 1496 | static void Z0C_ddN0_1000(z8000_state *cpustate) |
| 1437 | 1497 | { |
| 1438 | 1498 | GET_DST(OP0,NIB2); |
| 1439 | | WRMEM_B(cpustate, cpustate->RW(dst), 0); |
| 1499 | WRMEM_B(cpustate, addr_from_reg(cpustate, dst), 0); |
| 1440 | 1500 | } |
| 1441 | 1501 | |
| 1442 | 1502 | /****************************************** |
| r15120 | r15121 | |
| 1446 | 1506 | static void Z0D_ddN0_0000(z8000_state *cpustate) |
| 1447 | 1507 | { |
| 1448 | 1508 | GET_DST(OP0,NIB2); |
| 1449 | | WRMEM_W(cpustate, cpustate->RW(dst), COMW(cpustate, RDMEM_W(cpustate, cpustate->RW(dst)))); |
| 1509 | UINT32 addr = addr_from_reg(cpustate, dst); |
| 1510 | WRMEM_W(cpustate, addr, COMW(cpustate, RDMEM_W(cpustate, addr))); |
| 1450 | 1511 | } |
| 1451 | 1512 | |
| 1452 | 1513 | /****************************************** |
| r15120 | r15121 | |
| 1457 | 1518 | { |
| 1458 | 1519 | GET_DST(OP0,NIB2); |
| 1459 | 1520 | GET_IMM16(OP1); |
| 1460 | | CPW(cpustate, RDMEM_W(cpustate, cpustate->RW(dst)), imm16); |
| 1521 | CPW(cpustate, RDMEM_W(cpustate, addr_from_reg(cpustate, dst)), imm16); |
| 1461 | 1522 | } |
| 1462 | 1523 | |
| 1463 | 1524 | /****************************************** |
| r15120 | r15121 | |
| 1467 | 1528 | static void Z0D_ddN0_0010(z8000_state *cpustate) |
| 1468 | 1529 | { |
| 1469 | 1530 | GET_DST(OP0,NIB2); |
| 1470 | | WRMEM_W(cpustate, cpustate->RW(dst), NEGW(cpustate, RDMEM_W(cpustate, cpustate->RW(dst)))); |
| 1531 | UINT32 addr = addr_from_reg(cpustate, dst); |
| 1532 | WRMEM_W(cpustate, addr, NEGW(cpustate, RDMEM_W(cpustate, addr))); |
| 1471 | 1533 | } |
| 1472 | 1534 | |
| 1473 | 1535 | /****************************************** |
| r15120 | r15121 | |
| 1477 | 1539 | static void Z0D_ddN0_0100(z8000_state *cpustate) |
| 1478 | 1540 | { |
| 1479 | 1541 | GET_DST(OP0,NIB2); |
| 1480 | | TESTW(cpustate, RDMEM_W(cpustate, cpustate->RW(dst))); |
| 1542 | TESTW(cpustate, RDMEM_W(cpustate, addr_from_reg(cpustate, dst))); |
| 1481 | 1543 | } |
| 1482 | 1544 | |
| 1483 | 1545 | /****************************************** |
| r15120 | r15121 | |
| 1488 | 1550 | { |
| 1489 | 1551 | GET_DST(OP0,NIB2); |
| 1490 | 1552 | GET_IMM16(OP1); |
| 1491 | | WRMEM_W(cpustate, cpustate->RW(dst), imm16); |
| 1553 | WRMEM_W(cpustate, addr_from_reg(cpustate, dst), imm16); |
| 1492 | 1554 | } |
| 1493 | 1555 | |
| 1494 | 1556 | /****************************************** |
| r15120 | r15121 | |
| 1498 | 1560 | static void Z0D_ddN0_0110(z8000_state *cpustate) |
| 1499 | 1561 | { |
| 1500 | 1562 | GET_DST(OP0,NIB2); |
| 1501 | | if (RDMEM_W(cpustate, cpustate->RW(dst)) & S16) SET_S; else CLR_S; |
| 1502 | | WRMEM_W(cpustate, cpustate->RW(dst), 0xffff); |
| 1563 | UINT32 addr = addr_from_reg(cpustate, dst); |
| 1564 | if (RDMEM_W(cpustate, addr) & S16) SET_S; else CLR_S; |
| 1565 | WRMEM_W(cpustate, addr, 0xffff); |
| 1503 | 1566 | } |
| 1504 | 1567 | |
| 1505 | 1568 | /****************************************** |
| r15120 | r15121 | |
| 1509 | 1572 | static void Z0D_ddN0_1000(z8000_state *cpustate) |
| 1510 | 1573 | { |
| 1511 | 1574 | GET_DST(OP0,NIB2); |
| 1512 | | WRMEM_W(cpustate, RDMEM_W(cpustate, cpustate->RW(dst)), 0); |
| 1575 | WRMEM_W(cpustate, addr_from_reg(cpustate, dst), 0); |
| 1513 | 1576 | } |
| 1514 | 1577 | |
| 1515 | 1578 | /****************************************** |
| r15120 | r15121 | |
| 1570 | 1633 | { |
| 1571 | 1634 | GET_DST(OP0,NIB3); |
| 1572 | 1635 | GET_SRC(OP0,NIB2); |
| 1573 | | CPL(cpustate, cpustate->RL(dst), RDMEM_L(cpustate, cpustate->RW(src))); |
| 1636 | CPL(cpustate, cpustate->RL(dst), RDMEM_L(cpustate, addr_from_reg(cpustate, src))); |
| 1574 | 1637 | } |
| 1575 | 1638 | |
| 1576 | 1639 | /****************************************** |
| r15120 | r15121 | |
| 1581 | 1644 | { |
| 1582 | 1645 | GET_SRC(OP0,NIB3); |
| 1583 | 1646 | GET_DST(OP0,NIB2); |
| 1584 | | PUSHL(cpustate, dst, RDMEM_L(cpustate, cpustate->RW(src))); |
| 1647 | PUSHL(cpustate, dst, RDMEM_L(cpustate, addr_from_reg(cpustate, src))); |
| 1585 | 1648 | } |
| 1586 | 1649 | |
| 1587 | 1650 | /****************************************** |
| r15120 | r15121 | |
| 1603 | 1666 | { |
| 1604 | 1667 | GET_DST(OP0,NIB3); |
| 1605 | 1668 | GET_SRC(OP0,NIB2); |
| 1606 | | cpustate->RL(dst) = SUBL(cpustate, cpustate->RL(dst), RDMEM_L(cpustate, cpustate->RW(src))); |
| 1669 | cpustate->RL(dst) = SUBL(cpustate, cpustate->RL(dst), RDMEM_L(cpustate, addr_from_reg(cpustate, src))); |
| 1607 | 1670 | } |
| 1608 | 1671 | |
| 1609 | 1672 | /****************************************** |
| r15120 | r15121 | |
| 1614 | 1677 | { |
| 1615 | 1678 | GET_SRC(OP0,NIB3); |
| 1616 | 1679 | GET_DST(OP0,NIB2); |
| 1617 | | PUSHW(cpustate, dst, RDMEM_W(cpustate, cpustate->RW(src))); |
| 1680 | PUSHW(cpustate, dst, RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 1618 | 1681 | } |
| 1619 | 1682 | |
| 1620 | 1683 | /****************************************** |
| r15120 | r15121 | |
| 1636 | 1699 | { |
| 1637 | 1700 | GET_DST(OP0,NIB3); |
| 1638 | 1701 | GET_SRC(OP0,NIB2); |
| 1639 | | cpustate->RL(dst) = RDMEM_L(cpustate, cpustate->RW(src)); |
| 1702 | cpustate->RL(dst) = RDMEM_L(cpustate, addr_from_reg(cpustate, src)); |
| 1640 | 1703 | } |
| 1641 | 1704 | |
| 1642 | 1705 | /****************************************** |
| r15120 | r15121 | |
| 1669 | 1732 | { |
| 1670 | 1733 | GET_DST(OP0,NIB3); |
| 1671 | 1734 | GET_SRC(OP0,NIB2); |
| 1672 | | cpustate->RL(dst) = ADDL(cpustate, cpustate->RL(dst), RDMEM_L(cpustate, cpustate->RW(src))); |
| 1735 | cpustate->RL(dst) = ADDL(cpustate, cpustate->RL(dst), RDMEM_L(cpustate, addr_from_reg(cpustate, src))); |
| 1673 | 1736 | } |
| 1674 | 1737 | |
| 1675 | 1738 | /****************************************** |
| r15120 | r15121 | |
| 1684 | 1747 | } |
| 1685 | 1748 | |
| 1686 | 1749 | /****************************************** |
| 1750 | multl rqd,imm32 |
| 1751 | flags: CZSV-- |
| 1752 | ******************************************/ |
| 1753 | static void Z18_00N0_dddd_imm32(z8000_state *cpustate) |
| 1754 | { |
| 1755 | GET_DST(OP0,NIB3); |
| 1756 | GET_IMM32; |
| 1757 | cpustate->RQ(dst) = MULTL(cpustate, cpustate->RQ(dst), imm32); |
| 1758 | } |
| 1759 | |
| 1760 | /****************************************** |
| 1687 | 1761 | multl rqd,@rs |
| 1688 | 1762 | flags: CZSV-- |
| 1689 | 1763 | ******************************************/ |
| r15120 | r15121 | |
| 1691 | 1765 | { |
| 1692 | 1766 | GET_DST(OP0,NIB3); |
| 1693 | 1767 | GET_SRC(OP0,NIB2); |
| 1694 | | cpustate->RQ(dst) = MULTL(cpustate, cpustate->RQ(dst), cpustate->RL(src)); |
| 1768 | cpustate->RQ(dst) = MULTL(cpustate, cpustate->RQ(dst), cpustate->RL(src)); //@@@ |
| 1695 | 1769 | } |
| 1696 | 1770 | |
| 1697 | 1771 | /****************************************** |
| r15120 | r15121 | |
| 1713 | 1787 | { |
| 1714 | 1788 | GET_DST(OP0,NIB3); |
| 1715 | 1789 | GET_SRC(OP0,NIB2); |
| 1716 | | cpustate->RL(dst) = MULTW(cpustate, cpustate->RL(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 1790 | cpustate->RL(dst) = MULTW(cpustate, cpustate->RL(dst), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 1717 | 1791 | } |
| 1718 | 1792 | |
| 1719 | 1793 | /****************************************** |
| r15120 | r15121 | |
| 1735 | 1809 | { |
| 1736 | 1810 | GET_DST(OP0,NIB3); |
| 1737 | 1811 | GET_SRC(OP0,NIB2); |
| 1738 | | cpustate->RQ(dst) = DIVL(cpustate, cpustate->RQ(dst), RDMEM_L(cpustate, cpustate->RW(src))); |
| 1812 | cpustate->RQ(dst) = DIVL(cpustate, cpustate->RQ(dst), RDMEM_L(cpustate, addr_from_reg(cpustate, src))); |
| 1739 | 1813 | } |
| 1740 | 1814 | |
| 1741 | 1815 | /****************************************** |
| r15120 | r15121 | |
| 1757 | 1831 | { |
| 1758 | 1832 | GET_DST(OP0,NIB3); |
| 1759 | 1833 | GET_SRC(OP0,NIB2); |
| 1760 | | cpustate->RL(dst) = DIVW(cpustate, cpustate->RL(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 1834 | cpustate->RL(dst) = DIVW(cpustate, cpustate->RL(dst), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 1761 | 1835 | } |
| 1762 | 1836 | |
| 1763 | 1837 | /****************************************** |
| r15120 | r15121 | |
| 1767 | 1841 | static void Z1C_ddN0_1000(z8000_state *cpustate) |
| 1768 | 1842 | { |
| 1769 | 1843 | GET_DST(OP0,NIB2); |
| 1770 | | TESTL(cpustate, RDMEM_L(cpustate, cpustate->RW(dst))); |
| 1844 | TESTL(cpustate, RDMEM_L(cpustate, addr_from_reg(cpustate, dst))); |
| 1771 | 1845 | } |
| 1772 | 1846 | |
| 1773 | 1847 | /****************************************** |
| r15120 | r15121 | |
| 1812 | 1886 | { |
| 1813 | 1887 | GET_SRC(OP0,NIB3); |
| 1814 | 1888 | GET_DST(OP0,NIB2); |
| 1815 | | WRMEM_L(cpustate, cpustate->RW(dst), cpustate->RL(src)); |
| 1889 | WRMEM_L(cpustate, addr_from_reg(cpustate, dst), cpustate->RL(src)); |
| 1816 | 1890 | } |
| 1817 | 1891 | |
| 1818 | 1892 | /****************************************** |
| r15120 | r15121 | |
| 1824 | 1898 | GET_CCC(OP0,NIB3); |
| 1825 | 1899 | GET_DST(OP0,NIB2); |
| 1826 | 1900 | switch (cc) { |
| 1827 | | case 0: if (CC0) cpustate->pc = cpustate->RW(dst); break; |
| 1828 | | case 1: if (CC1) cpustate->pc = cpustate->RW(dst); break; |
| 1829 | | case 2: if (CC2) cpustate->pc = cpustate->RW(dst); break; |
| 1830 | | case 3: if (CC3) cpustate->pc = cpustate->RW(dst); break; |
| 1831 | | case 4: if (CC4) cpustate->pc = cpustate->RW(dst); break; |
| 1832 | | case 5: if (CC5) cpustate->pc = cpustate->RW(dst); break; |
| 1833 | | case 6: if (CC6) cpustate->pc = cpustate->RW(dst); break; |
| 1834 | | case 7: if (CC7) cpustate->pc = cpustate->RW(dst); break; |
| 1835 | | case 8: if (CC8) cpustate->pc = cpustate->RW(dst); break; |
| 1836 | | case 9: if (CC9) cpustate->pc = cpustate->RW(dst); break; |
| 1837 | | case 10: if (CCA) cpustate->pc = cpustate->RW(dst); break; |
| 1838 | | case 11: if (CCB) cpustate->pc = cpustate->RW(dst); break; |
| 1839 | | case 12: if (CCC) cpustate->pc = cpustate->RW(dst); break; |
| 1840 | | case 13: if (CCD) cpustate->pc = cpustate->RW(dst); break; |
| 1841 | | case 14: if (CCE) cpustate->pc = cpustate->RW(dst); break; |
| 1842 | | case 15: if (CCF) cpustate->pc = cpustate->RW(dst); break; |
| 1901 | case 0: if (CC0) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1902 | case 1: if (CC1) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1903 | case 2: if (CC2) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1904 | case 3: if (CC3) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1905 | case 4: if (CC4) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1906 | case 5: if (CC5) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1907 | case 6: if (CC6) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1908 | case 7: if (CC7) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1909 | case 8: if (CC8) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1910 | case 9: if (CC9) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1911 | case 10: if (CCA) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1912 | case 11: if (CCB) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1913 | case 12: if (CCC) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1914 | case 13: if (CCD) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1915 | case 14: if (CCE) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1916 | case 15: if (CCF) cpustate->pc = addr_from_reg(cpustate, dst); break; |
| 1843 | 1917 | } |
| 1844 | 1918 | } |
| 1845 | 1919 | |
| r15120 | r15121 | |
| 1850 | 1924 | static void Z1F_ddN0_0000(z8000_state *cpustate) |
| 1851 | 1925 | { |
| 1852 | 1926 | GET_DST(OP0,NIB2); |
| 1853 | | PUSHW(cpustate, SP, cpustate->pc); |
| 1854 | | cpustate->pc = cpustate->RW(dst); |
| 1927 | if (segmented_mode(cpustate)) |
| 1928 | PUSHL(cpustate, SP, make_segmented_addr(cpustate->pc)); |
| 1929 | else |
| 1930 | PUSHW(cpustate, SP, cpustate->pc); |
| 1931 | cpustate->pc = addr_from_reg(cpustate, dst); |
| 1855 | 1932 | } |
| 1856 | 1933 | |
| 1857 | 1934 | /****************************************** |
| r15120 | r15121 | |
| 1862 | 1939 | { |
| 1863 | 1940 | GET_DST(OP0,NIB3); |
| 1864 | 1941 | GET_SRC(OP0,NIB2); |
| 1865 | | cpustate->RB(dst) = RDMEM_B(cpustate, cpustate->RW(src)); |
| 1942 | cpustate->RB(dst) = RDMEM_B(cpustate, addr_from_reg(cpustate, src)); |
| 1866 | 1943 | } |
| 1867 | 1944 | |
| 1868 | | static void Z20_ssN0_dddd_seg(z8000_state *cpustate) |
| 1869 | | { |
| 1870 | | UINT32 addr; |
| 1871 | | GET_DST(OP0,NIB3); |
| 1872 | | GET_SRC(OP0,NIB2); |
| 1873 | | addr = (cpustate->RW(src) & 0x0007) << 16; |
| 1874 | | addr|= cpustate->RW(src+1) & 0xffff; |
| 1875 | | cpustate->RB(dst) = RDMEM_B(cpustate, addr); |
| 1876 | | //cycles? |
| 1877 | | } |
| 1878 | | |
| 1879 | 1945 | /****************************************** |
| 1880 | 1946 | ld rd,imm16 |
| 1881 | 1947 | flags: ------ |
| r15120 | r15121 | |
| 1895 | 1961 | { |
| 1896 | 1962 | GET_DST(OP0,NIB3); |
| 1897 | 1963 | GET_SRC(OP0,NIB2); |
| 1898 | | cpustate->RW(dst) = RDMEM_W(cpustate, cpustate->RW(src)); |
| 1964 | cpustate->RW(dst) = RDMEM_W(cpustate, addr_from_reg(cpustate, src)); |
| 1899 | 1965 | } |
| 1900 | 1966 | |
| 1901 | 1967 | /****************************************** |
| r15120 | r15121 | |
| 1917 | 1983 | { |
| 1918 | 1984 | GET_BIT(OP0); |
| 1919 | 1985 | GET_DST(OP0,NIB2); |
| 1920 | | WRMEM_B(cpustate, cpustate->RW(dst), RDMEM_B(cpustate, cpustate->RW(dst)) & ~bit); |
| 1986 | UINT32 addr = addr_from_reg(cpustate, dst); |
| 1987 | WRMEM_B(cpustate, addr, RDMEM_B(cpustate, addr) & ~bit); |
| 1921 | 1988 | } |
| 1922 | 1989 | |
| 1923 | 1990 | /****************************************** |
| 1924 | | result rd,rs |
| 1991 | res rd,rs |
| 1925 | 1992 | flags: ------ |
| 1926 | 1993 | ******************************************/ |
| 1927 | 1994 | static void Z23_0000_ssss_0000_dddd_0000_0000(z8000_state *cpustate) |
| r15120 | r15121 | |
| 1939 | 2006 | { |
| 1940 | 2007 | GET_BIT(OP0); |
| 1941 | 2008 | GET_DST(OP0,NIB2); |
| 1942 | | WRMEM_W(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(dst)) & ~bit); |
| 2009 | UINT32 addr = addr_from_reg(cpustate, dst); |
| 2010 | WRMEM_W(cpustate, addr, RDMEM_W(cpustate, addr) & ~bit); |
| 1943 | 2011 | } |
| 1944 | 2012 | |
| 1945 | 2013 | /****************************************** |
| r15120 | r15121 | |
| 1961 | 2029 | { |
| 1962 | 2030 | GET_BIT(OP0); |
| 1963 | 2031 | GET_DST(OP0,NIB2); |
| 1964 | | WRMEM_B(cpustate, cpustate->RW(dst), RDMEM_B(cpustate, cpustate->RW(dst)) | bit); |
| 2032 | UINT32 addr = addr_from_reg(cpustate, dst); |
| 2033 | WRMEM_B(cpustate, addr, RDMEM_B(cpustate, addr) | bit); |
| 1965 | 2034 | } |
| 1966 | 2035 | |
| 1967 | 2036 | /****************************************** |
| r15120 | r15121 | |
| 1983 | 2052 | { |
| 1984 | 2053 | GET_BIT(OP0); |
| 1985 | 2054 | GET_DST(OP0,NIB2); |
| 1986 | | WRMEM_W(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(dst)) | bit); |
| 2055 | UINT32 addr = addr_from_reg(cpustate, dst); |
| 2056 | WRMEM_W(cpustate, addr, RDMEM_W(cpustate, addr) | bit); |
| 1987 | 2057 | } |
| 1988 | 2058 | |
| 1989 | 2059 | /****************************************** |
| r15120 | r15121 | |
| 2005 | 2075 | { |
| 2006 | 2076 | GET_BIT(OP0); |
| 2007 | 2077 | GET_DST(OP0,NIB2); |
| 2008 | | if (RDMEM_B(cpustate, cpustate->RW(dst)) & bit) CLR_Z; else SET_Z; |
| 2078 | if (RDMEM_B(cpustate, addr_from_reg(cpustate, dst)) & bit) CLR_Z; else SET_Z; |
| 2009 | 2079 | } |
| 2010 | 2080 | |
| 2011 | 2081 | /****************************************** |
| r15120 | r15121 | |
| 2027 | 2097 | { |
| 2028 | 2098 | GET_BIT(OP0); |
| 2029 | 2099 | GET_DST(OP0,NIB2); |
| 2030 | | if (RDMEM_W(cpustate, cpustate->RW(dst)) & bit) CLR_Z; else SET_Z; |
| 2100 | if (RDMEM_W(cpustate, addr_from_reg(cpustate, dst)) & bit) CLR_Z; else SET_Z; |
| 2031 | 2101 | } |
| 2032 | 2102 | |
| 2033 | 2103 | /****************************************** |
| r15120 | r15121 | |
| 2038 | 2108 | { |
| 2039 | 2109 | GET_I4M1(OP0,NIB3); |
| 2040 | 2110 | GET_DST(OP0,NIB2); |
| 2041 | | WRMEM_B(cpustate, cpustate->RW(dst), INCB(cpustate, RDMEM_B(cpustate, cpustate->RW(dst)), i4p1)); |
| 2111 | UINT32 addr = addr_from_reg(cpustate, dst); |
| 2112 | WRMEM_B(cpustate, addr, INCB(cpustate, RDMEM_B(cpustate, addr), i4p1)); |
| 2042 | 2113 | } |
| 2043 | 2114 | |
| 2044 | 2115 | /****************************************** |
| r15120 | r15121 | |
| 2049 | 2120 | { |
| 2050 | 2121 | GET_I4M1(OP0,NIB3); |
| 2051 | 2122 | GET_DST(OP0,NIB2); |
| 2052 | | WRMEM_W(cpustate, cpustate->RW(dst), INCW(cpustate, RDMEM_W(cpustate, cpustate->RW(dst)), i4p1)); |
| 2123 | UINT32 addr = addr_from_reg(cpustate, dst); |
| 2124 | WRMEM_W(cpustate, addr, INCW(cpustate, RDMEM_W(cpustate, addr), i4p1)); |
| 2053 | 2125 | } |
| 2054 | 2126 | |
| 2055 | 2127 | /****************************************** |
| r15120 | r15121 | |
| 2060 | 2132 | { |
| 2061 | 2133 | GET_I4M1(OP0,NIB3); |
| 2062 | 2134 | GET_DST(OP0,NIB2); |
| 2063 | | WRMEM_B(cpustate, cpustate->RW(dst), DECB(cpustate, RDMEM_B(cpustate, cpustate->RW(dst)), i4p1)); |
| 2135 | UINT32 addr = addr_from_reg(cpustate, dst); |
| 2136 | WRMEM_B(cpustate, addr, DECB(cpustate, RDMEM_B(cpustate, addr), i4p1)); |
| 2064 | 2137 | } |
| 2065 | 2138 | |
| 2066 | 2139 | /****************************************** |
| r15120 | r15121 | |
| 2071 | 2144 | { |
| 2072 | 2145 | GET_I4M1(OP0,NIB3); |
| 2073 | 2146 | GET_DST(OP0,NIB2); |
| 2074 | | WRMEM_W(cpustate, cpustate->RW(dst), DECW(cpustate, RDMEM_W(cpustate, cpustate->RW(dst)), i4p1)); |
| 2147 | UINT32 addr = addr_from_reg(cpustate, dst); |
| 2148 | WRMEM_W(cpustate, addr, DECW(cpustate, RDMEM_W(cpustate, addr), i4p1)); |
| 2075 | 2149 | } |
| 2076 | 2150 | |
| 2077 | 2151 | /****************************************** |
| r15120 | r15121 | |
| 2082 | 2156 | { |
| 2083 | 2157 | GET_DST(OP0,NIB3); |
| 2084 | 2158 | GET_SRC(OP0,NIB2); |
| 2085 | | UINT8 tmp = RDMEM_B(cpustate, cpustate->RW(src)); |
| 2086 | | WRMEM_B(cpustate, cpustate->RW(src), cpustate->RB(dst)); |
| 2159 | UINT32 addr = addr_from_reg(cpustate, src); |
| 2160 | UINT8 tmp = RDMEM_B(cpustate, addr); |
| 2161 | WRMEM_B(cpustate, addr, cpustate->RB(dst)); |
| 2087 | 2162 | cpustate->RB(dst) = tmp; |
| 2088 | 2163 | } |
| 2089 | 2164 | |
| r15120 | r15121 | |
| 2095 | 2170 | { |
| 2096 | 2171 | GET_DST(OP0,NIB3); |
| 2097 | 2172 | GET_SRC(OP0,NIB2); |
| 2098 | | UINT16 tmp = RDMEM_W(cpustate, cpustate->RW(src)); |
| 2099 | | WRMEM_W(cpustate, cpustate->RW(src), cpustate->RW(dst)); |
| 2173 | UINT32 addr = addr_from_reg(cpustate, src); |
| 2174 | UINT16 tmp = RDMEM_W(cpustate, addr); |
| 2175 | WRMEM_W(cpustate, addr, cpustate->RW(dst)); |
| 2100 | 2176 | cpustate->RW(dst) = tmp; |
| 2101 | 2177 | } |
| 2102 | 2178 | |
| r15120 | r15121 | |
| 2108 | 2184 | { |
| 2109 | 2185 | GET_SRC(OP0,NIB3); |
| 2110 | 2186 | GET_DST(OP0,NIB2); |
| 2111 | | WRMEM_B(cpustate, cpustate->RW(dst), cpustate->RB(src)); |
| 2187 | WRMEM_B(cpustate, addr_from_reg(cpustate, dst), cpustate->RB(src)); |
| 2112 | 2188 | } |
| 2113 | 2189 | |
| 2114 | 2190 | /****************************************** |
| r15120 | r15121 | |
| 2119 | 2195 | { |
| 2120 | 2196 | GET_SRC(OP0,NIB3); |
| 2121 | 2197 | GET_DST(OP0,NIB2); |
| 2122 | | WRMEM_W(cpustate, cpustate->RW(dst), cpustate->RW(src)); |
| 2198 | WRMEM_W(cpustate, addr_from_reg(cpustate, dst), cpustate->RW(src)); |
| 2123 | 2199 | } |
| 2124 | 2200 | |
| 2125 | 2201 | /****************************************** |
| r15120 | r15121 | |
| 2142 | 2218 | GET_DST(OP0,NIB3); |
| 2143 | 2219 | GET_SRC(OP0,NIB2); |
| 2144 | 2220 | GET_IMM16(OP1); |
| 2145 | | imm16 += cpustate->RW(src); |
| 2221 | imm16 = addr_add(cpustate, addr_from_reg(cpustate, src), imm16); |
| 2146 | 2222 | cpustate->RB(dst) = RDMEM_B(cpustate, imm16); |
| 2147 | 2223 | } |
| 2148 | 2224 | |
| r15120 | r15121 | |
| 2166 | 2242 | GET_DST(OP0,NIB3); |
| 2167 | 2243 | GET_SRC(OP0,NIB2); |
| 2168 | 2244 | GET_IMM16(OP1); |
| 2169 | | imm16 += cpustate->RW(src); |
| 2245 | imm16 = addr_add(cpustate, addr_from_reg(cpustate, src), imm16); |
| 2170 | 2246 | cpustate->RW(dst) = RDMEM_W(cpustate, imm16); |
| 2171 | 2247 | } |
| 2172 | 2248 | |
| r15120 | r15121 | |
| 2190 | 2266 | GET_SRC(OP0,NIB3); |
| 2191 | 2267 | GET_DST(OP0,NIB2); |
| 2192 | 2268 | GET_IMM16(OP1); |
| 2193 | | imm16 += cpustate->RW(dst); |
| 2269 | imm16 = addr_add(cpustate, addr_from_reg(cpustate, dst), imm16); |
| 2194 | 2270 | WRMEM_B(cpustate, imm16, cpustate->RB(src)); |
| 2195 | 2271 | } |
| 2196 | 2272 | |
| r15120 | r15121 | |
| 2214 | 2290 | GET_SRC(OP0,NIB3); |
| 2215 | 2291 | GET_DST(OP0,NIB2); |
| 2216 | 2292 | GET_IMM16(OP1); |
| 2217 | | imm16 += cpustate->RW(dst); |
| 2293 | imm16 = addr_add(cpustate, addr_from_reg(cpustate,dst), imm16); |
| 2218 | 2294 | WRMEM_W(cpustate, imm16, cpustate->RW(src)); |
| 2219 | 2295 | } |
| 2220 | 2296 | |
| r15120 | r15121 | |
| 2226 | 2302 | { |
| 2227 | 2303 | GET_DST(OP0,NIB3); |
| 2228 | 2304 | GET_DSP16; |
| 2229 | | cpustate->RW(dst) = dsp16; |
| 2305 | addr_to_reg(cpustate, dst, dsp16); |
| 2230 | 2306 | } |
| 2231 | 2307 | |
| 2232 | 2308 | /****************************************** |
| r15120 | r15121 | |
| 2238 | 2314 | GET_DST(OP0,NIB3); |
| 2239 | 2315 | GET_SRC(OP0,NIB2); |
| 2240 | 2316 | GET_IMM16(OP1); |
| 2241 | | imm16 += cpustate->RW(src); |
| 2242 | | cpustate->RW(dst) = imm16; |
| 2317 | imm16 = addr_add(cpustate, addr_from_reg(cpustate, src), imm16); |
| 2318 | addr_to_reg(cpustate, dst, imm16); |
| 2243 | 2319 | } |
| 2244 | 2320 | |
| 2245 | 2321 | /****************************************** |
| r15120 | r15121 | |
| 2262 | 2338 | GET_DST(OP0,NIB3); |
| 2263 | 2339 | GET_SRC(OP0,NIB2); |
| 2264 | 2340 | GET_IMM16(OP1); |
| 2265 | | imm16 += cpustate->RW(src); |
| 2341 | imm16 = addr_add(cpustate, addr_from_reg(cpustate, src), imm16); |
| 2266 | 2342 | cpustate->RL(dst) = RDMEM_L(cpustate, imm16); |
| 2267 | 2343 | } |
| 2268 | 2344 | |
| r15120 | r15121 | |
| 2310 | 2386 | GET_SRC(OP0,NIB3); |
| 2311 | 2387 | GET_DST(OP0,NIB2); |
| 2312 | 2388 | GET_IMM16(OP1); |
| 2313 | | imm16 += cpustate->RW(dst); |
| 2389 | imm16 = addr_add(cpustate, addr_from_reg(cpustate, dst), imm16); |
| 2314 | 2390 | WRMEM_L(cpustate, imm16, cpustate->RL(src)); |
| 2315 | 2391 | } |
| 2316 | 2392 | |
| r15120 | r15121 | |
| 2336 | 2412 | { |
| 2337 | 2413 | GET_SRC(OP0,NIB2); |
| 2338 | 2414 | UINT16 fcw; |
| 2339 | | fcw = RDMEM_W(cpustate, cpustate->RW(src)); |
| 2340 | | cpustate->pc = RDMEM_W(cpustate, (UINT16)(cpustate->RW(src) + 2)); |
| 2415 | if (segmented_mode(cpustate)) { |
| 2416 | UINT32 addr = addr_from_reg(cpustate, src); |
| 2417 | fcw = RDMEM_W(cpustate, addr + 2); |
| 2418 | cpustate->pc = segmented_addr(RDMEM_L(cpustate, addr + 4)); |
| 2419 | } |
| 2420 | else { |
| 2421 | fcw = RDMEM_W(cpustate, cpustate->RW(src)); |
| 2422 | cpustate->pc = RDMEM_W(cpustate, (UINT16)(cpustate->RW(src) + 2)); |
| 2423 | } |
| 2341 | 2424 | CHANGE_FCW(cpustate, fcw); /* check for user/system mode change */ |
| 2342 | 2425 | } |
| 2343 | 2426 | |
| r15120 | r15121 | |
| 2346 | 2429 | flags: ---V-- |
| 2347 | 2430 | ******************************************/ |
| 2348 | 2431 | static void Z3A_ssss_0000_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2349 | | { |
| 2432 | {//@@@@ |
| 2350 | 2433 | GET_SRC(OP0,NIB2); |
| 2351 | 2434 | GET_CNT(OP1,NIB1); |
| 2352 | 2435 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2363 | 2446 | flags: ------ |
| 2364 | 2447 | ******************************************/ |
| 2365 | 2448 | static void Z3A_ssss_0001_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2366 | | { |
| 2449 | {//@@@@ |
| 2367 | 2450 | GET_SRC(OP0,NIB2); |
| 2368 | 2451 | GET_CNT(OP1,NIB1); |
| 2369 | 2452 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2380 | 2463 | flags: ---V-- |
| 2381 | 2464 | ******************************************/ |
| 2382 | 2465 | static void Z3A_ssss_0010_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2383 | | { |
| 2466 | {//@@@@ |
| 2384 | 2467 | GET_SRC(OP0,NIB2); |
| 2385 | 2468 | GET_CNT(OP1,NIB1); |
| 2386 | 2469 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2397 | 2480 | flags: ------ |
| 2398 | 2481 | ******************************************/ |
| 2399 | 2482 | static void Z3A_ssss_0011_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2400 | | { |
| 2483 | {//@@@@ |
| 2401 | 2484 | GET_SRC(OP0,NIB2); |
| 2402 | 2485 | GET_CNT(OP1,NIB1); |
| 2403 | 2486 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2458 | 2541 | flags: ---V-- |
| 2459 | 2542 | ******************************************/ |
| 2460 | 2543 | static void Z3A_ssss_1000_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2461 | | { |
| 2544 | {//@@@ |
| 2462 | 2545 | GET_SRC(OP0,NIB2); |
| 2463 | 2546 | GET_CNT(OP1,NIB1); |
| 2464 | 2547 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2475 | 2558 | flags: ------ |
| 2476 | 2559 | ******************************************/ |
| 2477 | 2560 | static void Z3A_ssss_1001_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2478 | | { |
| 2561 | {//@@@ |
| 2479 | 2562 | GET_SRC(OP0,NIB2); |
| 2480 | 2563 | GET_CNT(OP1,NIB1); |
| 2481 | 2564 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2492 | 2575 | flags: ---V-- |
| 2493 | 2576 | ******************************************/ |
| 2494 | 2577 | static void Z3A_ssss_1010_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2495 | | { |
| 2578 | {//@@@ |
| 2496 | 2579 | GET_SRC(OP0,NIB2); |
| 2497 | 2580 | GET_CNT(OP1,NIB1); |
| 2498 | 2581 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2509 | 2592 | flags: ------ |
| 2510 | 2593 | ******************************************/ |
| 2511 | 2594 | static void Z3A_ssss_1011_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2512 | | { |
| 2595 | {//@@@ |
| 2513 | 2596 | GET_SRC(OP0,NIB2); |
| 2514 | 2597 | GET_CNT(OP1,NIB1); |
| 2515 | 2598 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2526 | 2609 | flags: ---V-- |
| 2527 | 2610 | ******************************************/ |
| 2528 | 2611 | static void Z3B_ssss_0000_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2529 | | { |
| 2612 | {//@@@ |
| 2530 | 2613 | GET_SRC(OP0,NIB2); |
| 2531 | 2614 | GET_CNT(OP1,NIB1); |
| 2532 | 2615 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2543 | 2626 | flags: ------ |
| 2544 | 2627 | ******************************************/ |
| 2545 | 2628 | static void Z3B_ssss_0001_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2546 | | { |
| 2629 | {//@@@ |
| 2547 | 2630 | GET_SRC(OP0,NIB2); |
| 2548 | 2631 | GET_CNT(OP1,NIB1); |
| 2549 | 2632 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2560 | 2643 | flags: ---V-- |
| 2561 | 2644 | ******************************************/ |
| 2562 | 2645 | static void Z3B_ssss_0010_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2563 | | { |
| 2646 | {//@@@ |
| 2564 | 2647 | GET_SRC(OP0,NIB2); |
| 2565 | 2648 | GET_CNT(OP1,NIB1); |
| 2566 | 2649 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2577 | 2660 | flags: ------ |
| 2578 | 2661 | ******************************************/ |
| 2579 | 2662 | static void Z3B_ssss_0011_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2580 | | { |
| 2663 | {//@@@ |
| 2581 | 2664 | GET_SRC(OP0,NIB2); |
| 2582 | 2665 | GET_CNT(OP1,NIB1); |
| 2583 | 2666 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2638 | 2721 | flags: ---V-- |
| 2639 | 2722 | ******************************************/ |
| 2640 | 2723 | static void Z3B_ssss_1000_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2641 | | { |
| 2724 | {//@@@ |
| 2642 | 2725 | GET_SRC(OP0,NIB2); |
| 2643 | 2726 | GET_CNT(OP1,NIB1); |
| 2644 | 2727 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2655 | 2738 | flags: ------ |
| 2656 | 2739 | ******************************************/ |
| 2657 | 2740 | static void Z3B_ssss_1001_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2658 | | { |
| 2741 | {//@@@ |
| 2659 | 2742 | GET_SRC(OP0,NIB2); |
| 2660 | 2743 | GET_CNT(OP1,NIB1); |
| 2661 | 2744 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2672 | 2755 | flags: ---V-- |
| 2673 | 2756 | ******************************************/ |
| 2674 | 2757 | static void Z3B_ssss_1010_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2675 | | { |
| 2758 | {//@@@ |
| 2676 | 2759 | GET_SRC(OP0,NIB2); |
| 2677 | 2760 | GET_CNT(OP1,NIB1); |
| 2678 | 2761 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2689 | 2772 | flags: ------ |
| 2690 | 2773 | ******************************************/ |
| 2691 | 2774 | static void Z3B_ssss_1011_0000_aaaa_dddd_x000(z8000_state *cpustate) |
| 2692 | | { |
| 2775 | {//@@@ |
| 2693 | 2776 | GET_SRC(OP0,NIB2); |
| 2694 | 2777 | GET_CNT(OP1,NIB1); |
| 2695 | 2778 | GET_DST(OP1,NIB2); |
| r15120 | r15121 | |
| 2705 | 2788 | flags: ------ |
| 2706 | 2789 | ******************************************/ |
| 2707 | 2790 | static void Z3C_ssss_dddd(z8000_state *cpustate) |
| 2708 | | { |
| 2791 | {//@@@check |
| 2709 | 2792 | GET_SRC(OP0,NIB2); |
| 2710 | 2793 | GET_DST(OP0,NIB3); |
| 2711 | 2794 | cpustate->RB(dst) = RDPORT_B(cpustate, 0, RDMEM_W(cpustate, cpustate->RW(src))); |
| r15120 | r15121 | |
| 2716 | 2799 | flags: ------ |
| 2717 | 2800 | ******************************************/ |
| 2718 | 2801 | static void Z3D_ssss_dddd(z8000_state *cpustate) |
| 2719 | | { |
| 2802 | {//@@@check |
| 2720 | 2803 | GET_SRC(OP0,NIB2); |
| 2721 | 2804 | GET_DST(OP0,NIB3); |
| 2722 | 2805 | cpustate->RW(dst) = RDPORT_W(cpustate, 0, RDMEM_W(cpustate, cpustate->RW(src))); |
| r15120 | r15121 | |
| 2727 | 2810 | flags: ---V-- |
| 2728 | 2811 | ******************************************/ |
| 2729 | 2812 | static void Z3E_dddd_ssss(z8000_state *cpustate) |
| 2730 | | { |
| 2813 | {//@@@check |
| 2731 | 2814 | GET_DST(OP0,NIB2); |
| 2732 | 2815 | GET_SRC(OP0,NIB3); |
| 2733 | 2816 | WRPORT_B(cpustate, 0, RDMEM_W(cpustate, cpustate->RW(dst)), cpustate->RB(src)); |
| 2734 | 2817 | } |
| 2735 | 2818 | |
| 2736 | | /* FIXME: aforementioned opcode looks bugged. */ |
| 2737 | | static void Z3E_dddd_ssss_seg(z8000_state *cpustate) |
| 2738 | | { |
| 2739 | | GET_DST(OP0,NIB2); |
| 2740 | | GET_SRC(OP0,NIB3); |
| 2741 | | WRPORT_B(cpustate, 0, cpustate->RW(dst), cpustate->RB(src)); |
| 2742 | | } |
| 2743 | | |
| 2744 | 2819 | /****************************************** |
| 2745 | 2820 | out @rd,rs |
| 2746 | 2821 | flags: ---V-- |
| 2747 | 2822 | ******************************************/ |
| 2748 | 2823 | static void Z3F_dddd_ssss(z8000_state *cpustate) |
| 2749 | | { |
| 2824 | {//check |
| 2750 | 2825 | GET_DST(OP0,NIB2); |
| 2751 | 2826 | GET_SRC(OP0,NIB3); |
| 2752 | 2827 | WRPORT_W(cpustate, 0, RDMEM_W(cpustate, cpustate->RW(dst)), cpustate->RW(src)); |
| r15120 | r15121 | |
| 2772 | 2847 | GET_DST(OP0,NIB3); |
| 2773 | 2848 | GET_SRC(OP0,NIB2); |
| 2774 | 2849 | GET_ADDR(OP1); |
| 2775 | | addr += cpustate->RW(src); |
| 2850 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 2776 | 2851 | cpustate->RB(dst) = ADDB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr)); |
| 2777 | 2852 | } |
| 2778 | 2853 | |
| r15120 | r15121 | |
| 2796 | 2871 | GET_DST(OP0,NIB3); |
| 2797 | 2872 | GET_SRC(OP0,NIB2); |
| 2798 | 2873 | GET_ADDR(OP1); |
| 2799 | | addr += cpustate->RW(src); |
| 2874 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 2800 | 2875 | cpustate->RW(dst) = ADDW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr)); /* ASG */ |
| 2801 | 2876 | } |
| 2802 | 2877 | |
| r15120 | r15121 | |
| 2820 | 2895 | GET_DST(OP0,NIB3); |
| 2821 | 2896 | GET_SRC(OP0,NIB2); |
| 2822 | 2897 | GET_ADDR(OP1); |
| 2823 | | addr += cpustate->RW(src); |
| 2898 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 2824 | 2899 | cpustate->RB(dst) = SUBB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr)); |
| 2825 | 2900 | } |
| 2826 | 2901 | |
| r15120 | r15121 | |
| 2844 | 2919 | GET_DST(OP0,NIB3); |
| 2845 | 2920 | GET_SRC(OP0,NIB2); |
| 2846 | 2921 | GET_ADDR(OP1); |
| 2847 | | addr += cpustate->RW(src); |
| 2922 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 2848 | 2923 | cpustate->RW(dst) = SUBW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr)); |
| 2849 | 2924 | } |
| 2850 | 2925 | |
| r15120 | r15121 | |
| 2868 | 2943 | GET_DST(OP0,NIB3); |
| 2869 | 2944 | GET_SRC(OP0,NIB2); |
| 2870 | 2945 | GET_ADDR(OP1); |
| 2871 | | addr += cpustate->RW(src); |
| 2946 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 2872 | 2947 | cpustate->RB(dst) = ORB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr)); |
| 2873 | 2948 | } |
| 2874 | 2949 | |
| r15120 | r15121 | |
| 2892 | 2967 | GET_DST(OP0,NIB3); |
| 2893 | 2968 | GET_SRC(OP0,NIB2); |
| 2894 | 2969 | GET_ADDR(OP1); |
| 2895 | | addr += cpustate->RW(src); |
| 2970 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 2896 | 2971 | cpustate->RW(dst) = ORW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr)); |
| 2897 | 2972 | } |
| 2898 | 2973 | |
| r15120 | r15121 | |
| 2916 | 2991 | GET_DST(OP0,NIB3); |
| 2917 | 2992 | GET_SRC(OP0,NIB2); |
| 2918 | 2993 | GET_ADDR(OP1); |
| 2919 | | addr += cpustate->RW(src); |
| 2994 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 2920 | 2995 | cpustate->RB(dst) = ANDB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr)); |
| 2921 | 2996 | } |
| 2922 | 2997 | |
| r15120 | r15121 | |
| 2940 | 3015 | GET_DST(OP0,NIB3); |
| 2941 | 3016 | GET_SRC(OP0,NIB2); |
| 2942 | 3017 | GET_ADDR(OP1); |
| 2943 | | addr += cpustate->RW(src); |
| 3018 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 2944 | 3019 | cpustate->RW(dst) = ANDW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr)); |
| 2945 | 3020 | } |
| 2946 | 3021 | |
| r15120 | r15121 | |
| 2964 | 3039 | GET_DST(OP0,NIB3); |
| 2965 | 3040 | GET_SRC(OP0,NIB2); |
| 2966 | 3041 | GET_ADDR(OP1); |
| 2967 | | addr += cpustate->RW(src); |
| 3042 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 2968 | 3043 | cpustate->RB(dst) = XORB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr)); |
| 2969 | 3044 | } |
| 2970 | 3045 | |
| r15120 | r15121 | |
| 2988 | 3063 | GET_DST(OP0,NIB3); |
| 2989 | 3064 | GET_SRC(OP0,NIB2); |
| 2990 | 3065 | GET_ADDR(OP1); |
| 2991 | | addr += cpustate->RW(src); |
| 3066 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 2992 | 3067 | cpustate->RW(dst) = XORW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr)); |
| 2993 | 3068 | } |
| 2994 | 3069 | |
| r15120 | r15121 | |
| 3012 | 3087 | GET_DST(OP0,NIB3); |
| 3013 | 3088 | GET_SRC(OP0,NIB2); |
| 3014 | 3089 | GET_ADDR(OP1); |
| 3015 | | addr += cpustate->RW(src); |
| 3090 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3016 | 3091 | CPB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr)); |
| 3017 | 3092 | } |
| 3018 | 3093 | |
| r15120 | r15121 | |
| 3036 | 3111 | GET_DST(OP0,NIB3); |
| 3037 | 3112 | GET_SRC(OP0,NIB2); |
| 3038 | 3113 | GET_ADDR(OP1); |
| 3039 | | addr += cpustate->RW(src); |
| 3114 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3040 | 3115 | CPW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr)); |
| 3041 | 3116 | } |
| 3042 | 3117 | |
| r15120 | r15121 | |
| 3113 | 3188 | WRMEM_B(cpustate, addr, 0); |
| 3114 | 3189 | } |
| 3115 | 3190 | |
| 3116 | | static void Z4C_0000_1000_addr_seg(z8000_state *cpustate) |
| 3117 | | { |
| 3118 | | static UINT32 offset; |
| 3119 | | UINT16 operand1 = fetch(cpustate); |
| 3120 | | |
| 3121 | | if(operand1 & 0x8000) |
| 3122 | | { |
| 3123 | | UINT16 operand2 = fetch(cpustate); |
| 3124 | | |
| 3125 | | offset = (operand1 & 0x0700) << 8; |
| 3126 | | offset|= (operand2 & 0xffff); |
| 3127 | | WRMEM_B(cpustate, offset, 0); |
| 3128 | | cycles(cpustate, 14); |
| 3129 | | } |
| 3130 | | else |
| 3131 | | { |
| 3132 | | offset = (operand1 & 0x0700) << 8; |
| 3133 | | offset|= (operand1 & 0x00ff); |
| 3134 | | WRMEM_B(cpustate, offset, 0); |
| 3135 | | cycles(cpustate, 12); |
| 3136 | | } |
| 3137 | | } |
| 3138 | | |
| 3139 | 3191 | /****************************************** |
| 3140 | 3192 | comb addr(rd) |
| 3141 | 3193 | flags: -ZSP-- |
| r15120 | r15121 | |
| 3144 | 3196 | { |
| 3145 | 3197 | GET_DST(OP0,NIB2); |
| 3146 | 3198 | GET_ADDR(OP1); |
| 3147 | | addr += cpustate->RW(dst); |
| 3199 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3148 | 3200 | WRMEM_B(cpustate, addr, COMB(cpustate, RDMEM_B(cpustate, addr))); |
| 3149 | 3201 | } |
| 3150 | 3202 | |
| r15120 | r15121 | |
| 3157 | 3209 | GET_DST(OP0,NIB2); |
| 3158 | 3210 | GET_ADDR(OP1); |
| 3159 | 3211 | GET_IMM8(OP2); |
| 3160 | | addr += cpustate->RW(dst); |
| 3212 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3161 | 3213 | CPB(cpustate, RDMEM_B(cpustate, addr), imm8); |
| 3162 | 3214 | } |
| 3163 | 3215 | |
| r15120 | r15121 | |
| 3169 | 3221 | { |
| 3170 | 3222 | GET_DST(OP0,NIB2); |
| 3171 | 3223 | GET_ADDR(OP1); |
| 3172 | | addr += cpustate->RW(dst); |
| 3224 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3173 | 3225 | WRMEM_B(cpustate, addr, NEGB(cpustate, RDMEM_B(cpustate, addr))); |
| 3174 | 3226 | } |
| 3175 | 3227 | |
| r15120 | r15121 | |
| 3181 | 3233 | { |
| 3182 | 3234 | GET_DST(OP0,NIB2); |
| 3183 | 3235 | GET_ADDR(OP1); |
| 3184 | | addr += cpustate->RW(dst); |
| 3236 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3185 | 3237 | TESTB(cpustate, RDMEM_B(cpustate, addr)); |
| 3186 | 3238 | } |
| 3187 | 3239 | |
| r15120 | r15121 | |
| 3194 | 3246 | GET_DST(OP0,NIB2); |
| 3195 | 3247 | GET_ADDR(OP1); |
| 3196 | 3248 | GET_IMM8(OP2); |
| 3197 | | addr += cpustate->RW(dst); |
| 3249 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3198 | 3250 | WRMEM_B(cpustate, addr, imm8); |
| 3199 | 3251 | } |
| 3200 | 3252 | |
| r15120 | r15121 | |
| 3206 | 3258 | { |
| 3207 | 3259 | GET_DST(OP0,NIB2); |
| 3208 | 3260 | GET_ADDR(OP1); |
| 3209 | | addr += cpustate->RW(dst); |
| 3261 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3210 | 3262 | if (RDMEM_B(cpustate, addr) & S08) SET_S; else CLR_S; |
| 3211 | 3263 | WRMEM_B(cpustate, addr, 0xff); |
| 3212 | 3264 | } |
| r15120 | r15121 | |
| 3219 | 3271 | { |
| 3220 | 3272 | GET_DST(OP0,NIB2); |
| 3221 | 3273 | GET_ADDR(OP1); |
| 3222 | | addr += cpustate->RW(dst); |
| 3274 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3223 | 3275 | WRMEM_B(cpustate, addr, 0); |
| 3224 | 3276 | } |
| 3225 | 3277 | |
| r15120 | r15121 | |
| 3275 | 3327 | WRMEM_W(cpustate, addr, imm16); |
| 3276 | 3328 | } |
| 3277 | 3329 | |
| 3278 | | static void Z4D_0000_0101_addr_imm16_seg(z8000_state *cpustate) |
| 3279 | | { |
| 3280 | | static UINT32 offset; |
| 3281 | | UINT16 operand1 = fetch(cpustate); |
| 3282 | | |
| 3283 | | if(operand1 & 0x8000) |
| 3284 | | { |
| 3285 | | UINT16 operand2 = fetch(cpustate); |
| 3286 | | UINT16 imm16 = fetch(cpustate); |
| 3287 | | |
| 3288 | | offset = (operand1 & 0x0700) << 8; |
| 3289 | | offset|= (operand2 & 0xffff); |
| 3290 | | WRMEM_W(cpustate, offset, imm16); |
| 3291 | | cycles(cpustate, 17); |
| 3292 | | } |
| 3293 | | else |
| 3294 | | { |
| 3295 | | UINT16 imm16 = fetch(cpustate); |
| 3296 | | |
| 3297 | | offset = (operand1 & 0x0700) << 8; |
| 3298 | | offset|= (operand1 & 0x00ff); |
| 3299 | | WRMEM_W(cpustate, offset, imm16); |
| 3300 | | cycles(cpustate, 15); |
| 3301 | | } |
| 3302 | | } |
| 3303 | | |
| 3304 | 3330 | /****************************************** |
| 3305 | 3331 | tset addr |
| 3306 | 3332 | flags: --S--- |
| r15120 | r15121 | |
| 3322 | 3348 | WRMEM_W(cpustate, addr, 0); |
| 3323 | 3349 | } |
| 3324 | 3350 | |
| 3325 | | static void Z4D_0000_1000_addr_seg(z8000_state *cpustate) |
| 3326 | | { |
| 3327 | | static UINT32 offset; |
| 3328 | | UINT16 operand1 = fetch(cpustate); |
| 3329 | | |
| 3330 | | if(operand1 & 0x8000) |
| 3331 | | { |
| 3332 | | UINT16 operand2 = fetch(cpustate); |
| 3333 | | |
| 3334 | | offset = (operand1 & 0x0700) << 8; |
| 3335 | | offset|= (operand2 & 0xffff); |
| 3336 | | WRMEM_W(cpustate, offset, 0); |
| 3337 | | cycles(cpustate, 15); |
| 3338 | | } |
| 3339 | | else |
| 3340 | | { |
| 3341 | | offset = (operand1 & 0x0700) << 8; |
| 3342 | | offset|= (operand1 & 0x00ff); |
| 3343 | | WRMEM_W(cpustate, offset, 0); |
| 3344 | | cycles(cpustate, 12); |
| 3345 | | } |
| 3346 | | } |
| 3347 | | |
| 3348 | 3351 | /****************************************** |
| 3349 | 3352 | com addr(rd) |
| 3350 | 3353 | flags: -ZS--- |
| r15120 | r15121 | |
| 3353 | 3356 | { |
| 3354 | 3357 | GET_DST(OP0,NIB2); |
| 3355 | 3358 | GET_ADDR(OP1); |
| 3356 | | addr += cpustate->RW(dst); |
| 3359 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3357 | 3360 | WRMEM_W(cpustate, addr, COMW(cpustate, RDMEM_W(cpustate, addr))); |
| 3358 | 3361 | } |
| 3359 | 3362 | |
| r15120 | r15121 | |
| 3366 | 3369 | GET_DST(OP0,NIB2); |
| 3367 | 3370 | GET_ADDR(OP1); |
| 3368 | 3371 | GET_IMM16(OP2); |
| 3369 | | addr += cpustate->RW(dst); |
| 3372 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3370 | 3373 | CPW(cpustate, RDMEM_W(cpustate, addr), imm16); |
| 3371 | 3374 | } |
| 3372 | 3375 | |
| r15120 | r15121 | |
| 3378 | 3381 | { |
| 3379 | 3382 | GET_DST(OP0,NIB2); |
| 3380 | 3383 | GET_ADDR(OP1); |
| 3381 | | addr += cpustate->RW(dst); |
| 3384 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3382 | 3385 | WRMEM_W(cpustate, addr, NEGW(cpustate, RDMEM_W(cpustate, addr))); |
| 3383 | 3386 | } |
| 3384 | 3387 | |
| r15120 | r15121 | |
| 3390 | 3393 | { |
| 3391 | 3394 | GET_DST(OP0,NIB2); |
| 3392 | 3395 | GET_ADDR(OP1); |
| 3393 | | addr += cpustate->RW(dst); |
| 3396 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3394 | 3397 | TESTW(cpustate, RDMEM_W(cpustate, addr)); |
| 3395 | 3398 | } |
| 3396 | 3399 | |
| r15120 | r15121 | |
| 3403 | 3406 | GET_DST(OP0,NIB2); |
| 3404 | 3407 | GET_ADDR(OP1); |
| 3405 | 3408 | GET_IMM16(OP2); |
| 3406 | | addr += cpustate->RW(dst); |
| 3409 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3407 | 3410 | WRMEM_W(cpustate, addr, imm16); |
| 3408 | 3411 | } |
| 3409 | 3412 | |
| r15120 | r15121 | |
| 3415 | 3418 | { |
| 3416 | 3419 | GET_DST(OP0,NIB2); |
| 3417 | 3420 | GET_ADDR(OP1); |
| 3418 | | addr += cpustate->RW(dst); |
| 3421 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3419 | 3422 | if (RDMEM_W(cpustate, addr) & S16) SET_S; else CLR_S; |
| 3420 | 3423 | WRMEM_W(cpustate, addr, 0xffff); |
| 3421 | 3424 | } |
| r15120 | r15121 | |
| 3428 | 3431 | { |
| 3429 | 3432 | GET_DST(OP0,NIB2); |
| 3430 | 3433 | GET_ADDR(OP1); |
| 3431 | | addr += cpustate->RW(dst); |
| 3434 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3432 | 3435 | WRMEM_W(cpustate, addr, 0); |
| 3433 | 3436 | } |
| 3434 | 3437 | |
| r15120 | r15121 | |
| 3441 | 3444 | GET_DST(OP0,NIB2); |
| 3442 | 3445 | GET_SRC(OP0,NIB3); |
| 3443 | 3446 | GET_ADDR(OP1); |
| 3444 | | addr += cpustate->RW(dst); |
| 3447 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3445 | 3448 | WRMEM_B(cpustate, addr, cpustate->RB(src)); |
| 3446 | 3449 | } |
| 3447 | 3450 | |
| r15120 | r15121 | |
| 3465 | 3468 | GET_DST(OP0,NIB3); |
| 3466 | 3469 | GET_SRC(OP0,NIB2); |
| 3467 | 3470 | GET_ADDR(OP1); |
| 3468 | | addr += cpustate->RW(src); |
| 3471 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3469 | 3472 | CPL(cpustate, cpustate->RL(dst), RDMEM_L(cpustate, addr)); |
| 3470 | 3473 | } |
| 3471 | 3474 | |
| r15120 | r15121 | |
| 3489 | 3492 | GET_SRC(OP0,NIB3); |
| 3490 | 3493 | GET_DST(OP0,NIB2); |
| 3491 | 3494 | GET_ADDR(OP1); |
| 3492 | | addr += cpustate->RW(src); |
| 3495 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3493 | 3496 | PUSHL(cpustate, dst, RDMEM_L(cpustate, addr)); |
| 3494 | 3497 | } |
| 3495 | 3498 | |
| r15120 | r15121 | |
| 3513 | 3516 | GET_DST(OP0,NIB3); |
| 3514 | 3517 | GET_SRC(OP0,NIB2); |
| 3515 | 3518 | GET_ADDR(OP1); |
| 3516 | | addr += cpustate->RW(src); |
| 3519 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3517 | 3520 | cpustate->RL(dst) = SUBL(cpustate, cpustate->RL(dst), RDMEM_L(cpustate, addr)); |
| 3518 | 3521 | } |
| 3519 | 3522 | |
| r15120 | r15121 | |
| 3537 | 3540 | GET_DST(OP0,NIB2); |
| 3538 | 3541 | GET_SRC(OP0,NIB3); |
| 3539 | 3542 | GET_ADDR(OP1); |
| 3540 | | addr += cpustate->RW(src); |
| 3543 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3541 | 3544 | PUSHW(cpustate, dst, RDMEM_W(cpustate, addr)); |
| 3542 | 3545 | } |
| 3543 | 3546 | |
| r15120 | r15121 | |
| 3561 | 3564 | GET_DST(OP0,NIB3); |
| 3562 | 3565 | GET_SRC(OP0,NIB2); |
| 3563 | 3566 | GET_ADDR(OP1); |
| 3564 | | addr += cpustate->RW(src); |
| 3567 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3565 | 3568 | cpustate->RL(dst) = RDMEM_L(cpustate, addr); |
| 3566 | 3569 | } |
| 3567 | 3570 | |
| r15120 | r15121 | |
| 3585 | 3588 | GET_DST(OP0,NIB3); |
| 3586 | 3589 | GET_SRC(OP0,NIB2); |
| 3587 | 3590 | GET_ADDR(OP1); |
| 3588 | | addr += cpustate->RW(dst); |
| 3591 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3589 | 3592 | WRMEM_L(cpustate, addr, POPL(cpustate, src)); |
| 3590 | 3593 | } |
| 3591 | 3594 | |
| r15120 | r15121 | |
| 3609 | 3612 | GET_DST(OP0,NIB3); |
| 3610 | 3613 | GET_SRC(OP0,NIB2); |
| 3611 | 3614 | GET_ADDR(OP1); |
| 3612 | | addr += cpustate->RW(src); |
| 3615 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3613 | 3616 | cpustate->RL(dst) = ADDL(cpustate, cpustate->RL(dst), RDMEM_L(cpustate, addr)); |
| 3614 | 3617 | } |
| 3615 | 3618 | |
| r15120 | r15121 | |
| 3633 | 3636 | GET_DST(OP0,NIB3); |
| 3634 | 3637 | GET_SRC(OP0,NIB2); |
| 3635 | 3638 | GET_ADDR(OP1); |
| 3636 | | addr += cpustate->RW(dst); |
| 3639 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3637 | 3640 | WRMEM_W(cpustate, addr, POPW(cpustate, src)); |
| 3638 | 3641 | } |
| 3639 | 3642 | |
| r15120 | r15121 | |
| 3657 | 3660 | GET_DST(OP0,NIB3); |
| 3658 | 3661 | GET_SRC(OP0,NIB2); |
| 3659 | 3662 | GET_ADDR(OP1); |
| 3660 | | addr += cpustate->RW(src); |
| 3663 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3661 | 3664 | cpustate->RQ(dst) = MULTL(cpustate, cpustate->RQ(dst), RDMEM_L(cpustate, addr)); |
| 3662 | 3665 | } |
| 3663 | 3666 | |
| r15120 | r15121 | |
| 3681 | 3684 | GET_DST(OP0,NIB3); |
| 3682 | 3685 | GET_SRC(OP0,NIB2); |
| 3683 | 3686 | GET_ADDR(OP1); |
| 3684 | | addr += cpustate->RW(src); |
| 3687 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3685 | 3688 | cpustate->RL(dst) = MULTW(cpustate, cpustate->RL(dst), RDMEM_W(cpustate, addr)); |
| 3686 | 3689 | } |
| 3687 | 3690 | |
| r15120 | r15121 | |
| 3705 | 3708 | GET_DST(OP0,NIB3); |
| 3706 | 3709 | GET_SRC(OP0,NIB2); |
| 3707 | 3710 | GET_ADDR(OP1); |
| 3708 | | addr += cpustate->RW(src); |
| 3711 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3709 | 3712 | cpustate->RQ(dst) = DIVL(cpustate, cpustate->RQ(dst), RDMEM_L(cpustate, addr)); |
| 3710 | 3713 | } |
| 3711 | 3714 | |
| r15120 | r15121 | |
| 3729 | 3732 | GET_DST(OP0,NIB3); |
| 3730 | 3733 | GET_SRC(OP0,NIB2); |
| 3731 | 3734 | GET_ADDR(OP1); |
| 3732 | | addr += cpustate->RW(src); |
| 3735 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3733 | 3736 | cpustate->RL(dst) = DIVW(cpustate, cpustate->RL(dst), RDMEM_W(cpustate, addr)); |
| 3734 | 3737 | } |
| 3735 | 3738 | |
| r15120 | r15121 | |
| 3745 | 3748 | while (cnt-- >= 0) { |
| 3746 | 3749 | cpustate->RW(dst) = RDMEM_W(cpustate, addr); |
| 3747 | 3750 | dst = (dst+1) & 15; |
| 3748 | | addr = (addr + 2) & 0xffff; |
| 3751 | addr = addr_add (cpustate, addr, 2); |
| 3749 | 3752 | } |
| 3750 | 3753 | } |
| 3751 | 3754 | |
| r15120 | r15121 | |
| 3771 | 3774 | while (cnt-- >= 0) { |
| 3772 | 3775 | WRMEM_W(cpustate, addr, cpustate->RW(src)); |
| 3773 | 3776 | src = (src+1) & 15; |
| 3774 | | addr = (addr + 2) & 0xffff; |
| 3777 | addr = addr_add (cpustate, addr, 2); |
| 3775 | 3778 | } |
| 3776 | 3779 | } |
| 3777 | 3780 | |
| r15120 | r15121 | |
| 3783 | 3786 | { |
| 3784 | 3787 | GET_DST(OP0,NIB2); |
| 3785 | 3788 | GET_ADDR(OP1); |
| 3786 | | addr += cpustate->RW(dst); |
| 3789 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3787 | 3790 | TESTL(cpustate, RDMEM_L(cpustate, addr)); |
| 3788 | 3791 | } |
| 3789 | 3792 | |
| r15120 | r15121 | |
| 3797 | 3800 | GET_SRC(OP1,NIB1); |
| 3798 | 3801 | GET_CNT(OP1,NIB3); |
| 3799 | 3802 | GET_ADDR(OP2); |
| 3800 | | addr += cpustate->RW(dst); |
| 3803 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3801 | 3804 | while (cnt-- >= 0) { |
| 3802 | 3805 | WRMEM_W(cpustate, addr, cpustate->RW(src)); |
| 3803 | 3806 | src = (src+1) & 15; |
| 3804 | | addr = (addr + 2) & 0xffff; |
| 3807 | addr = addr_add(cpustate, addr, 2); |
| 3805 | 3808 | } |
| 3806 | 3809 | } |
| 3807 | 3810 | |
| r15120 | r15121 | |
| 3815 | 3818 | GET_DST(OP1,NIB1); |
| 3816 | 3819 | GET_CNT(OP1,NIB3); |
| 3817 | 3820 | GET_ADDR(OP2); |
| 3818 | | addr += cpustate->RW(src); |
| 3821 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3819 | 3822 | while (cnt-- >= 0) { |
| 3820 | 3823 | cpustate->RW(dst) = RDMEM_W(cpustate, addr); |
| 3821 | 3824 | dst = (dst+1) & 15; |
| 3822 | | addr = (addr + 2) & 0xffff; |
| 3825 | addr = addr_add(cpustate, addr, 2); |
| 3823 | 3826 | } |
| 3824 | 3827 | } |
| 3825 | 3828 | |
| r15120 | r15121 | |
| 3843 | 3846 | GET_SRC(OP0,NIB3); |
| 3844 | 3847 | GET_DST(OP0,NIB2); |
| 3845 | 3848 | GET_ADDR(OP1); |
| 3846 | | addr += cpustate->RW(dst); |
| 3849 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3847 | 3850 | WRMEM_L(cpustate, addr, cpustate->RL(src)); |
| 3848 | 3851 | } |
| 3849 | 3852 | |
| r15120 | r15121 | |
| 3884 | 3887 | GET_CCC(OP0,NIB3); |
| 3885 | 3888 | GET_DST(OP0,NIB2); |
| 3886 | 3889 | GET_ADDR(OP1); |
| 3887 | | addr += cpustate->RW(dst); |
| 3890 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3888 | 3891 | switch (cc) { |
| 3889 | 3892 | case 0: if (CC0) cpustate->pc = addr; break; |
| 3890 | 3893 | case 1: if (CC1) cpustate->pc = addr; break; |
| r15120 | r15121 | |
| 3912 | 3915 | static void Z5F_0000_0000_addr(z8000_state *cpustate) |
| 3913 | 3916 | { |
| 3914 | 3917 | GET_ADDR(OP1); |
| 3915 | | PUSHW(cpustate, SP, cpustate->pc); |
| 3918 | if (segmented_mode(cpustate)) |
| 3919 | PUSHL(cpustate, SP, make_segmented_addr(cpustate->pc)); |
| 3920 | else |
| 3921 | PUSHW(cpustate, SP, cpustate->pc); |
| 3916 | 3922 | cpustate->pc = addr; |
| 3917 | 3923 | } |
| 3918 | 3924 | |
| r15120 | r15121 | |
| 3924 | 3930 | { |
| 3925 | 3931 | GET_DST(OP0,NIB2); |
| 3926 | 3932 | GET_ADDR(OP1); |
| 3927 | | PUSHW(cpustate, SP, cpustate->pc); |
| 3928 | | addr += cpustate->RW(dst); |
| 3933 | if (segmented_mode(cpustate)) |
| 3934 | PUSHL(cpustate, SP, make_segmented_addr(cpustate->pc)); |
| 3935 | else |
| 3936 | PUSHW(cpustate, SP, cpustate->pc); |
| 3937 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 3929 | 3938 | cpustate->pc = addr; |
| 3930 | 3939 | } |
| 3931 | 3940 | |
| r15120 | r15121 | |
| 3949 | 3958 | GET_DST(OP0,NIB3); |
| 3950 | 3959 | GET_SRC(OP0,NIB2); |
| 3951 | 3960 | GET_ADDR(OP1); |
| 3952 | | addr += cpustate->RW(src); |
| 3961 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3953 | 3962 | cpustate->RB(dst) = RDMEM_B(cpustate, addr); |
| 3954 | 3963 | } |
| 3955 | 3964 | |
| r15120 | r15121 | |
| 3973 | 3982 | GET_DST(OP0,NIB3); |
| 3974 | 3983 | GET_SRC(OP0,NIB2); |
| 3975 | 3984 | GET_ADDR(OP1); |
| 3976 | | addr += cpustate->RW(src); |
| 3985 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 3977 | 3986 | cpustate->RW(dst) = RDMEM_W(cpustate, addr); |
| 3978 | 3987 | } |
| 3979 | 3988 | |
| r15120 | r15121 | |
| 3997 | 4006 | GET_BIT(OP0); |
| 3998 | 4007 | GET_DST(OP0,NIB2); |
| 3999 | 4008 | GET_ADDR(OP1); |
| 4000 | | addr += cpustate->RW(dst); |
| 4009 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 4001 | 4010 | WRMEM_B(cpustate, addr, RDMEM_B(cpustate, addr) & ~bit); |
| 4002 | 4011 | } |
| 4003 | 4012 | |
| r15120 | r15121 | |
| 4021 | 4030 | GET_BIT(OP0); |
| 4022 | 4031 | GET_DST(OP0,NIB2); |
| 4023 | 4032 | GET_ADDR(OP1); |
| 4024 | | addr += cpustate->RW(dst); |
| 4033 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 4025 | 4034 | WRMEM_W(cpustate, addr, RDMEM_W(cpustate, addr) & ~bit); |
| 4026 | 4035 | } |
| 4027 | 4036 | |
| r15120 | r15121 | |
| 4045 | 4054 | GET_BIT(OP0); |
| 4046 | 4055 | GET_DST(OP0,NIB2); |
| 4047 | 4056 | GET_ADDR(OP1); |
| 4048 | | addr += cpustate->RW(dst); |
| 4057 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 4049 | 4058 | WRMEM_B(cpustate, addr, RDMEM_B(cpustate, addr) | bit); |
| 4050 | 4059 | } |
| 4051 | 4060 | |
| r15120 | r15121 | |
| 4069 | 4078 | GET_BIT(OP0); |
| 4070 | 4079 | GET_DST(OP0,NIB2); |
| 4071 | 4080 | GET_ADDR(OP1); |
| 4072 | | addr += cpustate->RW(dst); |
| 4081 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 4073 | 4082 | WRMEM_W(cpustate, addr, RDMEM_W(cpustate, addr) | bit); |
| 4074 | 4083 | } |
| 4075 | 4084 | |
| r15120 | r15121 | |
| 4093 | 4102 | GET_BIT(OP0); |
| 4094 | 4103 | GET_DST(OP0,NIB2); |
| 4095 | 4104 | GET_ADDR(OP1); |
| 4096 | | addr += cpustate->RW(dst); |
| 4105 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 4097 | 4106 | if (RDMEM_B(cpustate, addr) & bit) CLR_Z; else SET_Z; |
| 4098 | 4107 | } |
| 4099 | 4108 | |
| r15120 | r15121 | |
| 4117 | 4126 | GET_BIT(OP0); |
| 4118 | 4127 | GET_DST(OP0,NIB2); |
| 4119 | 4128 | GET_ADDR(OP1); |
| 4120 | | addr += cpustate->RW(dst); |
| 4129 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 4121 | 4130 | if (RDMEM_W(cpustate, addr) & bit) CLR_Z; else SET_Z; |
| 4122 | 4131 | } |
| 4123 | 4132 | |
| r15120 | r15121 | |
| 4141 | 4150 | GET_I4M1(OP0,NIB3); |
| 4142 | 4151 | GET_DST(OP0,NIB2); |
| 4143 | 4152 | GET_ADDR(OP1); |
| 4144 | | addr += cpustate->RW(dst); |
| 4153 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 4145 | 4154 | WRMEM_B(cpustate, addr, INCB(cpustate, RDMEM_B(cpustate, addr), i4p1)); |
| 4146 | 4155 | } |
| 4147 | 4156 | |
| r15120 | r15121 | |
| 4165 | 4174 | GET_I4M1(OP0,NIB3); |
| 4166 | 4175 | GET_DST(OP0,NIB2); |
| 4167 | 4176 | GET_ADDR(OP1); |
| 4168 | | addr += cpustate->RW(dst); |
| 4177 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 4169 | 4178 | WRMEM_W(cpustate, addr, INCW(cpustate, RDMEM_W(cpustate, addr), i4p1)); |
| 4170 | 4179 | } |
| 4171 | 4180 | |
| r15120 | r15121 | |
| 4189 | 4198 | GET_I4M1(OP0,NIB3); |
| 4190 | 4199 | GET_DST(OP0,NIB2); |
| 4191 | 4200 | GET_ADDR(OP1); |
| 4192 | | addr += cpustate->RW(dst); |
| 4201 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 4193 | 4202 | WRMEM_B(cpustate, addr, DECB(cpustate, RDMEM_B(cpustate, addr), i4p1)); |
| 4194 | 4203 | } |
| 4195 | 4204 | |
| r15120 | r15121 | |
| 4213 | 4222 | GET_I4M1(OP0,NIB3); |
| 4214 | 4223 | GET_DST(OP0,NIB2); |
| 4215 | 4224 | GET_ADDR(OP1); |
| 4216 | | addr += cpustate->RW(dst); |
| 4225 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 4217 | 4226 | WRMEM_W(cpustate, addr, DECW(cpustate, RDMEM_W(cpustate, addr), i4p1)); |
| 4218 | 4227 | } |
| 4219 | 4228 | |
| r15120 | r15121 | |
| 4240 | 4249 | GET_SRC(OP0,NIB2); |
| 4241 | 4250 | GET_ADDR(OP1); |
| 4242 | 4251 | UINT8 tmp; |
| 4243 | | addr += cpustate->RW(src); |
| 4252 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 4244 | 4253 | tmp = RDMEM_B(cpustate, addr); |
| 4245 | 4254 | WRMEM_B(cpustate, addr, cpustate->RB(dst)); |
| 4246 | 4255 | cpustate->RB(dst) = tmp; |
| r15120 | r15121 | |
| 4269 | 4278 | GET_SRC(OP0,NIB2); |
| 4270 | 4279 | GET_ADDR(OP1); |
| 4271 | 4280 | UINT16 tmp; |
| 4272 | | addr += cpustate->RW(src); |
| 4281 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 4273 | 4282 | tmp = RDMEM_W(cpustate, addr); |
| 4274 | 4283 | WRMEM_W(cpustate, addr, cpustate->RW(dst)); |
| 4275 | 4284 | cpustate->RW(dst) = tmp; |
| r15120 | r15121 | |
| 4295 | 4304 | GET_SRC(OP0,NIB3); |
| 4296 | 4305 | GET_DST(OP0,NIB2); |
| 4297 | 4306 | GET_ADDR(OP1); |
| 4298 | | addr += cpustate->RW(dst); |
| 4307 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 4299 | 4308 | WRMEM_B(cpustate, addr, cpustate->RB(src)); |
| 4300 | 4309 | } |
| 4301 | 4310 | |
| r15120 | r15121 | |
| 4319 | 4328 | GET_SRC(OP0,NIB3); |
| 4320 | 4329 | GET_DST(OP0,NIB2); |
| 4321 | 4330 | GET_ADDR(OP1); |
| 4322 | | addr += cpustate->RW(dst); |
| 4331 | addr = addr_add(cpustate, addr, cpustate->RW(dst)); |
| 4323 | 4332 | WRMEM_W(cpustate, addr, cpustate->RW(src)); |
| 4324 | 4333 | } |
| 4325 | 4334 | |
| r15120 | r15121 | |
| 4332 | 4341 | GET_DST(OP0,NIB3); |
| 4333 | 4342 | GET_SRC(OP0,NIB2); |
| 4334 | 4343 | GET_IDX(OP1,NIB1); |
| 4335 | | cpustate->RB(dst) = RDMEM_B(cpustate, (UINT16)(cpustate->RW(src) + cpustate->RW(idx))); |
| 4344 | cpustate->RB(dst) = RDMEM_B(cpustate, addr_add(cpustate, addr_from_reg(cpustate, src), cpustate->RW(idx))); |
| 4336 | 4345 | } |
| 4337 | 4346 | |
| 4338 | 4347 | /****************************************** |
| r15120 | r15121 | |
| 4344 | 4353 | GET_DST(OP0,NIB3); |
| 4345 | 4354 | GET_SRC(OP0,NIB2); |
| 4346 | 4355 | GET_IDX(OP1,NIB1); |
| 4347 | | cpustate->RW(dst) = RDMEM_W(cpustate, (UINT16)(cpustate->RW(src) + cpustate->RW(idx))); |
| 4356 | cpustate->RW(dst) = RDMEM_W(cpustate, addr_add(cpustate, addr_from_reg(cpustate, src), cpustate->RW(idx))); |
| 4348 | 4357 | } |
| 4349 | 4358 | |
| 4350 | 4359 | /****************************************** |
| r15120 | r15121 | |
| 4356 | 4365 | GET_SRC(OP0,NIB3); |
| 4357 | 4366 | GET_DST(OP0,NIB2); |
| 4358 | 4367 | GET_IDX(OP1,NIB1); |
| 4359 | | WRMEM_B(cpustate, (UINT16)(cpustate->RW(dst) + cpustate->RW(idx)), cpustate->RB(src)); |
| 4368 | WRMEM_B(cpustate, addr_add(cpustate, addr_from_reg(cpustate, dst), cpustate->RW(idx)), cpustate->RB(src)); |
| 4360 | 4369 | } |
| 4361 | 4370 | |
| 4362 | 4371 | /****************************************** |
| r15120 | r15121 | |
| 4368 | 4377 | GET_SRC(OP0,NIB3); |
| 4369 | 4378 | GET_DST(OP0,NIB2); |
| 4370 | 4379 | GET_IDX(OP1,NIB1); |
| 4371 | | WRMEM_W(cpustate, (UINT16)(cpustate->RW(dst) + cpustate->RW(idx)), cpustate->RW(src)); |
| 4380 | WRMEM_W(cpustate, addr_add(cpustate, addr_from_reg(cpustate, dst), cpustate->RW(idx)), cpustate->RW(src)); |
| 4372 | 4381 | } |
| 4373 | 4382 | |
| 4374 | 4383 | /****************************************** |
| r15120 | r15121 | |
| 4380 | 4389 | GET_DST(OP0,NIB3); |
| 4381 | 4390 | GET_SRC(OP0,NIB2); |
| 4382 | 4391 | GET_IDX(OP1,NIB1); |
| 4383 | | cpustate->RW(dst) = (UINT16)(cpustate->RW(src) + cpustate->RW(idx)); |
| 4392 | addr_to_reg(cpustate, dst, addr_add(cpustate, addr_from_reg(cpustate, src), cpustate->RW(idx))); |
| 4384 | 4393 | } |
| 4385 | 4394 | |
| 4386 | 4395 | /****************************************** |
| r15120 | r15121 | |
| 4392 | 4401 | GET_DST(OP0,NIB3); |
| 4393 | 4402 | GET_SRC(OP0,NIB2); |
| 4394 | 4403 | GET_IDX(OP1,NIB1); |
| 4395 | | cpustate->RL(dst) = RDMEM_L(cpustate, (UINT16)(cpustate->RW(src) + cpustate->RW(idx))); |
| 4404 | cpustate->RL(dst) = RDMEM_L(cpustate, addr_add(cpustate, addr_from_reg(cpustate, src), cpustate->RW(idx))); |
| 4396 | 4405 | } |
| 4397 | 4406 | |
| 4398 | 4407 | /****************************************** |
| r15120 | r15121 | |
| 4403 | 4412 | { |
| 4404 | 4413 | GET_DST(OP0,NIB3); |
| 4405 | 4414 | GET_ADDR(OP1); |
| 4406 | | cpustate->RW(dst) = addr; |
| 4415 | addr_to_reg(cpustate, dst, addr); |
| 4407 | 4416 | } |
| 4408 | 4417 | |
| 4409 | | static void Z76_0000_dddd_addr_seg(z8000_state *cpustate) |
| 4410 | | { |
| 4411 | | static UINT32 offset; |
| 4412 | | UINT16 operand1; |
| 4413 | | |
| 4414 | | GET_DST(OP0,NIB3); |
| 4415 | | operand1 = fetch(cpustate); |
| 4416 | | |
| 4417 | | if(operand1 & 0x8000) |
| 4418 | | { |
| 4419 | | UINT16 operand2 = fetch(cpustate); |
| 4420 | | |
| 4421 | | offset = (operand1 & 0x0700) << 8; |
| 4422 | | offset|= (operand2 & 0xffff); |
| 4423 | | cpustate->RW(dst) = (offset & 0x70000) >> 16; |
| 4424 | | cpustate->RW(dst+1) = offset & 0xffff; |
| 4425 | | cycles(cpustate, 15); |
| 4426 | | } |
| 4427 | | else |
| 4428 | | { |
| 4429 | | offset = (operand1 & 0x0700) << 8; |
| 4430 | | offset|= (operand1 & 0x00ff); |
| 4431 | | cpustate->RW(dst) = (offset & 0x70000) >> 16; |
| 4432 | | cpustate->RW(dst+1) = offset & 0x00ff; |
| 4433 | | cycles(cpustate, 13); |
| 4434 | | } |
| 4435 | | } |
| 4436 | | |
| 4437 | 4418 | /****************************************** |
| 4438 | 4419 | lda prd,addr(rs) |
| 4439 | 4420 | flags: ------ |
| r15120 | r15121 | |
| 4443 | 4424 | GET_DST(OP0,NIB3); |
| 4444 | 4425 | GET_SRC(OP0,NIB2); |
| 4445 | 4426 | GET_ADDR(OP1); |
| 4446 | | addr += cpustate->RW(src); |
| 4447 | | cpustate->RW(dst) = addr; |
| 4427 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 4428 | addr_to_reg(cpustate, dst, addr); |
| 4448 | 4429 | } |
| 4449 | 4430 | |
| 4450 | 4431 | /****************************************** |
| r15120 | r15121 | |
| 4456 | 4437 | GET_SRC(OP0,NIB3); |
| 4457 | 4438 | GET_DST(OP0,NIB2); |
| 4458 | 4439 | GET_IDX(OP1,NIB1); |
| 4459 | | WRMEM_L(cpustate, (UINT16)(cpustate->RW(dst) + cpustate->RW(idx)), cpustate->RL(src)); |
| 4440 | WRMEM_L(cpustate, addr_add(cpustate, addr_from_reg(cpustate, dst), cpustate->RW(idx)), cpustate->RL(src)); |
| 4460 | 4441 | } |
| 4461 | 4442 | |
| 4462 | 4443 | /****************************************** |
| r15120 | r15121 | |
| 4481 | 4462 | { |
| 4482 | 4463 | GET_ADDR(OP1); |
| 4483 | 4464 | UINT16 fcw; |
| 4484 | | fcw = RDMEM_W(cpustate, addr); |
| 4485 | | cpustate->pc = RDMEM_W(cpustate, (UINT16)(addr + 2)); |
| 4465 | //printf("LDPS from 0x%x: old pc: 0x%x\n", addr, cpustate->pc); |
| 4466 | if (segmented_mode(cpustate)) { |
| 4467 | fcw = RDMEM_W(cpustate, addr + 2); |
| 4468 | cpustate->pc = segmented_addr(RDMEM_L(cpustate, addr + 4)); |
| 4469 | } |
| 4470 | else { |
| 4471 | fcw = RDMEM_W(cpustate, addr); |
| 4472 | cpustate->pc = RDMEM_W(cpustate, (UINT16)(addr + 2)); |
| 4473 | } |
| 4486 | 4474 | CHANGE_FCW(cpustate, fcw); /* check for user/system mode change */ |
| 4475 | //printf("LDPS: new pc: 0x%x\n", cpustate->pc); |
| 4487 | 4476 | } |
| 4488 | 4477 | |
| 4489 | 4478 | /****************************************** |
| r15120 | r15121 | |
| 4495 | 4484 | GET_SRC(OP0,NIB2); |
| 4496 | 4485 | GET_ADDR(OP1); |
| 4497 | 4486 | UINT16 fcw; |
| 4498 | | addr += cpustate->RW(src); |
| 4499 | | fcw = RDMEM_W(cpustate, addr); |
| 4500 | | cpustate->pc = RDMEM_W(cpustate, (UINT16)(addr + 2)); |
| 4487 | addr = addr_add(cpustate, addr, cpustate->RW(src)); |
| 4488 | if (segmented_mode(cpustate)) { |
| 4489 | fcw = RDMEM_W(cpustate, addr + 2); |
| 4490 | cpustate->pc = segmented_addr(RDMEM_L(cpustate, addr + 4)); |
| 4491 | } |
| 4492 | else { |
| 4493 | fcw = RDMEM_W(cpustate, addr); |
| 4494 | cpustate->pc = RDMEM_W(cpustate, (UINT16)(addr + 2)); |
| 4495 | } |
| 4501 | 4496 | CHANGE_FCW(cpustate, fcw); /* check for user/system mode change */ |
| 4502 | 4497 | } |
| 4503 | 4498 | |
| r15120 | r15121 | |
| 4520 | 4515 | UINT16 tag, fcw; |
| 4521 | 4516 | tag = POPW(cpustate, SP); /* get type tag */ |
| 4522 | 4517 | fcw = POPW(cpustate, SP); /* get cpustate->fcw */ |
| 4523 | | cpustate->pc = POPW(cpustate, SP); /* get cpustate->pc */ |
| 4518 | if (segmented_mode(cpustate)) |
| 4519 | cpustate->pc = segmented_addr(POPL(cpustate, SP)); |
| 4520 | else |
| 4521 | cpustate->pc = POPW(cpustate, SP); /* get cpustate->pc */ |
| 4524 | 4522 | cpustate->irq_srv &= ~tag; /* remove IRQ serviced flag */ |
| 4525 | 4523 | CHANGE_FCW(cpustate, fcw); /* check for user/system mode change */ |
| 4526 | 4524 | LOG(("Z8K '%s' IRET tag $%04x, fcw $%04x, pc $%04x\n", cpustate->device->tag(), tag, fcw, cpustate->pc)); |
| r15120 | r15121 | |
| 4591 | 4589 | flags: ------ |
| 4592 | 4590 | ******************************************/ |
| 4593 | 4591 | static void Z7D_dddd_0ccc(z8000_state *cpustate) |
| 4594 | | { |
| 4592 | {//@@@ |
| 4595 | 4593 | GET_IMM3(OP0,NIB3); |
| 4596 | 4594 | GET_DST(OP0,NIB2); |
| 4597 | 4595 | switch (imm3) { |
| r15120 | r15121 | |
| 4601 | 4599 | case 3: |
| 4602 | 4600 | cpustate->RW(dst) = cpustate->refresh; |
| 4603 | 4601 | break; |
| 4602 | case 4: |
| 4603 | cpustate->RW(dst) = cpustate->psapseg; |
| 4604 | break; |
| 4604 | 4605 | case 5: |
| 4605 | | cpustate->RW(dst) = cpustate->psap; |
| 4606 | cpustate->RW(dst) = cpustate->psapoff; |
| 4606 | 4607 | break; |
| 4607 | 4608 | case 7: |
| 4608 | | cpustate->RW(dst) = cpustate->nsp; |
| 4609 | cpustate->RW(dst) = cpustate->nspoff; |
| 4609 | 4610 | break; |
| 4610 | 4611 | default: |
| 4611 | 4612 | LOG(("Z8K '%s' LDCTL R%d,%d\n", cpustate->device->tag(), dst, imm3)); |
| r15120 | r15121 | |
| 4617 | 4618 | flags: ------ |
| 4618 | 4619 | ******************************************/ |
| 4619 | 4620 | static void Z7D_ssss_1ccc(z8000_state *cpustate) |
| 4620 | | { |
| 4621 | {//@@@ |
| 4621 | 4622 | GET_IMM3(OP0,NIB3); |
| 4622 | 4623 | GET_SRC(OP0,NIB2); |
| 4623 | 4624 | switch (imm3) { |
| r15120 | r15121 | |
| 4631 | 4632 | case 3: |
| 4632 | 4633 | cpustate->refresh = cpustate->RW(src); |
| 4633 | 4634 | break; |
| 4635 | case 4: |
| 4636 | cpustate->psapseg = cpustate->RW(src); |
| 4637 | break; |
| 4634 | 4638 | case 5: |
| 4635 | | cpustate->psap = cpustate->RW(src); |
| 4639 | cpustate->psapoff = cpustate->RW(src); |
| 4636 | 4640 | break; |
| 4637 | 4641 | case 7: |
| 4638 | | cpustate->nsp = cpustate->RW(src); |
| 4642 | cpustate->nspoff = cpustate->RW(src); |
| 4639 | 4643 | break; |
| 4640 | 4644 | default: |
| 4641 | 4645 | LOG(("Z8K '%s' LDCTL %d,R%d\n", cpustate->device->tag(), imm3, src)); |
| r15120 | r15121 | |
| 4842 | 4846 | } |
| 4843 | 4847 | |
| 4844 | 4848 | /****************************************** |
| 4849 | ldctlb rbd,flags |
| 4850 | flags: CZSVDH |
| 4851 | ******************************************/ |
| 4852 | static void Z8C_dddd_0001(z8000_state *cpustate) |
| 4853 | { |
| 4854 | GET_DST(OP0,NIB2); |
| 4855 | cpustate->RB(dst) = cpustate->fcw & 0xfc; |
| 4856 | } |
| 4857 | |
| 4858 | /****************************************** |
| 4845 | 4859 | clrb rbd |
| 4846 | 4860 | flags: ------ |
| 4847 | 4861 | ******************************************/ |
| r15120 | r15121 | |
| 4852 | 4866 | } |
| 4853 | 4867 | |
| 4854 | 4868 | /****************************************** |
| 4869 | ldctlb flags,rbd |
| 4870 | flags: ------ |
| 4871 | ******************************************/ |
| 4872 | static void Z8C_dddd_1001(z8000_state *cpustate) |
| 4873 | { |
| 4874 | GET_DST(OP0,NIB2); |
| 4875 | cpustate->fcw &= ~0x00fc; |
| 4876 | cpustate->fcw |= (cpustate->RB(dst) & 0xfc); |
| 4877 | } |
| 4878 | |
| 4879 | /****************************************** |
| 4855 | 4880 | nop |
| 4856 | 4881 | flags: ------ |
| 4857 | 4882 | ******************************************/ |
| r15120 | r15121 | |
| 4982 | 5007 | flags: ------ |
| 4983 | 5008 | ******************************************/ |
| 4984 | 5009 | static void Z91_ddN0_ssss(z8000_state *cpustate) |
| 4985 | | { |
| 5010 | {//@@@ |
| 4986 | 5011 | GET_SRC(OP0,NIB3); |
| 4987 | 5012 | GET_DST(OP0,NIB2); |
| 4988 | 5013 | PUSHL(cpustate, dst, cpustate->RL(src)); |
| r15120 | r15121 | |
| 5131 | 5156 | static void Z9E_0000_cccc(z8000_state *cpustate) |
| 5132 | 5157 | { |
| 5133 | 5158 | GET_CCC(OP0,NIB3); |
| 5134 | | switch (cc) { |
| 5135 | | case 0: if (CC0) cpustate->pc = POPW(cpustate, SP); break; |
| 5136 | | case 1: if (CC1) cpustate->pc = POPW(cpustate, SP); break; |
| 5137 | | case 2: if (CC2) cpustate->pc = POPW(cpustate, SP); break; |
| 5138 | | case 3: if (CC3) cpustate->pc = POPW(cpustate, SP); break; |
| 5139 | | case 4: if (CC4) cpustate->pc = POPW(cpustate, SP); break; |
| 5140 | | case 5: if (CC5) cpustate->pc = POPW(cpustate, SP); break; |
| 5141 | | case 6: if (CC6) cpustate->pc = POPW(cpustate, SP); break; |
| 5142 | | case 7: if (CC7) cpustate->pc = POPW(cpustate, SP); break; |
| 5143 | | case 8: if (CC8) cpustate->pc = POPW(cpustate, SP); break; |
| 5144 | | case 9: if (CC9) cpustate->pc = POPW(cpustate, SP); break; |
| 5145 | | case 10: if (CCA) cpustate->pc = POPW(cpustate, SP); break; |
| 5146 | | case 11: if (CCB) cpustate->pc = POPW(cpustate, SP); break; |
| 5147 | | case 12: if (CCC) cpustate->pc = POPW(cpustate, SP); break; |
| 5148 | | case 13: if (CCD) cpustate->pc = POPW(cpustate, SP); break; |
| 5149 | | case 14: if (CCE) cpustate->pc = POPW(cpustate, SP); break; |
| 5150 | | case 15: if (CCF) cpustate->pc = POPW(cpustate, SP); break; |
| 5151 | | } |
| 5159 | if (segmented_mode(cpustate)) |
| 5160 | switch (cc) { |
| 5161 | case 0: if (CC0) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5162 | case 1: if (CC1) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5163 | case 2: if (CC2) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5164 | case 3: if (CC3) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5165 | case 4: if (CC4) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5166 | case 5: if (CC5) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5167 | case 6: if (CC6) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5168 | case 7: if (CC7) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5169 | case 8: if (CC8) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5170 | case 9: if (CC9) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5171 | case 10: if (CCA) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5172 | case 11: if (CCB) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5173 | case 12: if (CCC) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5174 | case 13: if (CCD) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5175 | case 14: if (CCE) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5176 | case 15: if (CCF) cpustate->pc = segmented_addr(POPL(cpustate, SP)); break; |
| 5177 | } |
| 5178 | else |
| 5179 | switch (cc) { |
| 5180 | case 0: if (CC0) cpustate->pc = POPW(cpustate, SP); break; |
| 5181 | case 1: if (CC1) cpustate->pc = POPW(cpustate, SP); break; |
| 5182 | case 2: if (CC2) cpustate->pc = POPW(cpustate, SP); break; |
| 5183 | case 3: if (CC3) cpustate->pc = POPW(cpustate, SP); break; |
| 5184 | case 4: if (CC4) cpustate->pc = POPW(cpustate, SP); break; |
| 5185 | case 5: if (CC5) cpustate->pc = POPW(cpustate, SP); break; |
| 5186 | case 6: if (CC6) cpustate->pc = POPW(cpustate, SP); break; |
| 5187 | case 7: if (CC7) cpustate->pc = POPW(cpustate, SP); break; |
| 5188 | case 8: if (CC8) cpustate->pc = POPW(cpustate, SP); break; |
| 5189 | case 9: if (CC9) cpustate->pc = POPW(cpustate, SP); break; |
| 5190 | case 10: if (CCA) cpustate->pc = POPW(cpustate, SP); break; |
| 5191 | case 11: if (CCB) cpustate->pc = POPW(cpustate, SP); break; |
| 5192 | case 12: if (CCC) cpustate->pc = POPW(cpustate, SP); break; |
| 5193 | case 13: if (CCD) cpustate->pc = POPW(cpustate, SP); break; |
| 5194 | case 14: if (CCE) cpustate->pc = POPW(cpustate, SP); break; |
| 5195 | case 15: if (CCF) cpustate->pc = POPW(cpustate, SP); break; |
| 5196 | } |
| 5152 | 5197 | } |
| 5153 | 5198 | |
| 5154 | 5199 | /****************************************** |
| r15120 | r15121 | |
| 5733 | 5778 | flags: -ZSV-- |
| 5734 | 5779 | ******************************************/ |
| 5735 | 5780 | static void ZB8_ddN0_0010_0000_rrrr_ssN0_0000(z8000_state *cpustate) |
| 5736 | | { |
| 5781 | {//@@@ |
| 5737 | 5782 | GET_DST(OP0,NIB2); |
| 5738 | 5783 | GET_SRC(OP1,NIB2); |
| 5739 | 5784 | GET_CNT(OP1,NIB1); |
| r15120 | r15121 | |
| 5749 | 5794 | flags: -ZSV-- |
| 5750 | 5795 | ******************************************/ |
| 5751 | 5796 | static void ZB8_ddN0_0110_0000_rrrr_ssN0_1110(z8000_state *cpustate) |
| 5752 | | { |
| 5797 | {//@@@ |
| 5753 | 5798 | GET_DST(OP0,NIB2); |
| 5754 | 5799 | GET_SRC(OP1,NIB2); |
| 5755 | 5800 | GET_CNT(OP1,NIB1); |
| r15120 | r15121 | |
| 5765 | 5810 | flags: -ZSV-- |
| 5766 | 5811 | ******************************************/ |
| 5767 | 5812 | static void ZB8_ddN0_1010_0000_rrrr_ssN0_0000(z8000_state *cpustate) |
| 5768 | | { |
| 5813 | {//@@@ |
| 5769 | 5814 | GET_DST(OP0,NIB2); |
| 5770 | 5815 | GET_SRC(OP1,NIB2); |
| 5771 | 5816 | GET_CNT(OP1,NIB1); |
| r15120 | r15121 | |
| 5781 | 5826 | flags: -ZSV-- |
| 5782 | 5827 | ******************************************/ |
| 5783 | 5828 | static void ZB8_ddN0_1110_0000_rrrr_ssN0_1110(z8000_state *cpustate) |
| 5784 | | { |
| 5829 | {//@@@ |
| 5785 | 5830 | GET_DST(OP0,NIB2); |
| 5786 | 5831 | GET_SRC(OP1,NIB2); |
| 5787 | 5832 | GET_CNT(OP1,NIB1); |
| r15120 | r15121 | |
| 5797 | 5842 | flags: -ZSV-- |
| 5798 | 5843 | ******************************************/ |
| 5799 | 5844 | static void ZB8_ddN0_0000_0000_rrrr_ssN0_0000(z8000_state *cpustate) |
| 5800 | | { |
| 5845 | {//@@@ |
| 5801 | 5846 | GET_DST(OP0,NIB2); |
| 5802 | 5847 | GET_SRC(OP1,NIB2); |
| 5803 | 5848 | GET_CNT(OP1,NIB1); |
| r15120 | r15121 | |
| 5812 | 5857 | flags: -ZSV-- |
| 5813 | 5858 | ******************************************/ |
| 5814 | 5859 | static void ZB8_ddN0_0100_0000_rrrr_ssN0_0000(z8000_state *cpustate) |
| 5815 | | { |
| 5860 | {//@@@ |
| 5816 | 5861 | GET_DST(OP0,NIB2); |
| 5817 | 5862 | GET_SRC(OP1,NIB2); |
| 5818 | 5863 | GET_CNT(OP1,NIB1); |
| r15120 | r15121 | |
| 5827 | 5872 | flags: -ZSV-- |
| 5828 | 5873 | ******************************************/ |
| 5829 | 5874 | static void ZB8_ddN0_1000_0000_rrrr_ssN0_0000(z8000_state *cpustate) |
| 5830 | | { |
| 5875 | {//@@@ |
| 5831 | 5876 | GET_DST(OP0,NIB2); |
| 5832 | 5877 | GET_SRC(OP1,NIB2); |
| 5833 | 5878 | GET_CNT(OP1,NIB1); |
| r15120 | r15121 | |
| 5842 | 5887 | flags: -ZSV-- |
| 5843 | 5888 | ******************************************/ |
| 5844 | 5889 | static void ZB8_ddN0_1100_0000_rrrr_ssN0_0000(z8000_state *cpustate) |
| 5845 | | { |
| 5890 | {//@@@ |
| 5846 | 5891 | GET_DST(OP0,NIB2); |
| 5847 | 5892 | GET_SRC(OP1,NIB2); |
| 5848 | 5893 | GET_CNT(OP1,NIB1); |
| r15120 | r15121 | |
| 5877 | 5922 | GET_CCC(OP1,NIB3); |
| 5878 | 5923 | GET_DST(OP1,NIB2); |
| 5879 | 5924 | GET_CNT(OP1,NIB1); |
| 5880 | | CPB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, cpustate->RW(src))); |
| 5925 | CPB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 5881 | 5926 | switch (cc) { |
| 5882 | 5927 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 5883 | 5928 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 5896 | 5941 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 5897 | 5942 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 5898 | 5943 | } |
| 5899 | | cpustate->RW(src)++; |
| 5944 | addr_to_reg(cpustate, src, addr_add(cpustate, addr_from_reg(cpustate, src), 1)); |
| 5900 | 5945 | if (--cpustate->RW(cnt)) CLR_V; else SET_V; |
| 5901 | 5946 | } |
| 5902 | 5947 | |
| r15120 | r15121 | |
| 5911 | 5956 | GET_CNT(OP1,NIB1); |
| 5912 | 5957 | GET_DST(OP1,NIB2); |
| 5913 | 5958 | GET_CCC(OP1,NIB3); /* repeat? */ |
| 5914 | | WRMEM_B(cpustate, cpustate->RW(dst), RDMEM_B(cpustate, cpustate->RW(src))); |
| 5915 | | cpustate->RW(dst)++; |
| 5916 | | cpustate->RW(src)++; |
| 5959 | WRMEM_B(cpustate, cpustate->RW(dst), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 5960 | addr_to_reg(cpustate, dst, addr_add(cpustate, addr_from_reg(cpustate, dst), 1)); |
| 5961 | addr_to_reg(cpustate, src, addr_add(cpustate, addr_from_reg(cpustate, src), 1)); |
| 5917 | 5962 | if (--cpustate->RW(cnt)) { CLR_V; if (cc == 0) cpustate->pc -= 4; } else SET_V; |
| 5918 | 5963 | } |
| 5919 | 5964 | |
| r15120 | r15121 | |
| 5927 | 5972 | GET_CCC(OP1,NIB3); |
| 5928 | 5973 | GET_DST(OP1,NIB2); |
| 5929 | 5974 | GET_CNT(OP1,NIB1); |
| 5930 | | CPB(cpustate, RDMEM_B(cpustate, cpustate->RW(dst)), RDMEM_B(cpustate, cpustate->RW(src))); |
| 5975 | CPB(cpustate, RDMEM_B(cpustate, addr_from_reg(cpustate, dst)), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 5931 | 5976 | switch (cc) { |
| 5932 | 5977 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 5933 | 5978 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 5946 | 5991 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 5947 | 5992 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 5948 | 5993 | } |
| 5949 | | cpustate->RW(dst)++; |
| 5950 | | cpustate->RW(src)++; |
| 5994 | addr_to_reg(cpustate, dst, addr_add(cpustate, addr_from_reg(cpustate, dst), 1)); |
| 5995 | addr_to_reg(cpustate, src, addr_add(cpustate, addr_from_reg(cpustate, src), 1)); |
| 5951 | 5996 | if (--cpustate->RW(cnt)) { CLR_V; if (!(cpustate->fcw & F_Z)) cpustate->pc -= 4; } else SET_V; |
| 5952 | 5997 | } |
| 5953 | 5998 | |
| r15120 | r15121 | |
| 5961 | 6006 | GET_CCC(OP1,NIB3); |
| 5962 | 6007 | GET_DST(OP1,NIB2); |
| 5963 | 6008 | GET_CNT(OP1,NIB1); |
| 5964 | | CPB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, cpustate->RW(src))); |
| 6009 | CPB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 5965 | 6010 | switch (cc) { |
| 5966 | 6011 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 5967 | 6012 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 5980 | 6025 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 5981 | 6026 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 5982 | 6027 | } |
| 5983 | | cpustate->RW(src)++; |
| 6028 | addr_to_reg(cpustate, src, addr_add(cpustate, addr_from_reg(cpustate, src), 1)); |
| 5984 | 6029 | if (--cpustate->RW(cnt)) { CLR_V; if (!(cpustate->fcw & F_Z)) cpustate->pc -= 4; } else SET_V; |
| 5985 | 6030 | } |
| 5986 | 6031 | |
| r15120 | r15121 | |
| 5994 | 6039 | GET_CCC(OP1,NIB3); |
| 5995 | 6040 | GET_DST(OP1,NIB2); |
| 5996 | 6041 | GET_CNT(OP1,NIB1); |
| 5997 | | CPB(cpustate, RDMEM_B(cpustate, cpustate->RW(dst)), RDMEM_B(cpustate, cpustate->RW(src))); |
| 6042 | CPB(cpustate, RDMEM_B(cpustate, addr_from_reg(cpustate, dst)), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 5998 | 6043 | switch (cc) { |
| 5999 | 6044 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 6000 | 6045 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 6013 | 6058 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 6014 | 6059 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 6015 | 6060 | } |
| 6016 | | cpustate->RW(dst)++; |
| 6017 | | cpustate->RW(src)++; |
| 6061 | addr_to_reg(cpustate, dst, addr_add(cpustate, addr_from_reg(cpustate, dst), 1)); |
| 6062 | addr_to_reg(cpustate, src, addr_add(cpustate, addr_from_reg(cpustate, src), 1)); |
| 6018 | 6063 | if (--cpustate->RW(cnt)) { CLR_V; if (!(cpustate->fcw & F_Z)) cpustate->pc -= 4; } else SET_V; |
| 6019 | 6064 | } |
| 6020 | 6065 | |
| r15120 | r15121 | |
| 6028 | 6073 | GET_CCC(OP1,NIB3); |
| 6029 | 6074 | GET_DST(OP1,NIB2); |
| 6030 | 6075 | GET_CNT(OP1,NIB1); |
| 6031 | | CPB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, cpustate->RW(src))); |
| 6076 | CPB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 6032 | 6077 | switch (cc) { |
| 6033 | 6078 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 6034 | 6079 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 6047 | 6092 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 6048 | 6093 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 6049 | 6094 | } |
| 6050 | | cpustate->RW(src)--; |
| 6095 | addr_to_reg(cpustate, src, addr_sub(cpustate, addr_from_reg(cpustate, src), 1)); |
| 6051 | 6096 | if (--cpustate->RW(cnt)) CLR_V; else SET_V; |
| 6052 | 6097 | } |
| 6053 | 6098 | |
| r15120 | r15121 | |
| 6062 | 6107 | GET_CNT(OP1,NIB1); |
| 6063 | 6108 | GET_DST(OP1,NIB2); |
| 6064 | 6109 | GET_CCC(OP1,NIB3); |
| 6065 | | WRMEM_B(cpustate, cpustate->RW(dst), RDMEM_B(cpustate, cpustate->RW(src))); |
| 6066 | | cpustate->RW(dst)--; |
| 6067 | | cpustate->RW(src)--; |
| 6110 | WRMEM_B(cpustate, addr_from_reg(cpustate, dst), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 6111 | addr_to_reg(cpustate, dst, addr_sub(cpustate, addr_from_reg(cpustate, dst), 1)); |
| 6112 | addr_to_reg(cpustate, src, addr_sub(cpustate, addr_from_reg(cpustate, src), 1)); |
| 6068 | 6113 | if (--cpustate->RW(cnt)) { CLR_V; if (cc == 0) cpustate->pc -= 4; } else SET_V; |
| 6069 | 6114 | } |
| 6070 | 6115 | |
| r15120 | r15121 | |
| 6078 | 6123 | GET_CCC(OP1,NIB3); |
| 6079 | 6124 | GET_DST(OP1,NIB2); |
| 6080 | 6125 | GET_CNT(OP1,NIB1); |
| 6081 | | CPB(cpustate, RDMEM_B(cpustate, cpustate->RW(dst)), RDMEM_B(cpustate, cpustate->RW(src))); |
| 6126 | CPB(cpustate, RDMEM_B(cpustate, addr_from_reg(cpustate, dst)), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 6082 | 6127 | switch (cc) { |
| 6083 | 6128 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 6084 | 6129 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 6097 | 6142 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 6098 | 6143 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 6099 | 6144 | } |
| 6100 | | cpustate->RW(dst)--; |
| 6101 | | cpustate->RW(src)--; |
| 6145 | addr_to_reg(cpustate, dst, addr_sub(cpustate, addr_from_reg(cpustate, dst), 1)); |
| 6146 | addr_to_reg(cpustate, src, addr_sub(cpustate, addr_from_reg(cpustate, src), 1)); |
| 6102 | 6147 | if (--cpustate->RW(cnt)) CLR_V; else SET_V; |
| 6103 | 6148 | } |
| 6104 | 6149 | |
| r15120 | r15121 | |
| 6112 | 6157 | GET_CCC(OP1,NIB3); |
| 6113 | 6158 | GET_DST(OP1,NIB2); |
| 6114 | 6159 | GET_CNT(OP1,NIB1); |
| 6115 | | CPB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, cpustate->RW(src))); |
| 6160 | CPB(cpustate, cpustate->RB(dst), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 6116 | 6161 | switch (cc) { |
| 6117 | 6162 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 6118 | 6163 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 6131 | 6176 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 6132 | 6177 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 6133 | 6178 | } |
| 6134 | | cpustate->RW(src)--; |
| 6179 | addr_to_reg(cpustate, src, addr_sub(cpustate, addr_from_reg(cpustate, src), 1)); |
| 6135 | 6180 | if (--cpustate->RW(cnt)) { CLR_V; if (!(cpustate->fcw & F_Z)) cpustate->pc -= 4; } else SET_V; |
| 6136 | 6181 | } |
| 6137 | 6182 | |
| r15120 | r15121 | |
| 6145 | 6190 | GET_CCC(OP1,NIB3); |
| 6146 | 6191 | GET_DST(OP1,NIB2); |
| 6147 | 6192 | GET_CNT(OP1,NIB1); |
| 6148 | | CPB(cpustate, RDMEM_B(cpustate, cpustate->RW(dst)), RDMEM_B(cpustate, cpustate->RW(src))); |
| 6193 | CPB(cpustate, RDMEM_B(cpustate, addr_from_reg(cpustate, dst)), RDMEM_B(cpustate, addr_from_reg(cpustate, src))); |
| 6149 | 6194 | switch (cc) { |
| 6150 | 6195 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 6151 | 6196 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 6164 | 6209 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 6165 | 6210 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 6166 | 6211 | } |
| 6167 | | cpustate->RW(dst)--; |
| 6168 | | cpustate->RW(src)--; |
| 6212 | addr_to_reg(cpustate, dst, addr_sub(cpustate, addr_from_reg(cpustate, dst), 1)); |
| 6213 | addr_to_reg(cpustate, src, addr_sub(cpustate, addr_from_reg(cpustate, src), 1)); |
| 6169 | 6214 | if (--cpustate->RW(cnt)) { CLR_V; if (!(cpustate->fcw & F_Z)) cpustate->pc -= 4; } else SET_V; |
| 6170 | 6215 | } |
| 6171 | 6216 | |
| r15120 | r15121 | |
| 6179 | 6224 | GET_CCC(OP1,NIB3); |
| 6180 | 6225 | GET_DST(OP1,NIB2); |
| 6181 | 6226 | GET_CNT(OP1,NIB1); |
| 6182 | | CPW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 6227 | CPW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 6183 | 6228 | switch (cc) { |
| 6184 | 6229 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 6185 | 6230 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 6198 | 6243 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 6199 | 6244 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 6200 | 6245 | } |
| 6201 | | cpustate->RW(src) += 2; |
| 6246 | addr_to_reg(cpustate, src, addr_add(cpustate, addr_from_reg(cpustate, src), 2)); |
| 6202 | 6247 | if (--cpustate->RW(cnt)) CLR_V; else SET_V; |
| 6203 | 6248 | } |
| 6204 | 6249 | |
| r15120 | r15121 | |
| 6213 | 6258 | GET_CNT(OP1,NIB1); |
| 6214 | 6259 | GET_DST(OP1,NIB2); |
| 6215 | 6260 | GET_CCC(OP1,NIB3); |
| 6216 | | WRMEM_W(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 6217 | | cpustate->RW(dst) += 2; |
| 6218 | | cpustate->RW(src) += 2; |
| 6261 | WRMEM_W(cpustate, addr_from_reg(cpustate, dst), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 6262 | addr_to_reg(cpustate, src, addr_add(cpustate, addr_from_reg(cpustate, src), 2)); |
| 6263 | addr_to_reg(cpustate, dst, addr_add(cpustate, addr_from_reg(cpustate, dst), 2)); |
| 6219 | 6264 | if (--cpustate->RW(cnt)) { CLR_V; if (cc == 0) cpustate->pc -= 4; } else SET_V; |
| 6220 | 6265 | } |
| 6221 | 6266 | |
| r15120 | r15121 | |
| 6229 | 6274 | GET_CCC(OP1,NIB3); |
| 6230 | 6275 | GET_DST(OP1,NIB2); |
| 6231 | 6276 | GET_CNT(OP1,NIB1); |
| 6232 | | CPW(cpustate, RDMEM_W(cpustate, cpustate->RW(dst)), RDMEM_W(cpustate, cpustate->RW(src))); |
| 6277 | CPW(cpustate, RDMEM_W(cpustate, addr_from_reg(cpustate, dst)), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 6233 | 6278 | switch (cc) { |
| 6234 | 6279 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 6235 | 6280 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 6248 | 6293 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 6249 | 6294 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 6250 | 6295 | } |
| 6251 | | cpustate->RW(dst) += 2; |
| 6252 | | cpustate->RW(src) += 2; |
| 6296 | addr_to_reg(cpustate, src, addr_add(cpustate, addr_from_reg(cpustate, src), 2)); |
| 6297 | addr_to_reg(cpustate, dst, addr_add(cpustate, addr_from_reg(cpustate, dst), 2)); |
| 6253 | 6298 | if (--cpustate->RW(cnt)) CLR_V; else SET_V; |
| 6254 | 6299 | } |
| 6255 | 6300 | |
| r15120 | r15121 | |
| 6263 | 6308 | GET_CCC(OP1,NIB3); |
| 6264 | 6309 | GET_DST(OP1,NIB2); |
| 6265 | 6310 | GET_CNT(OP1,NIB1); |
| 6266 | | CPW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 6311 | CPW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 6267 | 6312 | switch (cc) { |
| 6268 | 6313 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 6269 | 6314 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 6282 | 6327 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 6283 | 6328 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 6284 | 6329 | } |
| 6285 | | cpustate->RW(src) += 2; |
| 6330 | addr_to_reg(cpustate, src, addr_add(cpustate, addr_from_reg(cpustate, src), 2)); |
| 6286 | 6331 | if (--cpustate->RW(cnt)) { CLR_V; if (!(cpustate->fcw & F_Z)) cpustate->pc -= 4; } else SET_V; |
| 6287 | 6332 | } |
| 6288 | 6333 | |
| r15120 | r15121 | |
| 6296 | 6341 | GET_CCC(OP1,NIB3); |
| 6297 | 6342 | GET_DST(OP1,NIB2); |
| 6298 | 6343 | GET_CNT(OP1,NIB1); |
| 6299 | | CPW(cpustate, RDMEM_W(cpustate, cpustate->RW(dst)), RDMEM_W(cpustate, cpustate->RW(src))); |
| 6344 | CPW(cpustate, RDMEM_W(cpustate, addr_from_reg(cpustate, dst)), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 6300 | 6345 | switch (cc) { |
| 6301 | 6346 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 6302 | 6347 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 6315 | 6360 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 6316 | 6361 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 6317 | 6362 | } |
| 6318 | | cpustate->RW(dst) += 2; |
| 6319 | | cpustate->RW(src) += 2; |
| 6363 | addr_to_reg(cpustate, src, addr_add(cpustate, addr_from_reg(cpustate, src), 2)); |
| 6364 | addr_to_reg(cpustate, dst, addr_add(cpustate, addr_from_reg(cpustate, dst), 2)); |
| 6320 | 6365 | if (--cpustate->RW(cnt)) { CLR_V; if (!(cpustate->fcw & F_Z)) cpustate->pc -= 4; } else SET_V; |
| 6321 | 6366 | } |
| 6322 | 6367 | |
| r15120 | r15121 | |
| 6330 | 6375 | GET_CCC(OP1,NIB3); |
| 6331 | 6376 | GET_DST(OP1,NIB2); |
| 6332 | 6377 | GET_CNT(OP1,NIB1); |
| 6333 | | CPW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 6378 | CPW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 6334 | 6379 | switch (cc) { |
| 6335 | 6380 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 6336 | 6381 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 6349 | 6394 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 6350 | 6395 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 6351 | 6396 | } |
| 6352 | | cpustate->RW(src) -= 2; |
| 6397 | addr_to_reg(cpustate, src, addr_sub(cpustate, addr_from_reg(cpustate, src), 2)); |
| 6353 | 6398 | if (--cpustate->RW(cnt)) CLR_V; else SET_V; |
| 6354 | 6399 | } |
| 6355 | 6400 | |
| r15120 | r15121 | |
| 6364 | 6409 | GET_CNT(OP1,NIB1); |
| 6365 | 6410 | GET_DST(OP1,NIB2); |
| 6366 | 6411 | GET_CCC(OP1,NIB3); |
| 6367 | | WRMEM_W(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 6368 | | cpustate->RW(dst) -= 2; |
| 6369 | | cpustate->RW(src) -= 2; |
| 6412 | WRMEM_W(cpustate, addr_from_reg(cpustate, dst), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 6413 | addr_to_reg(cpustate, dst, addr_sub(cpustate, addr_from_reg(cpustate, dst), 2)); |
| 6414 | addr_to_reg(cpustate, src, addr_sub(cpustate, addr_from_reg(cpustate, src), 2)); |
| 6370 | 6415 | if (--cpustate->RW(cnt)) { CLR_V; if (cc == 0) cpustate->pc -= 4; } else SET_V; |
| 6371 | 6416 | } |
| 6372 | 6417 | |
| r15120 | r15121 | |
| 6380 | 6425 | GET_CCC(OP1,NIB3); |
| 6381 | 6426 | GET_DST(OP1,NIB2); |
| 6382 | 6427 | GET_CNT(OP1,NIB1); |
| 6383 | | CPW(cpustate, RDMEM_W(cpustate, cpustate->RW(dst)), RDMEM_W(cpustate, cpustate->RW(src))); |
| 6428 | CPW(cpustate, RDMEM_W(cpustate, addr_from_reg(cpustate, dst)), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 6384 | 6429 | switch (cc) { |
| 6385 | 6430 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 6386 | 6431 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 6399 | 6444 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 6400 | 6445 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 6401 | 6446 | } |
| 6402 | | cpustate->RW(dst) -= 2; |
| 6403 | | cpustate->RW(src) -= 2; |
| 6447 | addr_to_reg(cpustate, dst, addr_sub(cpustate, addr_from_reg(cpustate, dst), 2)); |
| 6448 | addr_to_reg(cpustate, src, addr_sub(cpustate, addr_from_reg(cpustate, src), 2)); |
| 6404 | 6449 | if (--cpustate->RW(cnt)) CLR_V; else SET_V; |
| 6405 | 6450 | } |
| 6406 | 6451 | |
| r15120 | r15121 | |
| 6414 | 6459 | GET_CCC(OP1,NIB3); |
| 6415 | 6460 | GET_DST(OP1,NIB2); |
| 6416 | 6461 | GET_CNT(OP1,NIB1); |
| 6417 | | CPW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, cpustate->RW(src))); |
| 6462 | CPW(cpustate, cpustate->RW(dst), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 6418 | 6463 | switch (cc) { |
| 6419 | 6464 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 6420 | 6465 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 6433 | 6478 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 6434 | 6479 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 6435 | 6480 | } |
| 6436 | | cpustate->RW(src) -= 2; |
| 6481 | addr_to_reg(cpustate, src, addr_sub(cpustate, addr_from_reg(cpustate, src), 2)); |
| 6437 | 6482 | if (--cpustate->RW(cnt)) { CLR_V; if (!(cpustate->fcw & F_Z)) cpustate->pc -= 4; } else SET_V; |
| 6438 | 6483 | } |
| 6439 | 6484 | |
| r15120 | r15121 | |
| 6447 | 6492 | GET_CCC(OP1,NIB3); |
| 6448 | 6493 | GET_DST(OP1,NIB2); |
| 6449 | 6494 | GET_CNT(OP1,NIB1); |
| 6450 | | CPW(cpustate, RDMEM_W(cpustate, cpustate->RW(dst)), RDMEM_W(cpustate, cpustate->RW(src))); |
| 6495 | CPW(cpustate, RDMEM_W(cpustate, addr_from_reg(cpustate, dst)), RDMEM_W(cpustate, addr_from_reg(cpustate, src))); |
| 6451 | 6496 | switch (cc) { |
| 6452 | 6497 | case 0: if (CC0) SET_Z; else CLR_Z; break; |
| 6453 | 6498 | case 1: if (CC1) SET_Z; else CLR_Z; break; |
| r15120 | r15121 | |
| 6466 | 6511 | case 14: if (CCE) SET_Z; else CLR_Z; break; |
| 6467 | 6512 | case 15: if (CCF) SET_Z; else CLR_Z; break; |
| 6468 | 6513 | } |
| 6469 | | cpustate->RW(dst) -= 2; |
| 6470 | | cpustate->RW(src) -= 2; |
| 6514 | addr_to_reg(cpustate, dst, addr_sub(cpustate, addr_from_reg(cpustate, dst), 2)); |
| 6515 | addr_to_reg(cpustate, src, addr_sub(cpustate, addr_from_reg(cpustate, src), 2)); |
| 6471 | 6516 | if (--cpustate->RW(cnt)) { CLR_V; if (!(cpustate->fcw & F_Z)) cpustate->pc -= 4; } else SET_V; |
| 6472 | 6517 | } |
| 6473 | 6518 | |
| r15120 | r15121 | |
| 6543 | 6588 | static void ZD_dsp12(z8000_state *cpustate) |
| 6544 | 6589 | { |
| 6545 | 6590 | INT16 dsp12 = cpustate->op[0] & 0xfff; |
| 6546 | | PUSHW(cpustate, SP, cpustate->pc); |
| 6547 | | dsp12 = (dsp12 & 2048) ? 4096 -2 * (dsp12 & 2047) : -2 * (dsp12 & 2047); |
| 6548 | | cpustate->pc += dsp12; |
| 6591 | if (segmented_mode(cpustate)) |
| 6592 | PUSHL(cpustate, SP, make_segmented_addr(cpustate->pc)); |
| 6593 | else |
| 6594 | PUSHW(cpustate, SP, cpustate->pc); |
| 6595 | dsp12 = (dsp12 & 2048) ? 4096 - 2 * (dsp12 & 2047) : -2 * (dsp12 & 2047); |
| 6596 | cpustate->pc = addr_add(cpustate, cpustate->pc, dsp12); |
| 6549 | 6597 | } |
| 6550 | 6598 | |
| 6551 | 6599 | /****************************************** |
| r15120 | r15121 | |
| 6557 | 6605 | GET_DSP8; |
| 6558 | 6606 | GET_CCC(OP0,NIB1); |
| 6559 | 6607 | switch (cc) { |
| 6560 | | case 0: if (CC0) cpustate->pc += dsp8 * 2; break; |
| 6561 | | case 1: if (CC1) cpustate->pc += dsp8 * 2; break; |
| 6562 | | case 2: if (CC2) cpustate->pc += dsp8 * 2; break; |
| 6563 | | case 3: if (CC3) cpustate->pc += dsp8 * 2; break; |
| 6564 | | case 4: if (CC4) cpustate->pc += dsp8 * 2; break; |
| 6565 | | case 5: if (CC5) cpustate->pc += dsp8 * 2; break; |
| 6566 | | case 6: if (CC6) cpustate->pc += dsp8 * 2; break; |
| 6567 | | case 7: if (CC7) cpustate->pc += dsp8 * 2; break; |
| 6568 | | case 8: if (CC8) cpustate->pc += dsp8 * 2; break; |
| 6569 | | case 9: if (CC9) cpustate->pc += dsp8 * 2; break; |
| 6570 | | case 10: if (CCA) cpustate->pc += dsp8 * 2; break; |
| 6571 | | case 11: if (CCB) cpustate->pc += dsp8 * 2; break; |
| 6572 | | case 12: if (CCC) cpustate->pc += dsp8 * 2; break; |
| 6573 | | case 13: if (CCD) cpustate->pc += dsp8 * 2; break; |
| 6574 | | case 14: if (CCE) cpustate->pc += dsp8 * 2; break; |
| 6575 | | case 15: if (CCF) cpustate->pc += dsp8 * 2; break; |
| 6576 | | } |
| 6608 | case 0: if (CC0) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6609 | case 1: if (CC1) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6610 | case 2: if (CC2) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6611 | case 3: if (CC3) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6612 | case 4: if (CC4) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6613 | case 5: if (CC5) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6614 | case 6: if (CC6) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6615 | case 7: if (CC7) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6616 | case 8: if (CC8) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6617 | case 9: if (CC9) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6618 | case 10: if (CCA) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6619 | case 11: if (CCB) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6620 | case 12: if (CCC) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6621 | case 13: if (CCD) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6622 | case 14: if (CCE) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6623 | case 15: if (CCF) cpustate->pc = addr_add(cpustate, cpustate->pc, dsp8 * 2); break; |
| 6624 | } |
| 6577 | 6625 | } |
| 6578 | 6626 | |
| 6579 | 6627 | /****************************************** |
| r15120 | r15121 | |
| 6586 | 6634 | GET_DSP7; |
| 6587 | 6635 | cpustate->RB(dst) -= 1; |
| 6588 | 6636 | if (cpustate->RB(dst)) { |
| 6589 | | cpustate->pc = cpustate->pc - 2 * dsp7; |
| 6637 | cpustate->pc = addr_sub(cpustate, cpustate->pc, 2 * dsp7); |
| 6590 | 6638 | } |
| 6591 | 6639 | } |
| 6592 | 6640 | |
| r15120 | r15121 | |
| 6600 | 6648 | GET_DSP7; |
| 6601 | 6649 | cpustate->RW(dst) -= 1; |
| 6602 | 6650 | if (cpustate->RW(dst)) { |
| 6603 | | cpustate->pc = cpustate->pc - 2 * dsp7; |
| 6651 | cpustate->pc = addr_sub(cpustate, cpustate->pc, 2 * dsp7); |
| 6604 | 6652 | } |
| 6605 | 6653 | } |
| 6606 | | |
| 6607 | | |
src/emu/cpu/z8000/z8000tbl.c
| r15120 | r15121 | |
| 75 | 75 | {0x1600,0x160f, 1,3, 14,Z16_0000_dddd_imm32, "addl %rl3,%#l1", 0}, |
| 76 | 76 | {0x1610,0x16ff, 1,1, 14,Z16_ssN0_dddd, "addl %rl3,@%rw2", 0}, |
| 77 | 77 | {0x1711,0x17ff, 1,1, 12,Z17_ssN0_ddN0, "pop @%rw3,@%rw2", 0}, |
| 78 | {0x1800,0x180f, 1,1,282,Z18_00N0_dddd_imm32, "multl %rq3,@%l#1", 0}, |
| 78 | 79 | {0x1810,0x18ff, 1,1,282,Z18_ssN0_dddd, "multl %rq3,@%rw2", 0}, |
| 79 | 80 | {0x1900,0x190f, 1,2, 70,Z19_0000_dddd_imm16, "mult %rl3,%#w1", 0}, |
| 80 | 81 | {0x1910,0x19ff, 1,1, 70,Z19_ssN0_dddd, "mult %rl3,@%rw2", 0}, |
| r15120 | r15121 | |
| 388 | 389 | {0x8c02,0x8cf2,16,1, 7,Z8C_dddd_0010, "negb %rb2", 0}, |
| 389 | 390 | {0x8c04,0x8cf4,16,1, 7,Z8C_dddd_0100, "testb %rb2", 0}, |
| 390 | 391 | {0x8c06,0x8cf6,16,1, 7,Z8C_dddd_0110, "tsetb %rb2", 0}, |
| 391 | | {0x8c08,0x8cf8,16,1, 7,Z8C_dddd_1000, "clrb %rb2", 0}, |
| 392 | | {0x8d00,0x8df0,16,1, 7,Z8D_dddd_0000, "com %rw2", 0}, |
| 393 | | {0x8d01,0x8df1,16,1, 7,Z8D_imm4_0001, "setflg %f2", 0}, |
| 394 | | {0x8d02,0x8df2,16,1, 7,Z8D_dddd_0010, "neg %rw2", 0}, |
| 395 | | {0x8d03,0x8df3,16,1, 7,Z8D_imm4_0011, "resflg %f2", 0}, |
| 396 | | {0x8d04,0x8df4,16,1, 7,Z8D_dddd_0100, "test %rw2", 0}, |
| 397 | | {0x8d05,0x8df5,16,1, 7,Z8D_imm4_0101, "comflg %f2", 0}, |
| 398 | | {0x8d06,0x8df6,16,1, 7,Z8D_dddd_0110, "tset %rw2", 0}, |
| 399 | | {0x8d07,0x8d07, 1,1, 7,Z8D_0000_0111, "nop", 0}, |
| 400 | | {0x8d08,0x8df8,16,1, 7,Z8D_dddd_1000, "clr %rw2", 0}, |
| 401 | | {0x8e00,0x8eff, 1,1, 10,Z8E_imm8, "ext8e %#b1", 0}, |
| 402 | | {0x8f00,0x8fff, 1,1, 10,Z8F_imm8, "ext8f %#b1", 0}, |
| 403 | | {0x9000,0x90ff, 1,1, 8,Z90_ssss_dddd, "cpl %rl3,%rl2", 0}, |
| 404 | | {0x9110,0x91ff, 1,1, 12,Z91_ddN0_ssss, "pushl @%rw2,%rl3", 0}, |
| 405 | | {0x9200,0x92ff, 1,1, 8,Z92_ssss_dddd, "subl %rl3,%rl2", 0}, |
| 406 | | {0x9310,0x93ff, 1,1, 9,Z93_ddN0_ssss, "push @%rw2,%rw3", 0}, |
| 407 | | {0x9400,0x94ff, 1,1, 5,Z94_ssss_dddd, "ldl %rl3,%rl2", 0}, |
| 408 | | {0x9510,0x95ff, 1,1, 12,Z95_ssN0_dddd, "popl %rl3,@%rw2", 0}, |
| 409 | | {0x9600,0x96ff, 1,1, 8,Z96_ssss_dddd, "addl %rl3,%rl2", 0}, |
| 410 | | {0x9710,0x97ff, 1,1, 8,Z97_ssN0_dddd, "pop %rw3,@%rw2", 0}, |
| 411 | | {0x9800,0x98ff, 1,1,282,Z98_ssss_dddd, "multl %rq3,%rl2", 0}, |
| 412 | | {0x9900,0x99ff, 1,1, 70,Z99_ssss_dddd, "mult %rl3,%rw2", 0}, |
| 413 | | {0x9a00,0x9aff, 1,1,744,Z9A_ssss_dddd, "divl %rq3,%rl2", 0}, |
| 414 | | {0x9b00,0x9bff, 1,1,107,Z9B_ssss_dddd, "div %rl3,%rw2", 0}, |
| 415 | | {0x9c08,0x9cf8,16,1, 13,Z9C_dddd_1000, "testl %rl2", 0}, |
| 416 | | {0x9d00,0x9dff, 1,1, 10,Z9D_imm8, "rsvd9d", 0}, |
| 417 | | {0x9e00,0x9e0f, 1,1, 10,Z9E_0000_cccc, "ret %c3", DASMFLAG_STEP_OUT}, |
| 418 | | {0x9f00,0x9fff, 1,1, 10,Z9F_imm8, "rsvd9f", 0}, |
| 419 | | {0xa000,0xa0ff, 1,1, 3,ZA0_ssss_dddd, "ldb %rb3,%rb2", 0}, |
| 420 | | {0xa100,0xa1ff, 1,1, 3,ZA1_ssss_dddd, "ld %rw3,%rw2", 0}, |
| 421 | | {0xa200,0xa2ff, 1,1, 4,ZA2_dddd_imm4, "resb %rb2,%3", 0}, |
| 422 | | {0xa300,0xa3ff, 1,1, 4,ZA3_dddd_imm4, "res %rw2,%3", 0}, |
| 423 | | {0xa400,0xa4ff, 1,1, 4,ZA4_dddd_imm4, "setb %rb2,%3", 0}, |
| 424 | | {0xa500,0xa5ff, 1,1, 4,ZA5_dddd_imm4, "set %rw2,%3", 0}, |
| 425 | | {0xa600,0xa6ff, 1,1, 4,ZA6_dddd_imm4, "bitb %rb2,%3", 0}, |
| 426 | | {0xa700,0xa7ff, 1,1, 4,ZA7_dddd_imm4, "bit %rw2,%3", 0}, |
| 427 | | {0xa800,0xa8ff, 1,1, 4,ZA8_dddd_imm4m1, "incb %rb2,%+3", 0}, |
| 428 | | {0xa900,0xa9ff, 1,1, 4,ZA9_dddd_imm4m1, "inc %rw2,%+3", 0}, |
| 429 | | {0xaa00,0xaaff, 1,1, 4,ZAA_dddd_imm4m1, "decb %rb2,%+3", 0}, |
| 430 | | {0xab00,0xabff, 1,1, 4,ZAB_dddd_imm4m1, "dec %rw2,%+3", 0}, |
| 431 | | {0xac00,0xacff, 1,1, 6,ZAC_ssss_dddd, "exb %rb3,%rb2", 0}, |
| 432 | | {0xad00,0xadff, 1,1, 6,ZAD_ssss_dddd, "ex %rw3,%rw2", 0}, |
| 433 | | {0xae00,0xaeff, 1,1, 5,ZAE_dddd_cccc, "tccb %c3,%rb2", 0}, |
| 434 | | {0xaf00,0xafff, 1,1, 5,ZAF_dddd_cccc, "tcc %c3,%rw2", 0}, |
| 435 | | {0xb000,0xb0f0,16,1, 5,ZB0_dddd_0000, "dab %rb2", 0}, |
| 436 | | {0xb100,0xb1f0,16,1, 11,ZB1_dddd_0000, "extsb %rw2", 0}, |
| 437 | | {0xb107,0xb1f7,16,1, 11,ZB1_dddd_0111, "extsl %rq2", 0}, |
| 438 | | {0xb10a,0xb1fa,16,1, 11,ZB1_dddd_1010, "exts %rl2", 0}, |
| 439 | | {0xb200,0xb2f0,16,1, 6,ZB2_dddd_00I0, "rlb %rb2,%?3", 0}, |
| 440 | | {0xb201,0xb2f1,16,2, 13,ZB2_dddd_0001_imm8, "s%*lb %rb2,%$3", 0}, |
| 441 | | {0xb202,0xb2f2,16,1, 6,ZB2_dddd_00I0, "rlb %rb2,%?3", 0}, |
| 442 | | {0xb203,0xb2f3,16,2, 15,ZB2_dddd_0011_0000_ssss_0000_0000, "sdlb %rb2,%rw5", 0}, |
| 443 | | {0xb204,0xb2f4,16,1, 6,ZB2_dddd_01I0, "rrb %rb2,%?3", 0}, |
| 444 | | {0xb206,0xb2f6,16,1, 6,ZB2_dddd_01I0, "rrb %rb2,%?3", 0}, |
| 445 | | {0xb208,0xb2f8,16,1, 9,ZB2_dddd_10I0, "rlcb %rb2,%?3", 0}, |
| 446 | | {0xb209,0xb2f9,16,2, 13,ZB2_dddd_1001_imm8, "s%*ab %rb2,%$3", 0}, |
| 447 | | {0xb20a,0xb2fa,16,1, 9,ZB2_dddd_10I0, "rlcb %rb2,%?3", 0}, |
| 448 | | {0xb20b,0xb2fb,16,2, 15,ZB2_dddd_1011_0000_ssss_0000_0000, "sdab %rb2,%rw5", 0}, |
| 449 | | {0xb20c,0xb2fc,16,1, 9,ZB2_dddd_11I0, "rrcb %rb2,%?3", 0}, |
| 450 | | {0xb20e,0xb2fe,16,1, 9,ZB2_dddd_11I0, "rrcb %rb2,%?3", 0}, |
| 451 | | {0xb300,0xb3f0,16,1, 6,ZB3_dddd_00I0, "rl %rw2,%?3", 0}, |
| 452 | | {0xb301,0xb3f1,16,2, 13,ZB3_dddd_0001_imm8, "s%*l %rw2,%$3", 0}, |
| 453 | | {0xb302,0xb3f2,16,1, 6,ZB3_dddd_00I0, "rl %rw2,%?3", 0}, |
| 454 | | {0xb303,0xb3f3,16,2, 15,ZB3_dddd_0011_0000_ssss_0000_0000, "sdl %rw2,%rw5", 0}, |
| 455 | | {0xb304,0xb3f4,16,1, 6,ZB3_dddd_01I0, "rr %rw2,%?3", 0}, |
| 456 | | {0xb305,0xb3f5,16,2, 13,ZB3_dddd_0101_imm8, "s%*ll %rl2,%$3", 0}, |
| 457 | | {0xb306,0xb3f6,16,1, 6,ZB3_dddd_01I0, "rr %rw2,%?3", 0}, |
| 458 | | {0xb307,0xb3f7,16,2, 15,ZB3_dddd_0111_0000_ssss_0000_0000, "sdll %rl2,%rw5", 0}, |
| 459 | | {0xb308,0xb3f8,16,1, 6,ZB3_dddd_10I0, "rlc %rw2,%?3", 0}, |
| 460 | | {0xb309,0xb3f9,16,2, 13,ZB3_dddd_1001_imm8, "s%*a %rw2,%$3", 0}, |
| 461 | | {0xb30a,0xb3fa,16,1, 6,ZB3_dddd_10I0, "rlc %rw2,%?3", 0}, |
| 462 | | {0xb30b,0xb3fb,16,2, 15,ZB3_dddd_1011_0000_ssss_0000_0000, "sda %rw2,%rw5", 0}, |
| 463 | | {0xb30c,0xb3fc,16,1, 6,ZB3_dddd_11I0, "rrc %rw2,%?3", 0}, |
| 464 | | {0xb30d,0xb3fd,16,2, 13,ZB3_dddd_1101_imm8, "s%*al %rl2,%$3", 0}, |
| 465 | | {0xb30e,0xb3fe,16,1, 6,ZB3_dddd_11I0, "rrc %rw2,%?3", 0}, |
| 466 | | {0xb30f,0xb3ff,16,2, 15,ZB3_dddd_1111_0000_ssss_0000_0000, "sdal %rl2,%rw5", 0}, |
| 467 | | {0xb400,0xb4ff, 1,1, 5,ZB4_ssss_dddd, "adcb %rb3,%rb2", 0}, |
| 468 | | {0xb500,0xb5ff, 1,1, 5,ZB5_ssss_dddd, "adc %rw3,%rw2", 0}, |
| 469 | | {0xb600,0xb6ff, 1,1, 5,ZB6_ssss_dddd, "sbcb %rb3,%rb2", 0}, |
| 470 | | {0xb700,0xb7ff, 1,1, 5,ZB7_ssss_dddd, "sbc %rw3,%rw2", 0}, |
| 471 | | {0xb810,0xb8f0,16,2, 25,ZB8_ddN0_0000_0000_rrrr_ssN0_0000, "trib @%rw2,@%rw6,%rb5", 0}, |
| 472 | | {0xb812,0xb8f2,16,2, 25,ZB8_ddN0_0010_0000_rrrr_ssN0_0000, "trtib @%rw2,@%rw6,%rb5", 0}, |
| 473 | | {0xb814,0xb8f4,16,2, 25,ZB8_ddN0_0100_0000_rrrr_ssN0_0000, "trirb @%rw2,@%rw6,%rb5", 0}, |
| 474 | | {0xb816,0xb8f6,16,2, 25,ZB8_ddN0_0110_0000_rrrr_ssN0_1110, "trtirb @%rw2,@%rw6,%rb5", 0}, |
| 475 | | {0xb818,0xb8f8,16,2, 25,ZB8_ddN0_1000_0000_rrrr_ssN0_0000, "trdb @%rw2,@%rw6,%rb5", 0}, |
| 476 | | {0xb81a,0xb8fa,16,2, 25,ZB8_ddN0_1010_0000_rrrr_ssN0_0000, "trtrb @%rw2,@%rw6,%rb5", 0}, |
| 477 | | {0xb81c,0xb8fc,16,2, 25,ZB8_ddN0_1100_0000_rrrr_ssN0_0000, "trdrb @%rw2,@%rw6,%rb5", 0}, |
| 478 | | {0xb81e,0xb8fe,16,2, 25,ZB8_ddN0_1110_0000_rrrr_ssN0_1110, "trtdrb @%rw2,@%rw6,%rb5", 0}, |
| 479 | | {0xb900,0xb9ff,16,1, 10,ZB9_imm8, "rsvdb9", 0}, |
| 480 | | {0xba10,0xbaf0,16,2, 11,ZBA_ssN0_0000_0000_rrrr_dddd_cccc, "cpib %rb6,@%rw2,%rw5,%c7", 0}, |
| 481 | | {0xba11,0xbaf1,16,2, 11,ZBA_ssN0_0001_0000_rrrr_ddN0_x000, "ldirb @%rw6,@%rw2,%rw5", DASMFLAG_STEP_OVER}, |
| 482 | | {0xba12,0xbaf2,16,2, 11,ZBA_ssN0_0010_0000_rrrr_ddN0_cccc, "cpsib @%rw6,@%rw2,%rw5,%c7", 0}, |
| 483 | | {0xba14,0xbaf4,16,2, 11,ZBA_ssN0_0100_0000_rrrr_dddd_cccc, "cpirb %rb6,@%rw2,%rw5,%c7", DASMFLAG_STEP_OVER}, |
| 484 | | {0xba16,0xbaf6,16,2, 11,ZBA_ssN0_0110_0000_rrrr_ddN0_cccc, "cpsirb @%rw6,@%rw2,%rw5,%c7", DASMFLAG_STEP_OVER}, |
| 485 | | {0xba18,0xbaf8,16,2, 11,ZBA_ssN0_1000_0000_rrrr_dddd_cccc, "cpdb %rb6,@%rw2,%rw5,%c7", 0}, |
| 486 | | {0xba19,0xbaf9,16,2, 11,ZBA_ssN0_1001_0000_rrrr_ddN0_x000, "lddrb @%rw2,@%rw6,%rw5", DASMFLAG_STEP_OVER}, |
| 487 | | {0xba1a,0xbafa,16,2, 11,ZBA_ssN0_1010_0000_rrrr_ddN0_cccc, "cpsdb @%rw6,@%rw2,%rw5,%c7", 0}, |
| 488 | | {0xba1c,0xbafc,16,2, 11,ZBA_ssN0_1100_0000_rrrr_dddd_cccc, "cpdrb %rb6,@%rw2,%rw5,%c7", DASMFLAG_STEP_OVER}, |
| 489 | | {0xba1e,0xbafe,16,2, 11,ZBA_ssN0_1110_0000_rrrr_ddN0_cccc, "cpsdrb @%rw6,@%rw2,%rw5,%c7", DASMFLAG_STEP_OVER}, |
| 490 | | {0xbb10,0xbbf0,16,2, 11,ZBB_ssN0_0000_0000_rrrr_dddd_cccc, "cpi %rw6,@%rw2,%rw5,%c7", 0}, |
| 491 | | {0xbb11,0xbbf1,16,2, 11,ZBB_ssN0_0001_0000_rrrr_ddN0_x000, "ldir @%rw6,@%rw2,%rw5", DASMFLAG_STEP_OVER}, |
| 492 | | {0xbb12,0xbbf2,16,2, 11,ZBB_ssN0_0010_0000_rrrr_ddN0_cccc, "cpsi @%rw6,@%rw2,%rw5,%c7", 0}, |
| 493 | | {0xbb14,0xbbf4,16,2, 11,ZBB_ssN0_0100_0000_rrrr_dddd_cccc, "cpir %rw6,@%rw2,%rw5,%c7", DASMFLAG_STEP_OVER}, |
| 494 | | {0xbb16,0xbbf6,16,2, 11,ZBB_ssN0_0110_0000_rrrr_ddN0_cccc, "cpsir @%rw6,@%rw2,%rw5,%c7", DASMFLAG_STEP_OVER}, |
| 495 | | {0xbb18,0xbbf8,16,2, 11,ZBB_ssN0_1000_0000_rrrr_dddd_cccc, "cpd %rw6,@%rw2,%rw5,%c7", 0}, |
| 496 | | {0xbb19,0xbbf9,16,2, 11,ZBB_ssN0_1001_0000_rrrr_ddN0_x000, "lddr @%rw2,@%rw6,%rw5", DASMFLAG_STEP_OVER}, |
| 497 | | {0xbb1a,0xbbfa,16,2, 11,ZBB_ssN0_1010_0000_rrrr_ddN0_cccc, "cpsd @%rw6,@%rw2,%rw5,%c7", 0}, |
| 498 | | {0xbb1c,0xbbfc,16,2, 11,ZBB_ssN0_1100_0000_rrrr_dddd_cccc, "cpdr %rw6,@%rw2,%rw5,%c7", DASMFLAG_STEP_OVER}, |
| 499 | | {0xbb1e,0xbbfe,16,2, 11,ZBB_ssN0_1110_0000_rrrr_ddN0_cccc, "cpsdr @%rw6,@%rw2,%rw5,%c7", DASMFLAG_STEP_OVER}, |
| 500 | | {0xbc00,0xbcff, 1,1, 9,ZBC_aaaa_bbbb, "rrdb %rb3,%rb2", 0}, |
| 501 | | {0xbd00,0xbdff, 1,1, 5,ZBD_dddd_imm4, "ldk %rw2,%3", 0}, |
| 502 | | {0xbe00,0xbeff, 1,1, 9,ZBE_aaaa_bbbb, "rldb %rb3,%rb2", 0}, |
| 503 | | {0xbf00,0xbfff, 1,1, 10,ZBF_imm8, "rsvdbf", 0}, |
| 504 | | {0xc000,0xcfff, 1,1, 5,ZC_dddd_imm8, "ldb %rb1,%#b1", 0}, |
| 505 | | {0xd000,0xdfff, 1,1, 10,ZD_dsp12, "calr %d2", DASMFLAG_STEP_OVER}, |
| 506 | | {0xe000,0xefff, 1,1, 6,ZE_cccc_dsp8, "jr %c1,%d1", 0}, |
| 507 | | {0xf000,0xf07f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 508 | | {0xf100,0xf17f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 509 | | {0xf200,0xf27f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 510 | | {0xf300,0xf37f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 511 | | {0xf400,0xf47f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 512 | | {0xf500,0xf57f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 513 | | {0xf600,0xf67f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 514 | | {0xf700,0xf77f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 515 | | {0xf800,0xf87f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 516 | | {0xf900,0xf97f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 517 | | {0xfa00,0xfa7f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 518 | | {0xfb00,0xfb7f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 519 | | {0xfc00,0xfc7f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 520 | | {0xfd00,0xfd7f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 521 | | {0xfe00,0xfe7f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 522 | | {0xff00,0xff7f, 1,1, 11,ZF_dddd_0dsp7, "dbjnz %rb1,%d0", DASMFLAG_STEP_OVER}, |
| 523 | | {0xf080,0xf0ff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 524 | | {0xf180,0xf1ff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 525 | | {0xf280,0xf2ff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 526 | | {0xf380,0xf3ff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 527 | | {0xf480,0xf4ff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 528 | | {0xf580,0xf5ff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 529 | | {0xf680,0xf6ff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 530 | | {0xf780,0xf7ff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 531 | | {0xf880,0xf8ff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 532 | | {0xf980,0xf9ff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 533 | | {0xfa80,0xfaff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 534 | | {0xfb80,0xfbff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 535 | | {0xfc80,0xfcff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 536 | | {0xfd80,0xfdff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 537 | | {0xfe80,0xfeff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 538 | | {0xff80,0xffff, 1,1, 11,ZF_dddd_1dsp7, "djnz %rw1,%d0", DASMFLAG_STEP_OVER}, |
| 539 | | {0, 0, 0,0, 0,NULL, NULL, 0} |
| 540 | | }; |
| 541 | 392 | |
| 542 | | /* |
| 543 | | opcodes in segmented mode |
| 544 | | */ |
| 393 | {0x8c01,0x8cf1,16,1, 7,Z8C_dddd_0001, "ldctlb %rb2,flags", 0}, |
| 545 | 394 | |
| 546 | | static const Z8000_init seg_table[] = { |
| 547 | | {0x0000,0x000f, 1,2, 7,Z00_0000_dddd_imm8, "addb %rb3,%#b3", 0}, |
| 548 | | {0x0010,0x00ff, 1,1, 7,Z00_ssN0_dddd, "addb %rb3,@%rw2", 0}, |
| 549 | | {0x0100,0x010f, 1,2, 7,Z01_0000_dddd_imm16, "add %rw3,%#w1", 0}, |
| 550 | | {0x0110,0x01ff, 1,1, 7,Z01_ssN0_dddd, "add %rw3,@%rw2", 0}, |
| 551 | | {0x0200,0x020f, 1,2, 7,Z02_0000_dddd_imm8, "subb %rb3,%#b3", 0}, |
| 552 | | {0x0210,0x02ff, 1,1, 7,Z02_ssN0_dddd, "subb %rb3,@%rw2", 0}, |
| 553 | | {0x0300,0x030f, 1,2, 7,Z03_0000_dddd_imm16, "sub %rw3,%#w1", 0}, |
| 554 | | {0x0310,0x03ff, 1,1, 7,Z03_ssN0_dddd, "sub %rw3,@%rw2", 0}, |
| 555 | | {0x0400,0x040f, 1,2, 7,Z04_0000_dddd_imm8, "orb %rb3,%#b3", 0}, |
| 556 | | {0x0410,0x04ff, 1,1, 7,Z04_ssN0_dddd, "orb %rb3,@%rw2", 0}, |
| 557 | | {0x0500,0x050f, 1,2, 7,Z05_0000_dddd_imm16, "or %rw3,%#w1", 0}, |
| 558 | | {0x0510,0x05ff, 1,1, 7,Z05_ssN0_dddd, "or %rw3,@%rw2", 0}, |
| 559 | | {0x0600,0x060f, 1,2, 7,Z06_0000_dddd_imm8, "andb %rb3,%#b3", 0}, |
| 560 | | {0x0610,0x06ff, 1,1, 7,Z06_ssN0_dddd, "andb %rb3,@%rw2", 0}, |
| 561 | | {0x0700,0x070f, 1,2, 7,Z07_0000_dddd_imm16, "and %rw3,%#w1", 0}, |
| 562 | | {0x0710,0x07ff, 1,1, 7,Z07_ssN0_dddd, "and %rw3,@%rw2", 0}, |
| 563 | | {0x0800,0x080f, 1,2, 7,Z08_0000_dddd_imm8, "xorb %rb3,%#b3", 0}, |
| 564 | | {0x0810,0x08ff, 1,1, 7,Z08_ssN0_dddd, "xorb %rb3,@%rw2", 0}, |
| 565 | | {0x0900,0x090f, 1,2, 7,Z09_0000_dddd_imm16, "xor %rw3,%#w1", 0}, |
| 566 | | {0x0910,0x09ff, 1,1, 7,Z09_ssN0_dddd, "xor %rw3,@%rw2", 0}, |
| 567 | | {0x0a00,0x0a0f, 1,2, 7,Z0A_0000_dddd_imm8, "cpb %rb3,%#b3", 0}, |
| 568 | | {0x0a10,0x0aff, 1,1, 7,Z0A_ssN0_dddd, "cpb %rb3,@%rw2", 0}, |
| 569 | | {0x0b00,0x0b0f, 1,2, 7,Z0B_0000_dddd_imm16, "cp %rw3,%#w1", 0}, |
| 570 | | {0x0b10,0x0bff, 1,1, 7,Z0B_ssN0_dddd, "cp %rw3,@%rw2", 0}, |
| 571 | | {0x0c10,0x0cf0,16,1, 12,Z0C_ddN0_0000, "comb @%rw2", 0}, |
| 572 | | {0x0c11,0x0cf1,16,2, 11,Z0C_ddN0_0001_imm8, "cpb @%rw2,%#b3", 0}, |
| 573 | | {0x0c12,0x0cf2,16,1, 12,Z0C_ddN0_0010, "negb @%rw2", 0}, |
| 574 | | {0x0c14,0x0cf4,16,1, 8,Z0C_ddN0_0100, "testb @%rw2", 0}, |
| 575 | | {0x0c15,0x0cf5,16,2, 7,Z0C_ddN0_0101_imm8, "ldb @%rw2,%#b3", 0}, |
| 576 | | {0x0c16,0x0cf6,16,1, 11,Z0C_ddN0_0110, "tsetb @%rw2", 0}, |
| 577 | | {0x0c18,0x0cf8,16,1, 8,Z0C_ddN0_1000, "clrb @%rw2", 0}, |
| 578 | | {0x0d10,0x0df0,16,1, 12,Z0D_ddN0_0000, "com @%rw2", 0}, |
| 579 | | {0x0d11,0x0df1,16,2, 11,Z0D_ddN0_0001_imm16, "cp @%rw2,%#w1", 0}, |
| 580 | | {0x0d12,0x0df2,16,1, 12,Z0D_ddN0_0010, "neg @%rw2", 0}, |
| 581 | | {0x0d14,0x0df4,16,1, 8,Z0D_ddN0_0100, "test @%rw2", 0}, |
| 582 | | {0x0d15,0x0df5,16,2, 11,Z0D_ddN0_0101_imm16, "ld @%rw2,%#w1", 0}, /* fix cycles ld IR,IM */ |
| 583 | | {0x0d16,0x0df6,16,1, 11,Z0D_ddN0_0110, "tset @%rw2", 0}, |
| 584 | | {0x0d18,0x0df8,16,1, 8,Z0D_ddN0_1000, "clr @%rw2", 0}, |
| 585 | | {0x0d19,0x0df9,16,2, 12,Z0D_ddN0_1001_imm16, "push @%rw2,%#w1", 0}, |
| 586 | | {0x0e00,0x0eff, 1,1, 10,Z0E_imm8, "ext0e %#b1", 0}, |
| 587 | | {0x0f00,0x0fff, 1,1, 10,Z0F_imm8, "ext0f %#b1", 0}, |
| 588 | | {0x1000,0x100f, 1,3, 14,Z10_0000_dddd_imm32, "cpl %rl3,%#l1", 0}, |
| 589 | | {0x1010,0x10ff, 1,1, 14,Z10_ssN0_dddd, "cpl %rl3,@%rw2", 0}, |
| 590 | | {0x1111,0x11ff, 1,1, 20,Z11_ddN0_ssN0, "pushl @%rw2,@%rw3", 0}, |
| 591 | | {0x1200,0x120f, 1,3, 14,Z12_0000_dddd_imm32, "subl %rl3,%#l1", 0}, |
| 592 | | {0x1210,0x12ff, 1,1, 14,Z12_ssN0_dddd, "subl %rl3,@%rw2", 0}, |
| 593 | | {0x1311,0x13ff, 1,1, 13,Z13_ddN0_ssN0, "push @%rw2,@%rw3", 0}, |
| 594 | | {0x1400,0x140f, 1,3, 11,Z14_0000_dddd_imm32, "ldl %rl3,%#l1", 0}, |
| 595 | | {0x1410,0x14ff, 1,1, 11,Z14_ssN0_dddd, "ldl %rl3,@%rw2", 0}, |
| 596 | | {0x1511,0x15ff, 1,1, 19,Z15_ssN0_ddN0, "popl @%rw3,@%rw2", 0}, |
| 597 | | {0x1600,0x160f, 1,3, 14,Z16_0000_dddd_imm32, "addl %rl3,%#l1", 0}, |
| 598 | | {0x1610,0x16ff, 1,1, 14,Z16_ssN0_dddd, "addl %rl3,@%rw2", 0}, |
| 599 | | {0x1711,0x17ff, 1,1, 12,Z17_ssN0_ddN0, "pop @%rw3,@%rw2", 0}, |
| 600 | | {0x1810,0x18ff, 1,1,282,Z18_ssN0_dddd, "multl %rq3,@%rw2", 0}, |
| 601 | | {0x1900,0x190f, 1,2, 70,Z19_0000_dddd_imm16, "mult %rl3,%#w1", 0}, |
| 602 | | {0x1910,0x19ff, 1,1, 70,Z19_ssN0_dddd, "mult %rl3,@%rw2", 0}, |
| 603 | | {0x1a00,0x1a0f, 1,3,744,Z1A_0000_dddd_imm32, "divl %rq3,%#l1", 0}, |
| 604 | | {0x1a10,0x1aff, 1,1,744,Z1A_ssN0_dddd, "divl %rq3,@%rw2", 0}, |
| 605 | | {0x1b00,0x1b0f, 1,2,107,Z1B_0000_dddd_imm16, "div %rl3,%#w1", 0}, |
| 606 | | {0x1b10,0x1bff, 1,1,107,Z1B_ssN0_dddd, "div %rl3,@%rw2", 0}, |
| 607 | | {0x1c11,0x1cf1,16,2, 11,Z1C_ssN0_0001_0000_dddd_0000_nmin1, "ldm %rw5,@%rw2,#%n", 0}, |
| 608 | | {0x1c18,0x1cf8,16,1, 13,Z1C_ddN0_1000, "testl @%rw2", 0}, |
| 609 | | {0x1c19,0x1cf9,16,2, 11,Z1C_ddN0_1001_0000_ssss_0000_nmin1, "ldm @%rw2,%rw5,#%n", 0}, |
| 610 | | {0x1d10,0x1dff, 1,1, 11,Z1D_ddN0_ssss, "ldl @%rw2,%rl3", 0}, |
| 611 | | {0x1e10,0x1eff, 1,1, 10,Z1E_ddN0_cccc, "jp %c3,@%rl2", 0}, |
| 612 | | {0x1f10,0x1ff0,16,1, 10,Z1F_ddN0_0000, "call %rw2", DASMFLAG_STEP_OVER}, |
| 613 | | {0x2010,0x20ff, 1,1, 7,Z20_ssN0_dddd_seg, "ldb %rb3,@%rw2", 0}, |
| 614 | | {0x2100,0x210f, 1,2, 7,Z21_0000_dddd_imm16, "ld %rw3,%#w1", 0}, |
| 615 | | {0x2110,0x21ff, 1,1, 7,Z21_ssN0_dddd, "ld %rw3,@%rw2", 0}, |
| 616 | | {0x2200,0x220f, 1,2, 10,Z22_0000_ssss_0000_dddd_0000_0000, "resb %rb5,%rw3", 0}, |
| 617 | | {0x2210,0x22ff, 1,1, 11,Z22_ddN0_imm4, "resb @%rw3,%3", 0}, |
| 618 | | {0x2300,0x230f, 1,2, 10,Z23_0000_ssss_0000_dddd_0000_0000, "res %rw5,%rw3", 0}, |
| 619 | | {0x2310,0x23ff, 1,1, 11,Z23_ddN0_imm4, "res @%rw3,%3", 0}, |
| 620 | | {0x2400,0x240f, 1,2, 10,Z24_0000_ssss_0000_dddd_0000_0000, "setb %rb5,%rw3", 0}, |
| 621 | | {0x2410,0x24ff, 1,1, 11,Z24_ddN0_imm4, "setb @%rw3,%3", 0}, |
| 622 | | {0x2500,0x250f, 1,2, 10,Z25_0000_ssss_0000_dddd_0000_0000, "set %rw5,%rw3", 0}, |
| 623 | | {0x2510,0x25ff, 1,1, 11,Z25_ddN0_imm4, "set @%rw3,%3", 0}, |
| 624 | | {0x2600,0x260f, 1,2, 10,Z26_0000_ssss_0000_dddd_0000_0000, "bitb %rb5,%rw3", 0}, |
| 625 | | {0x2610,0x26ff, 1,1, 8,Z26_ddN0_imm4, "bitb @%rw3,%3", 0}, |
| 626 | | {0x2700,0x270f, 1,2, 10,Z27_0000_ssss_0000_dddd_0000_0000, "bit %rw5,%rw3", 0}, |
| 627 | | {0x2710,0x27ff, 1,1, 8,Z27_ddN0_imm4, "bit @%rw2,%3", 0}, |
| 628 | | {0x2810,0x28ff, 1,1, 11,Z28_ddN0_imm4m1, "incb @%rw2,%+3", 0}, |
| 629 | | {0x2910,0x29ff, 1,1, 11,Z29_ddN0_imm4m1, "inc @%rw2,%+3", 0}, |
| 630 | | {0x2a10,0x2aff, 1,1, 11,Z2A_ddN0_imm4m1, "decb @%rw2,%+3", 0}, |
| 631 | | {0x2b10,0x2bff, 1,1, 11,Z2B_ddN0_imm4m1, "dec @%rw2,%+3", 0}, |
| 632 | | {0x2c10,0x2cff, 1,1, 12,Z2C_ssN0_dddd, "exb %rb3,@%rw2", 0}, |
| 633 | | {0x2d10,0x2dff, 1,1, 12,Z2D_ssN0_dddd, "ex %rw3,@%rw2", 0}, |
| 634 | | {0x2e10,0x2eff, 1,1, 8,Z2E_ddN0_ssss, "ldb @%rw2,%rb3", 0}, |
| 635 | | {0x2f10,0x2fff, 1,1, 8,Z2F_ddN0_ssss, "ld @%rw2,%rw3", 0}, |
| 636 | | {0x3000,0x300f, 1,2, 14,Z30_0000_dddd_dsp16, "ldrb %rb3,%p1", 0}, |
| 637 | | {0x3010,0x30ff, 1,2, 14,Z30_ssN0_dddd_imm16, "ldb %rb3,%rw2(%#w1)", 0}, |
| 638 | | {0x3100,0x310f, 1,2, 14,Z31_0000_dddd_dsp16, "ldr %rw3,%p1", 0}, |
| 639 | | {0x3110,0x31ff, 1,2, 14,Z31_ssN0_dddd_imm16, "ld %rw3,%rw2(%#w1)", 0}, |
| 640 | | {0x3200,0x320f, 1,2, 14,Z32_0000_ssss_dsp16, "ldrb %p1,%rb3", 0}, |
| 641 | | {0x3210,0x32ff, 1,2, 14,Z32_ddN0_ssss_imm16, "ldb %rw2(%#w1),%rb3", 0}, |
| 642 | | {0x3300,0x330f, 1,2, 14,Z33_0000_ssss_dsp16, "ldr %p1,%rw3", 0}, |
| 643 | | {0x3310,0x33ff, 1,2, 14,Z33_ddN0_ssss_imm16, "ld %rw2(%#w1),%rw3", 0}, |
| 644 | | {0x3400,0x340f, 1,2, 15,Z34_0000_dddd_dsp16, "ldar p%rw3,%p1", 0}, |
| 645 | | {0x3410,0x34ff, 1,2, 15,Z34_ssN0_dddd_imm16, "lda p%rw3,%rw2(%#w1)", 0}, |
| 646 | | {0x3500,0x350f, 1,2, 17,Z35_0000_dddd_dsp16, "ldrl %rl3,%p1", 0}, |
| 647 | | {0x3510,0x35ff, 1,2, 17,Z35_ssN0_dddd_imm16, "ldl %rl3,%rw2(%#w1)", 0}, |
| 648 | | {0x3600,0x3600, 1,1, 2,Z36_0000_0000, "bpt", 0}, |
| 649 | | {0x3601,0x36ff, 1,1, 10,Z36_imm8, "rsvd36", 0}, |
| 650 | | {0x3700,0x370f, 1,2, 17,Z37_0000_ssss_dsp16, "ldrl %p1,%rl3", 0}, |
| 651 | | {0x3710,0x37ff, 1,2, 17,Z37_ddN0_ssss_imm16, "ldl %rw2(%#w1),%rl3", 0}, |
| 652 | | {0x3800,0x38ff, 1,1, 10,Z38_imm8, "rsvd38", 0}, |
| 653 | | {0x3910,0x39f0,16,1, 12,Z39_ssN0_0000, "ldps @%rw2", 0}, |
| 654 | | {0x3a00,0x3af0,16,2, 21,Z3A_ssss_0000_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 655 | | {0x3a01,0x3af1,16,2, 21,Z3A_ssss_0001_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 656 | | {0x3a02,0x3af2,16,2, 21,Z3A_ssss_0010_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 657 | | {0x3a03,0x3af3,16,2, 21,Z3A_ssss_0011_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 658 | | {0x3a04,0x3af4,16,2, 10,Z3A_dddd_0100_imm16, "%R %rb2,%#w1", 0}, |
| 659 | | {0x3a05,0x3af5,16,2, 10,Z3A_dddd_0101_imm16, "%R %rb2,%#w1", 0}, |
| 660 | | {0x3a06,0x3af6,16,2, 12,Z3A_ssss_0110_imm16, "%R %#w1,%rb2", 0}, |
| 661 | | {0x3a07,0x3af7,16,2, 12,Z3A_ssss_0111_imm16, "%R %#w1,%rb2", 0}, |
| 662 | | {0x3a08,0x3af8,16,2, 21,Z3A_ssss_1000_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 663 | | {0x3a09,0x3af9,16,2, 21,Z3A_ssss_1001_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 664 | | {0x3a0a,0x3afa,16,2, 21,Z3A_ssss_1010_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 665 | | {0x3a0b,0x3afb,16,2, 21,Z3A_ssss_1011_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 666 | | {0x3b00,0x3bf0,16,2, 21,Z3B_ssss_0000_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 667 | | {0x3b01,0x3bf1,16,2, 21,Z3B_ssss_0001_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 668 | | {0x3b02,0x3bf2,16,2, 21,Z3B_ssss_0010_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 669 | | {0x3b03,0x3bf3,16,2, 21,Z3B_ssss_0011_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 670 | | {0x3b04,0x3bf4,16,2, 12,Z3B_dddd_0100_imm16, "%R %rw2,%#w1", 0}, |
| 671 | | {0x3b05,0x3bf5,16,2, 12,Z3B_dddd_0101_imm16, "%R %rw2,%#w1", 0}, |
| 672 | | {0x3b06,0x3bf6,16,2, 12,Z3B_ssss_0110_imm16, "%R %#w1,%rw2", 0}, |
| 673 | | {0x3b07,0x3bf7,16,2, 12,Z3B_ssss_0111_imm16, "%R %#w1,%rw2", 0}, |
| 674 | | {0x3b08,0x3bf8,16,2, 21,Z3B_ssss_1000_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 675 | | {0x3b09,0x3bf9,16,2, 21,Z3B_ssss_1001_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rw5", 0}, |
| 676 | | {0x3b0a,0x3bfa,16,2, 21,Z3B_ssss_1010_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rb5", 0}, |
| 677 | | {0x3b0b,0x3bfb,16,2, 21,Z3B_ssss_1011_0000_aaaa_dddd_x000, "%R @%rw6,@%rw2,%rb5", 0}, |
| 678 | | {0x3c00,0x3cff, 1,1, 10,Z3C_ssss_dddd, "inb %rb3,@%rw2", 0}, |
| 679 | | {0x3d00,0x3dff, 1,1, 10,Z3D_ssss_dddd, "in %rw3,@%rw2", 0}, |
| 680 | | {0x3e00,0x3eff, 1,1, 12,Z3E_dddd_ssss_seg, "outb @%rw2,%rb3", 0}, |
| 681 | | {0x3f00,0x3fff, 1,1, 12,Z3F_dddd_ssss, "out @%rw2,%rw3", 0}, |
| 682 | | {0x4000,0x400f, 1,2, 9,Z40_0000_dddd_addr, "addb %rb3,%a1", 0}, |
| 683 | | {0x4010,0x40ff, 1,2, 10,Z40_ssN0_dddd_addr, "addb %rb3,%a1(%rw2)", 0}, |
| 684 | | {0x4100,0x410f, 1,2, 9,Z41_0000_dddd_addr, "add %rw3,%a1", 0}, |
| 685 | | {0x4110,0x41ff, 1,2, 10,Z41_ssN0_dddd_addr, "add %rw3,%a1(%rw2)", 0}, |
| 686 | | {0x4200,0x420f, 1,2, 9,Z42_0000_dddd_addr, "subb %rb3,%a1", 0}, |
| 687 | | {0x4210,0x42ff, 1,2, 10,Z42_ssN0_dddd_addr, "subb %rb3,%a1(%rw2)", 0}, |
| 688 | | {0x4300,0x430f, 1,2, 9,Z43_0000_dddd_addr, "sub %rw3,%a1", 0}, |
| 689 | | {0x4310,0x43ff, 1,2, 10,Z43_ssN0_dddd_addr, "sub %rw3,%a1(%rw2)", 0}, |
| 690 | | {0x4400,0x440f, 1,2, 9,Z44_0000_dddd_addr, "orb %rb3,%a1", 0}, |
| 691 | | {0x4410,0x44ff, 1,2, 10,Z44_ssN0_dddd_addr, "orb %rb3,%a1(%rw2)", 0}, |
| 692 | | {0x4500,0x450f, 1,2, 9,Z45_0000_dddd_addr, "or %rw3,%a1", 0}, |
| 693 | | {0x4510,0x45ff, 1,2, 10,Z45_ssN0_dddd_addr, "or %rw3,%a1(%rw2)", 0}, |
| 694 | | {0x4600,0x460f, 1,2, 9,Z46_0000_dddd_addr, "andb %rb3,%a1", 0}, |
| 695 | | {0x4610,0x46ff, 1,2, 10,Z46_ssN0_dddd_addr, "andb %rb3,%a1(%rw2)", 0}, |
| 696 | | {0x4700,0x470f, 1,2, 9,Z47_0000_dddd_addr, "and %rw3,%a1", 0}, |
| 697 | | {0x4710,0x47ff, 1,2, 10,Z47_ssN0_dddd_addr, "and %rw3,%a1(%rw2)", 0}, |
| 698 | | {0x4800,0x480f, 1,2, 9,Z48_0000_dddd_addr, "xorb %rb3,%a1", 0}, |
| 699 | | {0x4810,0x48ff, 1,2, 10,Z48_ssN0_dddd_addr, "xorb %rb3,%a1(%rw2)", 0}, |
| 700 | | {0x4900,0x490f, 1,2, 9,Z49_0000_dddd_addr, "xor %rw3,%a1", 0}, |
| 701 | | {0x4910,0x49ff, 1,2, 10,Z49_ssN0_dddd_addr, "xor %rw3,%a1(%rw2)", 0}, |
| 702 | | {0x4a00,0x4a0f, 1,2, 9,Z4A_0000_dddd_addr, "cpb %rb3,%a1", 0}, |
| 703 | | {0x4a10,0x4aff, 1,2, 10,Z4A_ssN0_dddd_addr, "cpb %rb3,%a1(%rw2)", 0}, |
| 704 | | {0x4b00,0x4b0f, 1,2, 9,Z4B_0000_dddd_addr, "cp %rw3,%a1", 0}, |
| 705 | | {0x4b10,0x4bff, 1,2, 10,Z4B_ssN0_dddd_addr, "cp %rw3,%a1(%rw2)", 0}, |
| 706 | | {0x4c00,0x4c00, 1,2, 15,Z4C_0000_0000_addr, "comb %a1", 0}, |
| 707 | | {0x4c01,0x4c01, 1,3, 14,Z4C_0000_0001_addr_imm8, "cpb %a1,%#b3", 0}, |
| 708 | | {0x4c02,0x4c02, 1,2, 15,Z4C_0000_0010_addr, "negb %a1", 0}, |
| 709 | | {0x4c04,0x4c04, 1,2, 11,Z4C_0000_0100_addr, "testb %a1", 0}, |
| 710 | | {0x4c05,0x4c05, 1,3, 14,Z4C_0000_0101_addr_imm8, "ldb %a1,%#b3", 0}, |
| 711 | | {0x4c06,0x4c06, 1,2, 14,Z4C_0000_0110_addr, "tsetb %a1", 0}, |
| 712 | | {0x4c08,0x4c08, 1,1, 0, Z4C_0000_1000_addr_seg, "clrb %a1", 0}, |
| 713 | | {0x4c10,0x4cf0,16,2, 16,Z4C_ddN0_0000_addr, "comb %a1(%rw2)", 0}, |
| 714 | | {0x4c11,0x4cf1,16,3, 15,Z4C_ddN0_0001_addr_imm8, "cpb %a1(%rw2),%#b3", 0}, |
| 715 | | {0x4c12,0x4cf2,16,2, 16,Z4C_ddN0_0010_addr, "negb %a1(%rw2)", 0}, |
| 716 | | {0x4c14,0x4cf4,16,2, 12,Z4C_ddN0_0100_addr, "testb %a1(%rw2)", 0}, |
| 717 | | {0x4c15,0x4cf5,16,3, 15,Z4C_ddN0_0101_addr_imm8, "ldb %a1(%rw2),%#b3", 0}, |
| 718 | | {0x4c16,0x4cf6,16,2, 15,Z4C_ddN0_0110_addr, "tsetb %a1(%rw2)", 0}, |
| 719 | | {0x4c18,0x4cf8,16,2, 12,Z4C_ddN0_1000_addr, "clrb %a1(%rw2)", 0}, |
| 720 | | {0x4d00,0x4d00, 1,2, 15,Z4D_0000_0000_addr, "com %a1", 0}, |
| 721 | | {0x4d01,0x4d01, 1,3, 14,Z4D_0000_0001_addr_imm16, "cp %a1,%#w2", 0}, |
| 722 | | {0x4d02,0x4d02, 1,2, 15,Z4D_0000_0010_addr, "neg %a1", 0}, |
| 723 | | {0x4d04,0x4d04, 1,2, 11,Z4D_0000_0100_addr, "test %a1", 0}, |
| 724 | | {0x4d05,0x4d05, 1,1, 0, Z4D_0000_0101_addr_imm16_seg, "ld %a1,%#w2", 0}, |
| 725 | | {0x4d06,0x4d06, 1,2, 14,Z4D_0000_0110_addr, "tset %a1", 0}, |
| 726 | | {0x4d08,0x4d08, 1,1, 0, Z4D_0000_1000_addr_seg, "clr %a1", 0}, |
| 727 | | {0x4d10,0x4df0,16,2, 16,Z4D_ddN0_0000_addr, "com %a1(%rw2)", 0}, |
| 728 | | {0x4d11,0x4df1,16,3, 15,Z4D_ddN0_0001_addr_imm16, "cp %a1(%rw2),%#w2", 0}, |
| 729 | | {0x4d12,0x4df2,16,2, 16,Z4D_ddN0_0010_addr, "neg %a1(%rw2)", 0}, |
| 730 | | {0x4d14,0x4df4,16,2, 12,Z4D_ddN0_0100_addr, "test %a1(%rw2)", 0}, |
| 731 | | {0x4d15,0x4df5,16,3, 15,Z4D_ddN0_0101_addr_imm16, "ld %a1(%rw2),%#w2", 0}, |
| 732 | | {0x4d16,0x4df6,16,2, 15,Z4D_ddN0_0110_addr, "tset %a1(%rw2)", 0}, |
| 733 | | {0x4d18,0x4df8,16,2, 12,Z4D_ddN0_1000_addr, "clr %a1(%rw2)", 0}, |
| 734 | | {0x4e11,0x4ef0,16,2, 12,Z4E_ddN0_ssN0_addr, "ldb %a1(%rw2),%rb3", 0}, |
| 735 | | {0x5000,0x500f, 1,2, 15,Z50_0000_dddd_addr, "cpl %rl3,%a1", 0}, |
| 736 | | {0x5010,0x50ff, 1,2, 16,Z50_ssN0_dddd_addr, "cpl %rl3,%a1(%rw2)", 0}, |
| 737 | | {0x5110,0x51f0,16,2, 21,Z51_ddN0_0000_addr, "pushl @%rw2,%a1", 0}, |
| 738 | | {0x5111,0x51f1,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 739 | | {0x5112,0x51f2,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 740 | | {0x5113,0x51f3,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 741 | | {0x5114,0x51f4,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 742 | | {0x5115,0x51f5,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 743 | | {0x5116,0x51f6,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 744 | | {0x5117,0x51f7,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 745 | | {0x5118,0x51f8,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 746 | | {0x5119,0x51f9,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 747 | | {0x511a,0x51fa,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 748 | | {0x511b,0x51fb,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 749 | | {0x511c,0x51fc,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 750 | | {0x511d,0x51fd,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 751 | | {0x511e,0x51fe,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 752 | | {0x511f,0x51ff,16,2, 21,Z51_ddN0_ssN0_addr, "pushl @%rw2,%a1(%rw3)", 0}, |
| 753 | | {0x5200,0x520f, 1,2, 15,Z52_0000_dddd_addr, "subl %rl3,%a1", 0}, |
| 754 | | {0x5210,0x52ff, 1,2, 16,Z52_ssN0_dddd_addr, "subl %rl3,%a1(%rw2)", 0}, |
| 755 | | {0x5310,0x53f0,16,2, 14,Z53_ddN0_0000_addr, "push @%rw2,%a1", 0}, |
| 756 | | {0x5311,0x53f1,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 757 | | {0x5312,0x53f2,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 758 | | {0x5313,0x53f3,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 759 | | {0x5314,0x53f4,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 760 | | {0x5315,0x53f5,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 761 | | {0x5316,0x53f6,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 762 | | {0x5317,0x53f7,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 763 | | {0x5318,0x53f8,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 764 | | {0x5319,0x53f9,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 765 | | {0x531a,0x53fa,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 766 | | {0x531b,0x53fb,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 767 | | {0x531c,0x53fc,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 768 | | {0x531d,0x53fd,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 769 | | {0x531e,0x53fe,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 770 | | {0x531f,0x53ff,16,2, 14,Z53_ddN0_ssN0_addr, "push @%rw2,%a1(%rw3)", 0}, |
| 771 | | {0x5400,0x540f, 1,2, 12,Z54_0000_dddd_addr, "ldl %rl3,%a1", 0}, |
| 772 | | {0x5410,0x54ff, 1,2, 13,Z54_ssN0_dddd_addr, "ldl %rl3,%a1(%rw2)", 0}, |
| 773 | | {0x5510,0x55f0,16,2, 23,Z55_ssN0_0000_addr, "popl %a1,@%rw2", 0}, |
| 774 | | {0x5511,0x55f1,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 775 | | {0x5512,0x55f2,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 776 | | {0x5513,0x55f3,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 777 | | {0x5514,0x55f4,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 778 | | {0x5515,0x55f5,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 779 | | {0x5516,0x55f6,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 780 | | {0x5517,0x55f7,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 781 | | {0x5518,0x55f8,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 782 | | {0x5519,0x55f9,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 783 | | {0x551a,0x55fa,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 784 | | {0x551b,0x55fb,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 785 | | {0x551c,0x55fc,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 786 | | {0x551d,0x55fd,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 787 | | {0x551e,0x55fe,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 788 | | {0x551f,0x55ff,16,2, 23,Z55_ssN0_ddN0_addr, "popl %a1(%rw3),@%rw2", 0}, |
| 789 | | {0x5600,0x560f, 1,2, 15,Z56_0000_dddd_addr, "addl %rl3,%a1", 0}, |
| 790 | | {0x5610,0x56ff, 1,2, 16,Z56_ssN0_dddd_addr, "addl %rl3,%a1(%rw2)", 0}, |
| 791 | | {0x5710,0x57f0,16,2, 16,Z57_ssN0_0000_addr, "pop %a1,@%rw2", 0}, |
| 792 | | {0x5711,0x57f1,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 793 | | {0x5712,0x57f2,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 794 | | {0x5713,0x57f3,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 795 | | {0x5714,0x57f4,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 796 | | {0x5715,0x57f5,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 797 | | {0x5716,0x57f6,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 798 | | {0x5717,0x57f7,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 799 | | {0x5718,0x57f8,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 800 | | {0x5719,0x57f9,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 801 | | {0x571a,0x57fa,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 802 | | {0x571b,0x57fb,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 803 | | {0x571c,0x57fc,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 804 | | {0x571d,0x57fd,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 805 | | {0x571e,0x57fe,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 806 | | {0x571f,0x57ff,16,2, 16,Z57_ssN0_ddN0_addr, "pop %a1(%rw3),@%rw2", 0}, |
| 807 | | {0x5800,0x580f, 1,2,283,Z58_0000_dddd_addr, "multl %rq3,%a1", 0}, |
| 808 | | {0x5810,0x58ff, 1,2,284,Z58_ssN0_dddd_addr, "multl %rq3,%a1(%rw2)", 0}, |
| 809 | | {0x5900,0x590f, 1,2, 71,Z59_0000_dddd_addr, "mult %rl3,%a1", 0}, |
| 810 | | {0x5910,0x59ff, 1,2, 72,Z59_ssN0_dddd_addr, "mult %rl3,%a1(%rw2)", 0}, |
| 811 | | {0x5a00,0x5a0f, 1,2,745,Z5A_0000_dddd_addr, "divl %rq3,%a1", 0}, |
| 812 | | {0x5a10,0x5aff, 1,2,746,Z5A_ssN0_dddd_addr, "divl %rq3,%a1(%rw2)", 0}, |
| 813 | | {0x5b00,0x5b0f, 1,2,108,Z5B_0000_dddd_addr, "div %rl3,%a1", 0}, |
| 814 | | {0x5b10,0x5bff, 1,2,109,Z5B_ssN0_dddd_addr, "div %rl3,%a1(%rw2)", 0}, |
| 815 | | {0x5c01,0x5c01, 1,3, 14,Z5C_0000_0001_0000_dddd_0000_nmin1_addr, "ldm %rw5,%a2,#%n", 0}, |
| 816 | | {0x5c08,0x5c08, 1,2, 16,Z5C_0000_1000_addr, "testl %a1", 0}, |
| 817 | | {0x5c09,0x5c09, 1,3, 14,Z5C_0000_1001_0000_ssss_0000_nmin1_addr, "ldm %a2,%rw5,#%n", 0}, |
| 818 | | {0x5c11,0x5cf1,16,3, 15,Z5C_ssN0_0001_0000_dddd_0000_nmin1_addr, "ldm %rw5,%a2(%rw2),#%n", 0}, |
| 819 | | {0x5c18,0x5cf8,16,2, 17,Z5C_ddN0_1000_addr, "testl %a1(%rw2)", 0}, |
| 820 | | {0x5c19,0x5cf9,16,3, 15,Z5C_ddN0_1001_0000_ssN0_0000_nmin1_addr, "ldm %a2(%rw2),%rw5,#%n", 0}, |
| 821 | | {0x5d00,0x5d0f, 1,2, 15,Z5D_0000_ssss_addr, "ldl %a1,%rl3", 0}, |
| 822 | | {0x5d10,0x5dff, 1,2, 14,Z5D_ddN0_ssss_addr, "ldl %a1(%rw2),%rl3", 0}, |
| 823 | | {0x5e00,0x5e0f, 1,2, 7,Z5E_0000_cccc_addr, "jp %c3,%a1", 0}, |
| 824 | | {0x5e10,0x5eff, 1,2, 8,Z5E_ddN0_cccc_addr, "jp %c3,%a1(%rw2)", 0}, |
| 825 | | {0x5f00,0x5f00, 1,2, 12,Z5F_0000_0000_addr, "call %a1", DASMFLAG_STEP_OVER}, |
| 826 | | {0x5f10,0x5ff0,16,2, 13,Z5F_ddN0_0000_addr, "call %a1(%rw2)", DASMFLAG_STEP_OVER}, |
| 827 | | {0x6000,0x600f, 1,2, 9,Z60_0000_dddd_addr, "ldb %rb3,%a1", 0}, |
| 828 | | {0x6010,0x60ff, 1,2, 10,Z60_ssN0_dddd_addr, "ldb %rb3,%a1(%rw2)", 0}, |
| 829 | | {0x6100,0x610f, 1,2, 9,Z61_0000_dddd_addr, "ld %rw3,%a1", 0}, |
| 830 | | {0x6110,0x61ff, 1,2, 10,Z61_ssN0_dddd_addr, "ld %rw3,%a1(%rw2)", 0}, |
| 831 | | {0x6200,0x620f, 1,2, 13,Z62_0000_imm4_addr, "resb %a1,%3", 0}, |
| 832 | | {0x6210,0x62ff, 1,2, 14,Z62_ddN0_imm4_addr, "resb %a1(%rw2),%3", 0}, |
| 833 | | {0x6300,0x630f, 1,2, 13,Z63_0000_imm4_addr, "res %a1,%3", 0}, |
| 834 | | {0x6310,0x63ff, 1,2, 14,Z63_ddN0_imm4_addr, "res %a1(%rw2),%3", 0}, |
| 835 | | {0x6400,0x640f, 1,2, 13,Z64_0000_imm4_addr, "setb %a1,%3", 0}, |
| 836 | | {0x6410,0x64ff, 1,2, 14,Z64_ddN0_imm4_addr, "setb %a1(%rw2),%3", 0}, |
| 837 | | {0x6500,0x650f, 1,2, 13,Z65_0000_imm4_addr, "set %a1,%3", 0}, |
| 838 | | {0x6510,0x65ff, 1,2, 14,Z65_ddN0_imm4_addr, "set %a1(%rw2),%3", 0}, |
| 839 | | {0x6600,0x660f, 1,2, 10,Z66_0000_imm4_addr, "bitb %a1,%3", 0}, |
| 840 | | {0x6610,0x66ff, 1,2, 11,Z66_ddN0_imm4_addr, "bitb %a1(%rw2),%3", 0}, |
| 841 | | {0x6700,0x670f, 1,2, 10,Z67_0000_imm4_addr, "bit %a1,%3", 0}, |
| 842 | | {0x6710,0x67ff, 1,2, 11,Z67_ddN0_imm4_addr, "bit %a1(%rw2),%3", 0}, |
| 843 | | {0x6800,0x680f, 1,2, 13,Z68_0000_imm4m1_addr, "incb %a1,%+3", 0}, |
| 844 | | {0x6810,0x68ff, 1,2, 14,Z68_ddN0_imm4m1_addr, "incb %a1(%rw2),%+3", 0}, |
| 845 | | {0x6900,0x690f, 1,2, 13,Z69_0000_imm4m1_addr, "inc %a1,%+3", 0}, |
| 846 | | {0x6910,0x69ff, 1,2, 14,Z69_ddN0_imm4m1_addr, "inc %a1(%rw2),%+3", 0}, |
| 847 | | {0x6a00,0x6a0f, 1,2, 13,Z6A_0000_imm4m1_addr, "decb %a1,%+3", 0}, |
| 848 | | {0x6a10,0x6aff, 1,2, 14,Z6A_ddN0_imm4m1_addr, "decb %a1(%rw2),%+3", 0}, |
| 849 | | {0x6b00,0x6b0f, 1,2, 13,Z6B_0000_imm4m1_addr, "dec %a1,%+3", 0}, |
| 850 | | {0x6b10,0x6bff, 1,2, 14,Z6B_ddN0_imm4m1_addr, "dec %a1(%rw2),%+3", 0}, |
| 851 | | {0x6c00,0x6c0f, 1,2, 15,Z6C_0000_dddd_addr, "exb %rb3,%a1", 0}, |
| 852 | | {0x6c10,0x6cff, 1,2, 16,Z6C_ssN0_dddd_addr, "exb %rb3,%a1(%rw2)", 0}, |
| 853 | | {0x6d00,0x6d0f, 1,2, 15,Z6D_0000_dddd_addr, "ex %rw3,%a1", 0}, |
| 854 | | {0x6d10,0x6dff, 1,2, 16,Z6D_ssN0_dddd_addr, "ex %rw3,%a1(%rw2)", 0}, |
| 855 | | {0x6e00,0x6e0f, 1,2, 11,Z6E_0000_ssss_addr, "ldb %a1,%rb3", 0}, |
| 856 | | {0x6e10,0x6eff, 1,2, 11,Z6E_ddN0_ssss_addr, "ldb %a1(%rw2),%rb3", 0}, |
| 857 | | {0x6f00,0x6f0f, 1,2, 11,Z6F_0000_ssss_addr, "ld %a1,%rw3", 0}, |
| 858 | | {0x6f10,0x6fff, 1,2, 12,Z6F_ddN0_ssss_addr, "ld %a1(%rw2),%rw3", 0}, |
| 859 | | {0x7010,0x70ff, 1,2, 14,Z70_ssN0_dddd_0000_xxxx_0000_0000, "ldb %rb3,%rw2(%rw5)", 0}, |
| 860 | | {0x7110,0x71ff, 1,2, 14,Z71_ssN0_dddd_0000_xxxx_0000_0000, "ld %rw3,%rw2(%rw5)", 0}, |
| 861 | | {0x7210,0x72ff, 1,2, 14,Z72_ddN0_ssss_0000_xxxx_0000_0000, "ldb %rw2(%rw5),%rb3", 0}, |
| 862 | | {0x7310,0x73ff, 1,2, 14,Z73_ddN0_ssss_0000_xxxx_0000_0000, "ld %rw2(%rw5),%rw3", 0}, |
| 863 | | {0x7410,0x74ff, 1,2, 15,Z74_ssN0_dddd_0000_xxxx_0000_0000, "lda p%rw3,%rw2(%rw5)", 0}, |
| 864 | | {0x7510,0x75ff, 1,2, 17,Z75_ssN0_dddd_0000_xxxx_0000_0000, "ldl %rl3,%rw2(%rw5)", 0}, |
| 865 | | {0x7600,0x760f, 1,1, 0, Z76_0000_dddd_addr_seg, "lda p%rw3,%a1", 0}, |
| 866 | | {0x7610,0x76ff, 1,2, 13,Z76_ssN0_dddd_addr, "lda p%rw3,%a1(%rw2)", 0}, |
| 867 | | {0x7710,0x77ff, 1,2, 17,Z77_ddN0_ssss_0000_xxxx_0000_0000, "ldl %rw2(%rw5),%rl3", 0}, |
| 868 | | {0x7800,0x78ff, 1,1, 10,Z78_imm8, "rsvd78", 0}, |
| 869 | | {0x7900,0x7900, 1,2, 16,Z79_0000_0000_addr, "ldps %a1", 0}, |
| 870 | | {0x7910,0x79f0,16,2, 17,Z79_ssN0_0000_addr, "ldps %a1(%rw2)", 0}, |
| 871 | | {0x7a00,0x7a00, 1,1, 8,Z7A_0000_0000, "halt", DASMFLAG_STEP_OVER}, |
| 872 | | {0x7b00,0x7b00, 1,1, 13,Z7B_0000_0000, "iret", DASMFLAG_STEP_OUT}, |
| 873 | | {0x7b08,0x7b08, 1,1, 5,Z7B_0000_1000, "mset", 0}, |
| 874 | | {0x7b09,0x7b09, 1,1, 5,Z7B_0000_1001, "mres", 0}, |
| 875 | | {0x7b0a,0x7b0a, 1,1, 7,Z7B_0000_1010, "mbit", 0}, |
| 876 | | {0x7b0d,0x7bfd,16,1, 12,Z7B_dddd_1101, "mreq %rw2", 0}, |
| 877 | | {0x7c00,0x7c03, 1,1, 7,Z7C_0000_00ii, "di %i3", 0}, |
| 878 | | {0x7c04,0x7c07, 1,1, 7,Z7C_0000_01ii, "ei %i3", 0}, |
| 879 | | {0x7d00,0x7df0,16,1, 7,Z7D_dddd_0ccc, "ldctl %rw2,ctrl0", 0}, |
| 880 | | {0x7d01,0x7df1,16,1, 7,Z7D_dddd_0ccc, "ldctl %rw2,ctrl1", 0}, |
| 881 | | {0x7d02,0x7df2,16,1, 7,Z7D_dddd_0ccc, "ldctl %rw2,fcw", 0}, |
| 882 | | {0x7d03,0x7df3,16,1, 7,Z7D_dddd_0ccc, "ldctl %rw2,refresh", 0}, |
| 883 | | {0x7d04,0x7df4,16,1, 7,Z7D_dddd_0ccc, "ldctl %rw2,ctrl4", 0}, |
| 884 | | {0x7d05,0x7df5,16,1, 7,Z7D_dddd_0ccc, "ldctl %rw2,psap", 0}, |
| 885 | | {0x7d06,0x7df6,16,1, 7,Z7D_dddd_0ccc, "ldctl %rw2,ctrl6", 0}, |
| 886 | | {0x7d07,0x7df7,16,1, 7,Z7D_dddd_0ccc, "ldctl %rw2,nsp", 0}, |
| 887 | | {0x7d08,0x7df8,16,1, 7,Z7D_ssss_1ccc, "ldctl ctrl0,%rw2", 0}, |
| 888 | | {0x7d09,0x7df9,16,1, 7,Z7D_ssss_1ccc, "ldctl ctrl1,%rw2", 0}, |
| 889 | | {0x7d0a,0x7dfa,16,1, 7,Z7D_ssss_1ccc, "ldctl fcw,%rw2", 0}, |
| 890 | | {0x7d0b,0x7dfb,16,1, 7,Z7D_ssss_1ccc, "ldctl refresh,%rw2", 0}, |
| 891 | | {0x7d0c,0x7dfc,16,1, 7,Z7D_ssss_1ccc, "ldctl ctrl4,%rw2", 0}, |
| 892 | | {0x7d0d,0x7dfd,16,1, 7,Z7D_ssss_1ccc, "ldctl psap,%rw2", 0}, |
| 893 | | {0x7d0e,0x7dfe,16,1, 7,Z7D_ssss_1ccc, "ldctl ctrl6,%rw2", 0}, |
| 894 | | {0x7d0f,0x7dff,16,1, 7,Z7D_ssss_1ccc, "ldctl nsp,%rw2", 0}, |
| 895 | | {0x7e00,0x7eff, 1,1, 10,Z7E_imm8, "rsvd7e %#b1", 0}, |
| 896 | | {0x7f00,0x7fff, 1,1, 33,Z7F_imm8, "sc %#b1", 0}, |
| 897 | | {0x8000,0x80ff, 1,1, 4,Z80_ssss_dddd, "addb %rb3,%rb2", 0}, |
| 898 | | {0x8100,0x81ff, 1,1, 4,Z81_ssss_dddd, "add %rw3,%rw2", 0}, |
| 899 | | {0x8200,0x82ff, 1,1, 4,Z82_ssss_dddd, "subb %rb3,%rb2", 0}, |
| 900 | | {0x8300,0x83ff, 1,1, 4,Z83_ssss_dddd, "sub %rw3,%rw2", 0}, |
| 901 | | {0x8400,0x84ff, 1,1, 4,Z84_ssss_dddd, "orb %rb3,%rb2", 0}, |
| 902 | | {0x8500,0x85ff, 1,1, 4,Z85_ssss_dddd, "or %rw3,%rw2", 0}, |
| 903 | | {0x8600,0x86ff, 1,1, 4,Z86_ssss_dddd, "andb %rb3,%rb2", 0}, |
| 904 | | {0x8700,0x87ff, 1,1, 4,Z87_ssss_dddd, "and %rw3,%rw2", 0}, |
| 905 | | {0x8800,0x88ff, 1,1, 4,Z88_ssss_dddd, "xorb %rb3,%rb2", 0}, |
| 906 | | {0x8900,0x89ff, 1,1, 4,Z89_ssss_dddd, "xor %rw3,%rw2", 0}, |
| 907 | | {0x8a00,0x8aff, 1,1, 4,Z8A_ssss_dddd, "cpb %rb3,%rb2", 0}, |
| 908 | | {0x8b00,0x8bff, 1,1, 4,Z8B_ssss_dddd, "cp %rw3,%rw2", 0}, |
| 909 | | {0x8c00,0x8cf0,16,1, 7,Z8C_dddd_0000, "comb %rb2", 0}, |
| 910 | | {0x8c02,0x8cf2,16,1, 7,Z8C_dddd_0010, "negb %rb2", 0}, |
| 911 | | {0x8c04,0x8cf4,16,1, 7,Z8C_dddd_0100, "testb %rb2", 0}, |
| 912 | | {0x8c06,0x8cf6,16,1, 7,Z8C_dddd_0110, "tsetb %rb2", 0}, |
| 913 | 395 | {0x8c08,0x8cf8,16,1, 7,Z8C_dddd_1000, "clrb %rb2", 0}, |
| 396 | |
| 397 | {0x8c09,0x8cf9,16,1, 7,Z8C_dddd_1001, "ldctlb flags,%rb2", 0}, |
| 398 | |
| 914 | 399 | {0x8d00,0x8df0,16,1, 7,Z8D_dddd_0000, "com %rw2", 0}, |
| 915 | 400 | {0x8d01,0x8df1,16,1, 7,Z8D_imm4_0001, "setflg %f2", 0}, |
| 916 | 401 | {0x8d02,0x8df2,16,1, 7,Z8D_dddd_0010, "neg %rw2", 0}, |
| r15120 | r15121 | |
| 1062 | 547 | }; |
| 1063 | 548 | |
| 1064 | 549 | |
| 1065 | | void z8001_init_tables(void) |
| 550 | void z8000_init_tables(void) |
| 1066 | 551 | { |
| 1067 | 552 | const Z8000_init *init; |
| 1068 | 553 | int i; |
| r15120 | r15121 | |
| 1087 | 572 | } |
| 1088 | 573 | |
| 1089 | 574 | /* now decompose the initialization table */ |
| 1090 | | for (init = seg_table; init->size; init++) |
| 1091 | | { |
| 1092 | | for (i = init->beg; i <= init->end; i += init->step) |
| 1093 | | { |
| 1094 | | if (z8000_exec[i].opcode != zinvalid) |
| 1095 | | logerror("Z8000 opcode %04x clash '%s'\n", i, z8000_exec[i].dasm); |
| 1096 | | |
| 1097 | | z8000_exec[i].opcode = init->opcode; |
| 1098 | | z8000_exec[i].cycles = init->cycles; |
| 1099 | | z8000_exec[i].size = init->size; |
| 1100 | | z8000_exec[i].dasm = init->dasm; |
| 1101 | | z8000_exec[i].dasmflags = init->dasmflags; |
| 1102 | | } |
| 1103 | | } |
| 1104 | | } |
| 1105 | | |
| 1106 | | void z8002_init_tables(void) |
| 1107 | | { |
| 1108 | | const Z8000_init *init; |
| 1109 | | int i; |
| 1110 | | |
| 1111 | | /* allocate the opcode execution and disassembler array */ |
| 1112 | | z8000_exec = global_alloc_array(Z8000_exec, 0x10000); |
| 1113 | | |
| 1114 | | /* set up the zero, sign, parity lookup table */ |
| 1115 | | for (i = 0; i < 256; i++) |
| 1116 | | z8000_zsp[i] = ((i == 0) ? F_Z : 0) | |
| 1117 | | ((i & 128) ? F_S : 0) | |
| 1118 | | ((((i>>7)^(i>>6)^(i>>5)^(i>>4)^(i>>3)^(i>>2)^(i>>1)^i) & 1) ? F_PV : 0); |
| 1119 | | |
| 1120 | | /* first set all 64K opcodes to invalid */ |
| 1121 | | for (i = 0; i < 0x10000; i++) |
| 1122 | | { |
| 1123 | | z8000_exec[i].opcode = zinvalid; |
| 1124 | | z8000_exec[i].cycles = 4; |
| 1125 | | z8000_exec[i].size = 1; |
| 1126 | | z8000_exec[i].dasm = ".word %#w0"; |
| 1127 | | z8000_exec[i].dasmflags = 0; |
| 1128 | | } |
| 1129 | | |
| 1130 | | /* now decompose the initialization table */ |
| 1131 | 575 | for (init = table; init->size; init++) |
| 1132 | 576 | { |
| 1133 | 577 | for (i = init->beg; i <= init->end; i += init->step) |