static void PREFIX186(_outsw)(void) /* Opcode 0x6f */ { ICOUNT -= cycles.outs16; write_port(I.regs.w[DX],GetMemB(DS,I.regs.w[SI])); write_port(I.regs.w[DX]+1,GetMemB(DS,I.regs.w[SI]+1)); I.regs.w[SI] += 2 * I.DirVal; /* GOL 11/27/01 */ }
static unsigned disassemble(unsigned seg, unsigned off, int count) { char buffer1[80]; char buffer2[80]; char buffer3[3]; unsigned newoff; for (; !debug_abort && count > 0; count--) { do { printf("%04X:%04X ", seg, off); buffer1[0] = '\0'; newoff = disasm(seg, off, buffer1); buffer2[0] = '\0'; for (; off < newoff; off++) { sprintf(buffer3,"%02X", GetMemB(&memory[seg << 4], off)); strcat(buffer2,buffer3); } printf("%-14s%s\n", buffer2,buffer1); } while (disasm_table[instruction_byte].flags & DF_PREFIX); } return off; }
static unsigned decode_f7(BYTE *seg, unsigned off, char *buf) { unsigned ModRM = GetMemB(seg, off); if ((ModRM & 0x38) == 0x00) return decode_wd16(seg, off, buf); return decode_w(seg, off, buf); }
static void PREFIX186(_outsb)(i8086_state *cpustate) /* Opcode 0x6e */ { #ifdef I80286 if (PM && (CPL>IOPL)) throw TRAP(GENERAL_PROTECTION_FAULT, 0); #endif ICOUNT -= timing.outs8; write_port_byte(cpustate->regs.w[DX],GetMemB(DS,cpustate->regs.w[SI])); cpustate->regs.w[SI] += cpustate->DirVal; /* GOL 11/27/01 */ }
static unsigned decode_ff(BYTE *seg, unsigned off, char *buf) { unsigned ModRM = (GetMemB(seg, off) & 0x38) >> 3; if (ModRM == 3 || ModRM == 5) return decode_far_ind(seg, off, buf); return decode_w(seg, off, buf); }
static unsigned hexdump(unsigned seg, unsigned off, unsigned count) { char bytes[3*16+1]; char ascii[16+1]; char *byteptr, *asciiptr; unsigned startpos,i; BYTE *segp; BYTE ch; segp = &memory[seg << 4]; while (!debug_abort && count > 0) { startpos = off & 0xf; byteptr = bytes; asciiptr = ascii; printf("%04X:%04X ", seg, off & 0xfff0); for (i = off & 0x0f; count>0 && i<0x10; i++, off=(WORD)(off+1),count--) { ch = GetMemB(segp, off); sprintf(byteptr, "%c%02X", i == 8 ? '-' : ' ', ch); sprintf(asciiptr, "%c", ch < 32 || ch > 126 ? '.' : ch); byteptr += 3; asciiptr++; if ((WORD)(off+1) < off) { debug_abort = TRUE; break; } } for (i = 0; i < startpos; i++) printf(" "); printf("%s", bytes); if (off & 0xf) for (i = 16-(off & 0xf); i > 0; i--) printf(" "); for (i = 0; i < startpos; i++) printf(" "); printf(" %s\n", ascii); } return off; }
static unsigned decode_bioscall(BYTE *seg, unsigned off, char *buf) { unsigned addr; if (GetMemB(seg, off) == 0xf1) { off = (WORD)(off + 1); addr = GetMemInc(seg, off); addr += GetMemInc(seg, off) << 8; addr += GetMemInc(seg, off) << 16; addr += GetMemInc(seg, off) << 24; sprintf(buf, "bios %08X",addr); } else sprintf(buf, "db F1"); return off; }
static void PREFIX186(_outsb)(void) /* Opcode 0x6e */ { ICOUNT -= cycles.outs8; write_port_byte(I.regs.w[DX],GetMemB(DS,I.regs.w[SI])); I.regs.w[SI] += I.DirVal; /* GOL 11/27/01 */ }
static void PREFIX186(_outsb)(i8086_state *cpustate) /* Opcode 0x6e */ { ICOUNT -= timing.outs8; write_port_byte(cpustate->regs.w[DX],GetMemB(DS,cpustate->regs.w[SI])); cpustate->regs.w[SI] += cpustate->DirVal; /* GOL 11/27/01 */ }
static void print_instruction(BYTE *seg, unsigned off, int *tab, char *buf) { unsigned ModRM = GetMemB(seg,off); sprintf(buf, "%-6s ", itext[tab[(ModRM & 0x38) >> 3]]); }