trunk/src/emu/machine/i8089.c
| r24859 | r24860 | |
| 46 | 46 | protected: |
| 47 | 47 | // device-level overrides |
| 48 | 48 | virtual void device_start(); |
| 49 | virtual void device_reset(); |
| 49 | 50 | virtual void execute_run(); |
| 50 | 51 | |
| 51 | 52 | int m_icount; |
| r24859 | r24860 | |
| 53 | 54 | private: |
| 54 | 55 | |
| 55 | 56 | // opcodes |
| 57 | void add_rm(int r, int m, int o = 0); |
| 58 | void add_mr(int m, int r, int o = 0); |
| 59 | void addb_rm(int r, int m, int o = 0); |
| 60 | void addb_mr(int m, int r, int o = 0); |
| 61 | void addbi_ri(int r, int i); |
| 62 | void addbi_mi(int m, int i, int o = 0); |
| 63 | void addi_ri(int r, int i); |
| 64 | void addi_mi(int m, int i, int o = 0); |
| 65 | void and_rm(int r, int m, int o = 0); |
| 66 | void and_mr(int m, int r, int o = 0); |
| 67 | void andb_rm(int r, int m, int o = 0); |
| 68 | void andb_mr(int m, int r, int o = 0); |
| 69 | void andbi_ri(int r, int i); |
| 70 | void andbi_mi(int m, int i, int o = 0); |
| 71 | void andi_ri(int r, int i); |
| 72 | void andi_mi(int m, int i, int o = 0); |
| 73 | void call(int m, int d, int o = 0); |
| 74 | void clr(int m, int b, int o = 0); |
| 75 | void dec_r(int r); |
| 76 | void dec_m(int m, int o = 0); |
| 77 | void decb(int m, int o = 0); |
| 56 | 78 | void hlt(); |
| 79 | void inc_r(int r); |
| 80 | void inc_m(int m, int o = 0); |
| 81 | void incb(int m, int o = 0); |
| 82 | void jbt(int m, int b, int d, int o = 0); |
| 83 | void jmce(int m, int d, int o = 0); |
| 84 | void jmcne(int m, int d, int o = 0); |
| 85 | void jmp(int d); |
| 86 | void jnbt(int m, int b, int d, int o = 0); |
| 87 | void jnz_r(int r, int d); |
| 88 | void jnz_m(int m, int d, int o = 0); |
| 89 | void jnzb(int m, int d, int o = 0); |
| 90 | void jz_r(int r, int d); |
| 91 | void jz_m(int m, int d, int o = 0); |
| 92 | void jzb(int m, int d, int o = 0); |
| 93 | void lcall(int m, int d, int o = 0); |
| 94 | void ljbt(int m, int b, int d, int o = 0); |
| 95 | void ljmce(int m, int d, int o = 0); |
| 96 | void ljmcne(int m, int d, int o = 0); |
| 97 | void ljmp(int d); |
| 98 | void ljnbt(int m, int b, int d, int o = 0); |
| 99 | void ljnz_r(int r, int d); |
| 100 | void ljnz_m(int m, int d, int o = 0); |
| 101 | void ljnzb(int m, int d, int o = 0); |
| 102 | void ljz_r(int r, int d); |
| 103 | void ljz_m(int m, int d, int o = 0); |
| 104 | void ljzb(int m, int d, int o = 0); |
| 57 | 105 | void lpd(int p, int m, int o = 0); |
| 58 | 106 | void lpdi(int p, int i, int o = 0); |
| 107 | void mov_mr(int m, int r, int o = 0); |
| 108 | void mov_rm(int r, int m, int o = 0); |
| 109 | void mov_mm(int m1, int m2, int o1 = 0, int o2 = 0); |
| 59 | 110 | void movb_mr(int m, int r, int o = 0); |
| 60 | 111 | void movb_rm(int r, int m, int o = 0); |
| 61 | 112 | void movb_mm(int m1, int m2, int o1 = 0, int o2 = 0); |
| r24859 | r24860 | |
| 66 | 117 | void movp_mp(int m, int p, int o = 0); |
| 67 | 118 | void movp_pm(int p, int m, int o = 0); |
| 68 | 119 | void nop(); |
| 120 | void not_r(int r); |
| 121 | void not_m(int m, int o = 0); |
| 122 | void not_rm(int r, int m, int o = 0); |
| 123 | void notb_m(int m, int o = 0); |
| 124 | void notb_rm(int r, int m, int o = 0); |
| 125 | void or_rm(int r, int m, int o = 0); |
| 126 | void or_mr(int m, int r, int o = 0); |
| 127 | void orb_rm(int r, int m, int o = 0); |
| 128 | void orb_mr(int m, int r, int o = 0); |
| 129 | void orbi_ri(int r, int i); |
| 130 | void orbi_mi(int m, int i, int o = 0); |
| 131 | void ori_ri(int r, int i); |
| 132 | void ori_mi(int m, int i, int o = 0); |
| 133 | void setb(int m, int b, int o = 0); |
| 69 | 134 | void sintr(); |
| 135 | void tsl(int m, int i, int d, int o = 0); |
| 136 | void wid(int s, int d); |
| 137 | void xfer(); |
| 138 | void invalid(int opc); |
| 70 | 139 | |
| 140 | // instruction fetch |
| 141 | UINT16 displacement(int wb); |
| 142 | UINT8 offset(int aa); |
| 143 | UINT8 imm8(); |
| 144 | UINT16 imm16(); |
| 145 | |
| 71 | 146 | void examine_ccw(UINT8 ccw); |
| 72 | 147 | |
| 73 | 148 | devcb2_write_line m_write_sintr; |
| 74 | 149 | |
| 75 | | enum |
| 76 | | { |
| 77 | | STATE_IDLE, |
| 78 | | STATE_EXECUTING, |
| 79 | | STATE_DMA |
| 80 | | }; |
| 81 | | |
| 82 | 150 | i8089_device *m_iop; |
| 83 | 151 | |
| 84 | | int m_state; |
| 85 | | |
| 86 | | bool m_interrupts_enabled; |
| 87 | | |
| 88 | 152 | // register |
| 89 | 153 | enum |
| 90 | 154 | { |
| r24859 | r24860 | |
| 115 | 179 | device_t(mconfig, I8089_CHANNEL, "Intel 8089 I/O Channel", tag, owner, clock, "i8089_channel", __FILE__), |
| 116 | 180 | device_execute_interface(mconfig, *this), |
| 117 | 181 | m_icount(0), |
| 118 | | m_write_sintr(*this), |
| 119 | | m_state(STATE_IDLE), |
| 120 | | m_interrupts_enabled(true) |
| 182 | m_write_sintr(*this) |
| 121 | 183 | { |
| 122 | 184 | } |
| 123 | 185 | |
| r24859 | r24860 | |
| 133 | 195 | m_write_sintr.resolve_safe(); |
| 134 | 196 | |
| 135 | 197 | // register for save states |
| 136 | | save_item(NAME(m_state)); |
| 137 | | save_item(NAME(m_interrupts_enabled)); |
| 138 | | |
| 139 | 198 | for (int i = 0; i < ARRAY_LENGTH(m_r); i++) |
| 140 | 199 | { |
| 141 | 200 | save_item(NAME(m_r[i].w), i); |
| r24859 | r24860 | |
| 143 | 202 | } |
| 144 | 203 | } |
| 145 | 204 | |
| 205 | void i8089_channel::device_reset() |
| 206 | { |
| 207 | // initialize registers |
| 208 | for (int i = 0; i < ARRAY_LENGTH(m_r); i++) |
| 209 | { |
| 210 | m_r[i].w = 0; |
| 211 | m_r[i].t = 0; |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | |
| 216 | //************************************************************************** |
| 217 | // IMPLEMENTATION |
| 218 | //************************************************************************** |
| 219 | |
| 220 | UINT16 i8089_channel::displacement(int wb) |
| 221 | { |
| 222 | UINT16 displacement = 0; |
| 223 | |
| 224 | if (wb == 1) |
| 225 | { |
| 226 | displacement = m_iop->read_byte(m_r[TP].w); |
| 227 | m_r[TP].w++; |
| 228 | } |
| 229 | else if (wb == 2) |
| 230 | { |
| 231 | displacement = m_iop->read_word(m_r[TP].w); |
| 232 | m_r[TP].w += 2; |
| 233 | } |
| 234 | |
| 235 | return displacement; |
| 236 | } |
| 237 | |
| 238 | UINT8 i8089_channel::offset(int aa) |
| 239 | { |
| 240 | UINT8 offset = 0; |
| 241 | |
| 242 | if (aa == 1) |
| 243 | { |
| 244 | offset = m_iop->read_byte(m_r[TP].w); |
| 245 | m_r[TP].w++; |
| 246 | } |
| 247 | |
| 248 | return offset; |
| 249 | } |
| 250 | |
| 251 | UINT8 i8089_channel::imm8() |
| 252 | { |
| 253 | UINT8 imm8 = m_iop->read_byte(m_r[TP].w); |
| 254 | m_r[TP].w++; |
| 255 | return imm8; |
| 256 | } |
| 257 | |
| 258 | UINT16 i8089_channel::imm16() |
| 259 | { |
| 260 | UINT8 imm16 = m_iop->read_word(m_r[TP].w); |
| 261 | m_r[TP].w += 2; |
| 262 | return imm16; |
| 263 | } |
| 264 | |
| 146 | 265 | void i8089_channel::execute_run() |
| 147 | 266 | { |
| 148 | 267 | do |
| 149 | 268 | { |
| 150 | | switch (m_state) |
| 269 | // active transfer? |
| 270 | if (BIT(m_r[PSW].w, 6)) |
| 151 | 271 | { |
| 152 | | case STATE_IDLE: |
| 153 | 272 | m_icount = 0; |
| 154 | | break; |
| 273 | } |
| 155 | 274 | |
| 156 | | case STATE_DMA: |
| 157 | | m_icount = 0; |
| 158 | | break; |
| 275 | // executing task block instructions? |
| 276 | else if (BIT(m_r[PSW].w, 2)) |
| 277 | { |
| 278 | // fetch first two instruction bytes |
| 279 | UINT16 op = m_iop->read_word(m_r[TP].w); |
| 280 | m_r[TP].w += 2; |
| 159 | 281 | |
| 160 | | case STATE_EXECUTING: |
| 282 | // extract parameters |
| 283 | UINT8 params = op & 0xff; |
| 284 | UINT8 opcode = (op >> 8) & 0xff; |
| 285 | |
| 286 | int brp = (params >> 5) & 0x07; |
| 287 | int wb = (params >> 3) & 0x03; |
| 288 | int aa = (params >> 1) & 0x03; |
| 289 | int w = (params >> 0) & 0x01; |
| 290 | int opc = (opcode >> 2) & 0x3f; |
| 291 | int mm = (opcode >> 0) & 0x03; |
| 292 | |
| 293 | // fix-up so we can use our register array |
| 294 | if (mm == BC) mm = PP; |
| 295 | |
| 296 | UINT8 o; |
| 297 | UINT16 off, seg; |
| 298 | |
| 299 | switch (opc) |
| 300 | { |
| 301 | case 0x00: // control |
| 302 | switch (brp) |
| 303 | { |
| 304 | case 0: nop(); break; |
| 305 | case 1: invalid(opc); break; |
| 306 | case 2: sintr(); break; |
| 307 | case 3: xfer(); break; |
| 308 | default: |
| 309 | if (BIT(brp, 2)) |
| 310 | wid(BIT(brp, 1), BIT(brp, 0)); |
| 311 | } |
| 312 | break; |
| 313 | |
| 314 | case 0x02: // lpdi |
| 315 | off = imm16(); |
| 316 | seg = imm16(); |
| 317 | lpdi(brp, seg, off); |
| 318 | break; |
| 319 | |
| 320 | case 0x08: // add(b)i r, i |
| 321 | if (w) addi_ri(brp, imm16()); |
| 322 | else addbi_ri(brp, imm8()); |
| 323 | break; |
| 324 | |
| 325 | case 0x0a: // and(b)i r, i |
| 326 | if (w) andi_ri(brp, imm16()); |
| 327 | else andbi_ri(brp, imm8()); |
| 328 | break; |
| 329 | |
| 330 | case 0x0c: // mov(b)i r, i |
| 331 | if (w) movi_ri(brp, imm16()); |
| 332 | else movbi_ri(brp, imm8()); |
| 333 | break; |
| 334 | |
| 335 | case 0x0f: // dec r |
| 336 | dec_r(brp); |
| 337 | break; |
| 338 | |
| 339 | case 0x12: // hlt |
| 340 | if (BIT(brp, 0)) |
| 341 | hlt(); |
| 342 | break; |
| 343 | |
| 344 | case 0x22: // lpd |
| 345 | o = offset(aa); |
| 346 | lpd(brp, mm, o); |
| 347 | break; |
| 348 | |
| 349 | case 0x28: // add(b) r, m |
| 350 | if (w) add_rm(brp, mm, offset(aa)); |
| 351 | else addb_rm(brp, mm, offset(aa)); |
| 352 | break; |
| 353 | |
| 354 | case 0x2a: // and(b) r, m |
| 355 | if (w) and_rm(brp, mm, offset(aa)); |
| 356 | else andb_rm(brp, mm, offset(aa)); |
| 357 | break; |
| 358 | |
| 359 | case 0x27: // call |
| 360 | o = offset(aa); |
| 361 | call(mm, displacement(wb), o); |
| 362 | break; |
| 363 | |
| 364 | case 0x30: // add(b)i m, i |
| 365 | o = offset(aa); |
| 366 | if (w) addi_mi(mm, imm16(), o); |
| 367 | else addbi_mi(mm, imm8(), o); |
| 368 | break; |
| 369 | |
| 370 | case 0x32: // and(b)i m, i |
| 371 | o = offset(aa); |
| 372 | if (w) andi_mi(mm, imm16()); |
| 373 | else andbi_mi(mm, imm8()); |
| 374 | break; |
| 375 | |
| 376 | case 0x34: // add(b) m, r |
| 377 | if (w) add_mr(mm, brp, offset(aa)); |
| 378 | else addb_mr(mm, brp, offset(aa)); |
| 379 | break; |
| 380 | |
| 381 | case 0x36: // and(b) m, r |
| 382 | if (w) and_mr(mm, brp, offset(aa)); |
| 383 | else andb_mr(mm, brp, offset(aa)); |
| 384 | break; |
| 385 | |
| 386 | case 0x3b: // dec(b) m |
| 387 | if (w) dec_m(mm, offset(aa)); |
| 388 | else decb(mm, offset(aa)); |
| 389 | break; |
| 390 | |
| 391 | case 0x3e: // clr |
| 392 | clr(mm, brp, offset(aa)); |
| 393 | break; |
| 394 | |
| 395 | default: |
| 396 | invalid(opc); |
| 397 | } |
| 398 | |
| 161 | 399 | m_icount--; |
| 162 | | break; |
| 163 | 400 | } |
| 401 | |
| 402 | // nothing to do |
| 403 | else |
| 404 | { |
| 405 | m_icount--; |
| 406 | } |
| 164 | 407 | } |
| 165 | 408 | while (m_icount > 0); |
| 166 | 409 | } |
| r24859 | r24860 | |
| 172 | 415 | |
| 173 | 416 | bool i8089_channel::bus_load_limit() |
| 174 | 417 | { |
| 175 | | return BIT(m_r[CP].w, 5); |
| 418 | return BIT(m_r[PSW].w, 5); |
| 176 | 419 | } |
| 177 | 420 | |
| 178 | 421 | bool i8089_channel::priority() |
| 179 | 422 | { |
| 180 | | return BIT(m_r[CP].w, 7); |
| 423 | return BIT(m_r[PSW].w, 7); |
| 181 | 424 | } |
| 182 | 425 | |
| 183 | 426 | void i8089_channel::examine_ccw(UINT8 ccw) |
| 184 | 427 | { |
| 185 | | // interrupt control field |
| 186 | | switch ((ccw >> 3) & 0x03) |
| 187 | | { |
| 188 | | // no effect |
| 189 | | case 0: |
| 190 | | break; |
| 428 | // priority and bus load limit, bit 7 and 5 |
| 429 | m_r[PSW].w = (m_r[PSW].w & 0x5f) | (ccw & 0xa0); |
| 191 | 430 | |
| 192 | 431 | // acknowledge interrupt |
| 193 | | case 1: |
| 194 | | if (VERBOSE) |
| 195 | | logerror("%s('%s'): acknowledge interrupt\n", shortname(), tag()); |
| 196 | | |
| 432 | if (BIT(ccw, 4)) |
| 433 | { |
| 197 | 434 | m_write_sintr(0); |
| 198 | | break; |
| 435 | m_r[PSW].w &= ~(1 << 5); |
| 436 | } |
| 199 | 437 | |
| 200 | | // enable interrupts |
| 201 | | case 2: |
| 202 | | if (VERBOSE) |
| 203 | | logerror("%s('%s'): interrupts enabled\n", shortname(), tag()); |
| 204 | | |
| 205 | | m_interrupts_enabled = true; |
| 206 | | break; |
| 207 | | |
| 208 | | // disable interrupts |
| 209 | | case 3: |
| 210 | | if (VERBOSE) |
| 211 | | logerror("%s('%s'): interrupts disabled\n", shortname(), tag()); |
| 212 | | |
| 213 | | m_write_sintr(0); |
| 214 | | m_interrupts_enabled = false; |
| 215 | | break; |
| 438 | // interrupt enable |
| 439 | if (BIT(ccw, 5)) |
| 440 | { |
| 441 | if (BIT(ccw, 4)) |
| 442 | m_r[PSW].w &= ~(1 << 4); |
| 443 | else |
| 444 | m_r[PSW].w |= 1 << 4; |
| 216 | 445 | } |
| 217 | 446 | } |
| 218 | 447 | |
| r24859 | r24860 | |
| 226 | 455 | // no channel command |
| 227 | 456 | case 0: |
| 228 | 457 | if (VERBOSE) |
| 229 | | logerror("%s('%s'): command received: no channel command\n", shortname(), tag()); |
| 458 | logerror("%s('%s'): command received: update psw\n", shortname(), tag()); |
| 230 | 459 | |
| 231 | 460 | examine_ccw(ccw); |
| 232 | 461 | break; |
| r24859 | r24860 | |
| 242 | 471 | movp_pm(TP, PP); |
| 243 | 472 | movbi_mi(CP, 0xff, 1); |
| 244 | 473 | |
| 245 | | m_state = STATE_EXECUTING; |
| 474 | m_r[PSW].w |= 1 << 2; |
| 246 | 475 | |
| 247 | 476 | break; |
| 248 | 477 | |
| r24859 | r24860 | |
| 264 | 493 | lpd(TP, PP); |
| 265 | 494 | movbi_mi(CP, 0xff, 1); |
| 266 | 495 | |
| 267 | | m_state = STATE_EXECUTING; |
| 496 | m_r[PSW].w |= 1 << 2; |
| 268 | 497 | |
| 269 | 498 | if (VERBOSE) |
| 270 | 499 | { |
| r24859 | r24860 | |
| 291 | 520 | movb_rm(PSW, PP, 3); |
| 292 | 521 | movbi_mi(CP, 0xff, 1); |
| 293 | 522 | |
| 523 | m_r[PSW].w |= 1 << 2; |
| 524 | |
| 525 | if (VERBOSE) |
| 526 | { |
| 527 | logerror("%s('%s'): ---- continuing channel ----\n", shortname(), tag()); |
| 528 | logerror("%s('%s'): task pointer: %06x\n", shortname(), tag(), m_r[TP].w); |
| 529 | } |
| 530 | |
| 294 | 531 | break; |
| 295 | 532 | |
| 296 | 533 | // halt channel, save tp |
| r24859 | r24860 | |
| 333 | 570 | // OPCODES |
| 334 | 571 | //************************************************************************** |
| 335 | 572 | |
| 573 | #define UNIMPLEMENTED logerror("%s('%s'): unimplemented opcode: %s\n", shortname(), tag(), __FUNCTION__); |
| 574 | |
| 575 | void i8089_channel::add_rm(int r, int m, int o) { UNIMPLEMENTED } |
| 576 | void i8089_channel::add_mr(int m, int r, int o) { UNIMPLEMENTED } |
| 577 | void i8089_channel::addb_rm(int r, int m, int o) { UNIMPLEMENTED } |
| 578 | void i8089_channel::addb_mr(int m, int r, int o) { UNIMPLEMENTED } |
| 579 | void i8089_channel::addbi_ri(int r, int i) { UNIMPLEMENTED } |
| 580 | void i8089_channel::addbi_mi(int m, int i, int o) { UNIMPLEMENTED } |
| 581 | void i8089_channel::addi_ri(int r, int i) { UNIMPLEMENTED } |
| 582 | void i8089_channel::addi_mi(int m, int i, int o) { UNIMPLEMENTED } |
| 583 | void i8089_channel::and_rm(int r, int m, int o) { UNIMPLEMENTED } |
| 584 | void i8089_channel::and_mr(int m, int r, int o) { UNIMPLEMENTED } |
| 585 | void i8089_channel::andb_rm(int r, int m, int o) { UNIMPLEMENTED } |
| 586 | void i8089_channel::andb_mr(int m, int r, int o) { UNIMPLEMENTED } |
| 587 | void i8089_channel::andbi_ri(int r, int i) { UNIMPLEMENTED } |
| 588 | void i8089_channel::andbi_mi(int m, int i, int o) { UNIMPLEMENTED } |
| 589 | void i8089_channel::andi_ri(int r, int i) { UNIMPLEMENTED } |
| 590 | void i8089_channel::andi_mi(int m, int i, int o) { UNIMPLEMENTED } |
| 591 | void i8089_channel::call(int m, int d, int o) { UNIMPLEMENTED } |
| 592 | void i8089_channel::clr(int m, int b, int o) { UNIMPLEMENTED } |
| 593 | void i8089_channel::dec_r(int r) { UNIMPLEMENTED } |
| 594 | void i8089_channel::dec_m(int m, int o) { UNIMPLEMENTED } |
| 595 | void i8089_channel::decb(int m, int o) { UNIMPLEMENTED } |
| 596 | |
| 336 | 597 | // halt |
| 337 | 598 | void i8089_channel::hlt() |
| 338 | 599 | { |
| 339 | 600 | movbi_mi(CP, 0x00, 1); |
| 340 | | m_state = STATE_IDLE; |
| 601 | m_r[PSW].w &= ~(1 << 2); |
| 341 | 602 | } |
| 342 | 603 | |
| 604 | void i8089_channel::inc_r(int r) { UNIMPLEMENTED } |
| 605 | void i8089_channel::inc_m(int m, int o) { UNIMPLEMENTED } |
| 606 | void i8089_channel::incb(int m, int o) { UNIMPLEMENTED } |
| 607 | void i8089_channel::jbt(int m, int b, int d, int o) { UNIMPLEMENTED } |
| 608 | void i8089_channel::jmce(int m, int d, int o) { UNIMPLEMENTED } |
| 609 | void i8089_channel::jmcne(int m, int d, int o) { UNIMPLEMENTED } |
| 610 | void i8089_channel::jmp(int d) { UNIMPLEMENTED } |
| 611 | void i8089_channel::jnbt(int m, int b, int d, int o) { UNIMPLEMENTED } |
| 612 | void i8089_channel::jnz_r(int r, int d) { UNIMPLEMENTED } |
| 613 | void i8089_channel::jnz_m(int m, int d, int o) { UNIMPLEMENTED } |
| 614 | void i8089_channel::jnzb(int m, int d, int o) { UNIMPLEMENTED } |
| 615 | void i8089_channel::jz_r(int r, int d) { UNIMPLEMENTED } |
| 616 | void i8089_channel::jz_m(int m, int d, int o) { UNIMPLEMENTED } |
| 617 | void i8089_channel::jzb(int m, int d, int o) { UNIMPLEMENTED } |
| 618 | void i8089_channel::lcall(int m, int d, int o) { UNIMPLEMENTED } |
| 619 | void i8089_channel::ljbt(int m, int b, int d, int o) { UNIMPLEMENTED } |
| 620 | void i8089_channel::ljmce(int m, int d, int o) { UNIMPLEMENTED } |
| 621 | void i8089_channel::ljmcne(int m, int d, int o) { UNIMPLEMENTED } |
| 622 | void i8089_channel::ljmp(int d) { UNIMPLEMENTED } |
| 623 | void i8089_channel::ljnbt(int m, int b, int d, int o) { UNIMPLEMENTED } |
| 624 | void i8089_channel::ljnz_r(int r, int d) { UNIMPLEMENTED } |
| 625 | void i8089_channel::ljnz_m(int m, int d, int o) { UNIMPLEMENTED } |
| 626 | void i8089_channel::ljnzb(int m, int d, int o) { UNIMPLEMENTED } |
| 627 | void i8089_channel::ljz_r(int r, int d) { UNIMPLEMENTED } |
| 628 | void i8089_channel::ljz_m(int m, int d, int o) { UNIMPLEMENTED } |
| 629 | void i8089_channel::ljzb(int m, int d, int o) { UNIMPLEMENTED } |
| 630 | |
| 343 | 631 | // load pointer from memory |
| 344 | 632 | void i8089_channel::lpd(int p, int m, int o) |
| 345 | 633 | { |
| 346 | 634 | UINT16 offset = m_iop->read_word(m_r[m].w + o); |
| 347 | 635 | UINT16 segment = m_iop->read_word(m_r[m].w + o + 2); |
| 348 | | m_r[p].w = (segment << 4) + (offset & 0xfffff); |
| 636 | |
| 637 | m_r[p].w = ((segment << 4) + offset) & 0xfffff; |
| 349 | 638 | m_r[p].t = 0; |
| 350 | 639 | } |
| 351 | 640 | |
| r24859 | r24860 | |
| 356 | 645 | m_r[p].t = 0; |
| 357 | 646 | } |
| 358 | 647 | |
| 648 | void i8089_channel::mov_mr(int m, int r, int o) { UNIMPLEMENTED } |
| 649 | void i8089_channel::mov_rm(int r, int m, int o) { UNIMPLEMENTED } |
| 650 | void i8089_channel::mov_mm(int m1, int m2, int o1, int o2) { UNIMPLEMENTED } |
| 651 | |
| 359 | 652 | // move register to memory byte |
| 360 | 653 | void i8089_channel::movb_mr(int m, int r, int o) |
| 361 | 654 | { |
| r24859 | r24860 | |
| 414 | 707 | void i8089_channel::movp_pm(int p, int m, int o) |
| 415 | 708 | { |
| 416 | 709 | UINT16 offset = m_iop->read_word(m_r[m].w + o); |
| 417 | | UINT16 segment = m_iop->read_word(m_r[m].w +o + 2); |
| 710 | UINT16 segment = m_iop->read_word(m_r[m].w + o + 2); |
| 418 | 711 | |
| 419 | | m_r[p].w = ((segment << 4) + offset) & 0x0fffff; |
| 712 | m_r[p].w = ((segment << 4) + offset) & 0xfffff; |
| 420 | 713 | m_r[p].t = segment >> 3 & 0x01; |
| 421 | 714 | } |
| 422 | 715 | |
| r24859 | r24860 | |
| 425 | 718 | { |
| 426 | 719 | } |
| 427 | 720 | |
| 721 | void i8089_channel::not_r(int r) { UNIMPLEMENTED } |
| 722 | void i8089_channel::not_m(int m, int o) { UNIMPLEMENTED } |
| 723 | void i8089_channel::not_rm(int r, int m, int o) { UNIMPLEMENTED } |
| 724 | void i8089_channel::notb_m(int m, int o) { UNIMPLEMENTED } |
| 725 | void i8089_channel::notb_rm(int r, int m, int o) { UNIMPLEMENTED } |
| 726 | void i8089_channel::or_rm(int r, int m, int o) { UNIMPLEMENTED } |
| 727 | void i8089_channel::or_mr(int m, int r, int o) { UNIMPLEMENTED } |
| 728 | void i8089_channel::orb_rm(int r, int m, int o) { UNIMPLEMENTED } |
| 729 | void i8089_channel::orb_mr(int m, int r, int o) { UNIMPLEMENTED } |
| 730 | void i8089_channel::orbi_ri(int r, int i) { UNIMPLEMENTED } |
| 731 | void i8089_channel::orbi_mi(int m, int i, int o) { UNIMPLEMENTED } |
| 732 | void i8089_channel::ori_ri(int r, int i) { UNIMPLEMENTED } |
| 733 | void i8089_channel::ori_mi(int m, int i, int o) { UNIMPLEMENTED } |
| 734 | void i8089_channel::setb(int m, int b, int o) { UNIMPLEMENTED } |
| 735 | |
| 428 | 736 | // set interrupt service flip-flop |
| 429 | 737 | void i8089_channel::sintr() |
| 430 | 738 | { |
| 431 | | if (m_interrupts_enabled) |
| 739 | if (BIT(m_r[PSW].w, 4)) |
| 740 | { |
| 741 | m_r[PSW].w |= 1 << 5; |
| 432 | 742 | m_write_sintr(1); |
| 743 | } |
| 433 | 744 | } |
| 434 | 745 | |
| 746 | void i8089_channel::tsl(int m, int i, int d, int o) { UNIMPLEMENTED } |
| 435 | 747 | |
| 748 | // set source and destination logical widths |
| 749 | void i8089_channel::wid(int s, int d) |
| 750 | { |
| 751 | m_r[PSW].w &= 0x3f; |
| 752 | m_r[PSW].w |= d << 0; |
| 753 | m_r[PSW].w |= s << 1; |
| 754 | } |
| 755 | |
| 756 | void i8089_channel::xfer() { UNIMPLEMENTED } |
| 757 | |
| 758 | void i8089_channel::invalid(int opc) |
| 759 | { |
| 760 | logerror("%s('%s'): invalid opcode: %02x\n", shortname(), tag(), opc); |
| 761 | } |
| 762 | |
| 763 | |
| 436 | 764 | //************************************************************************** |
| 437 | 765 | // DEVICE DEFINITIONS |
| 438 | 766 | //************************************************************************** |
| r24859 | r24860 | |
| 600 | 928 | |
| 601 | 929 | UINT16 data = 0xffff; |
| 602 | 930 | |
| 603 | | if (m_16bit_system) |
| 931 | if (m_16bit_system && !(address & 1)) |
| 604 | 932 | { |
| 605 | 933 | data = m_mem->read_word(address); |
| 606 | 934 | } |
| r24859 | r24860 | |
| 623 | 951 | { |
| 624 | 952 | assert(m_initialized); |
| 625 | 953 | |
| 626 | | if (m_16bit_system) |
| 954 | if (m_16bit_system && !(address & 1)) |
| 627 | 955 | { |
| 628 | 956 | m_mem->write_word(address, data); |
| 629 | 957 | } |