Lines Matching +full:native +full:- +full:mode

8  *  Copyright (C) 1996-1999 SciTech Software, Inc.
9 * Copyright (C) David Mosberger-Tang
179 if (emu->_x86emu_intrTab[intno]) { in x86emu_intr_dispatch()
180 (*emu->_x86emu_intrTab[intno]) (emu, intno); in x86emu_intr_dispatch()
182 push_word(emu, (uint16_t) emu->x86.R_FLG); in x86emu_intr_dispatch()
185 push_word(emu, emu->x86.R_CS); in x86emu_intr_dispatch()
186 emu->x86.R_CS = fetch_word(emu, 0, intno * 4 + 2); in x86emu_intr_dispatch()
187 push_word(emu, emu->x86.R_IP); in x86emu_intr_dispatch()
188 emu->x86.R_IP = fetch_word(emu, 0, intno * 4); in x86emu_intr_dispatch()
197 if (emu->x86.intr & INTR_SYNCH) { in x86emu_intr_handle()
198 intno = emu->x86.intno; in x86emu_intr_handle()
199 emu->x86.intr = 0; in x86emu_intr_handle()
206 * intrnum - Interrupt number to raise
215 emu->x86.intno = intrnum; in x86emu_intr_raise()
216 emu->x86.intr |= INTR_SYNCH; in x86emu_intr_raise()
223 * original real mode call.
228 emu->x86.intr = 0; in x86emu_exec()
230 if (setjmp(emu->exec_state)) in x86emu_exec()
234 if (emu->x86.intr) { in x86emu_exec()
235 if (((emu->x86.intr & INTR_SYNCH) && in x86emu_exec()
236 (emu->x86.intno == 0 || emu->x86.intno == 2)) || in x86emu_exec()
241 if (emu->x86.R_CS == 0 && emu->x86.R_IP == 0) in x86emu_exec()
244 ++emu->cur_cycles; in x86emu_exec()
253 emu->x86.R_CS = seg; in x86emu_exec_call()
254 emu->x86.R_IP = off; in x86emu_exec_call()
262 push_word(emu, emu->x86.R_FLG); in x86emu_exec_intr()
267 emu->x86.R_CS = (*emu->emu_rdw)(emu, intr * 4 + 2); in x86emu_exec_intr()
268 emu->x86.R_IP = (*emu->emu_rdw)(emu, intr * 4); in x86emu_exec_intr()
269 emu->x86.intr = 0; in x86emu_exec_intr()
281 longjmp(emu->exec_state, 1); in x86emu_halt_sys()
286 * mod - Mod value from decoded byte
287 * regh - Reg h value from decoded byte
288 * regl - Reg l value from decoded byte
294 * NOTE: Do not inline this function, as (*emu->emu_rdb) is already inline!
302 emu->cur_mod = (fetched >> 6) & 0x03; in fetch_decode_modrm()
303 emu->cur_rh = (fetched >> 3) & 0x07; in fetch_decode_modrm()
304 emu->cur_rl = (fetched >> 0) & 0x07; in fetch_decode_modrm()
315 * NOTE: Do not inline this function, as (*emu->emu_rdb) is already inline!
322 fetched = fetch_byte(emu, emu->x86.R_CS, emu->x86.R_IP); in fetch_byte_imm()
323 emu->x86.R_IP++; in fetch_byte_imm()
335 * NOTE: Do not inline this function, as (*emu->emu_rdw) is already inline!
342 fetched = fetch_word(emu, emu->x86.R_CS, emu->x86.R_IP); in fetch_word_imm()
343 emu->x86.R_IP += 2; in fetch_word_imm()
355 * NOTE: Do not inline this function, as (*emu->emu_rdw) is already inline!
362 fetched = fetch_long(emu, emu->x86.R_CS, emu->x86.R_IP); in fetch_long_imm()
363 emu->x86.R_IP += 4; in fetch_long_imm()
376 * no segment override. Address modes such as -3[BP] or 10[BP+SI] all refer to
380 * cpu-state-varible emu->x86.mode. There are several potential states:
394 * Each of the above 7 items are handled with a bit in the mode field.
399 switch (emu->x86.mode & SYSMODE_SEGMASK) { in get_data_segment()
403 return emu->x86.R_DS; in get_data_segment()
404 case SYSMODE_SEG_DS_SS:/* non-overridden, use ss register */ in get_data_segment()
405 return emu->x86.R_SS; in get_data_segment()
408 return emu->x86.R_CS; in get_data_segment()
411 return emu->x86.R_ES; in get_data_segment()
414 return emu->x86.R_FS; in get_data_segment()
417 return emu->x86.R_GS; in get_data_segment()
420 return emu->x86.R_SS; in get_data_segment()
427 * offset - Offset to load data from
432 * NOTE: Do not inline this function as (*emu->emu_rdX) is already inline!
442 * offset - Offset to load data from
447 * NOTE: Do not inline this function as (*emu->emu_rdX) is already inline!
457 * offset - Offset to load data from
462 * NOTE: Do not inline this function as (*emu->emu_rdX) is already inline!
472 * segment - Segment to load data from
473 * offset - Offset to load data from
478 * NOTE: Do not inline this function as (*emu->emu_rdX) is already inline!
483 return (*emu->emu_rdb) (emu, ((uint32_t) segment << 4) + offset); in fetch_byte()
488 * segment - Segment to load data from
489 * offset - Offset to load data from
494 * NOTE: Do not inline this function as (*emu->emu_rdX) is already inline!
499 return (*emu->emu_rdw) (emu, ((uint32_t) segment << 4) + offset); in fetch_word()
504 * segment - Segment to load data from
505 * offset - Offset to load data from
510 * NOTE: Do not inline this function as (*emu->emu_rdX) is already inline!
515 return (*emu->emu_rdl) (emu, ((uint32_t) segment << 4) + offset); in fetch_long()
520 * offset - Offset to store data at
521 * val - Value to store
527 * NOTE: Do not inline this function as (*emu->emu_wrX) is already inline!
537 * offset - Offset to store data at
538 * val - Value to store
544 * NOTE: Do not inline this function as (*emu->emu_wrX) is already inline!
554 * offset - Offset to store data at
555 * val - Value to store
561 * NOTE: Do not inline this function as (*emu->emu_wrX) is already inline!
571 * segment - Segment to store data at
572 * offset - Offset to store data at
573 * val - Value to store
578 * NOTE: Do not inline this function as (*emu->emu_wrX) is already inline!
583 (*emu->emu_wrb) (emu, ((uint32_t) segment << 4) + offset, val); in store_byte()
588 * segment - Segment to store data at
589 * offset - Offset to store data at
590 * val - Value to store
595 * NOTE: Do not inline this function as (*emu->emu_wrX) is already inline!
600 (*emu->emu_wrw) (emu, ((uint32_t) segment << 4) + offset, val); in store_word()
605 * segment - Segment to store data at
606 * offset - Offset to store data at
607 * val - Value to store
612 * NOTE: Do not inline this function as (*emu->emu_wrX) is already inline!
617 (*emu->emu_wrl) (emu, ((uint32_t) segment << 4) + offset, val); in store_long()
622 * reg - Register to decode
636 return &emu->x86.R_AL; in decode_rm_byte_register()
638 return &emu->x86.R_CL; in decode_rm_byte_register()
640 return &emu->x86.R_DL; in decode_rm_byte_register()
642 return &emu->x86.R_BL; in decode_rm_byte_register()
644 return &emu->x86.R_AH; in decode_rm_byte_register()
646 return &emu->x86.R_CH; in decode_rm_byte_register()
648 return &emu->x86.R_DH; in decode_rm_byte_register()
650 return &emu->x86.R_BH; in decode_rm_byte_register()
659 return decode_rm_byte_register(emu, emu->cur_rl); in decode_rl_byte_register()
665 return decode_rm_byte_register(emu, emu->cur_rh); in decode_rh_byte_register()
670 * reg - Register to decode
684 return &emu->x86.R_AX; in decode_rm_word_register()
686 return &emu->x86.R_CX; in decode_rm_word_register()
688 return &emu->x86.R_DX; in decode_rm_word_register()
690 return &emu->x86.R_BX; in decode_rm_word_register()
692 return &emu->x86.R_SP; in decode_rm_word_register()
694 return &emu->x86.R_BP; in decode_rm_word_register()
696 return &emu->x86.R_SI; in decode_rm_word_register()
698 return &emu->x86.R_DI; in decode_rm_word_register()
707 return decode_rm_word_register(emu, emu->cur_rl); in decode_rl_word_register()
713 return decode_rm_word_register(emu, emu->cur_rh); in decode_rh_word_register()
718 * reg - Register to decode
732 return &emu->x86.R_EAX; in decode_rm_long_register()
734 return &emu->x86.R_ECX; in decode_rm_long_register()
736 return &emu->x86.R_EDX; in decode_rm_long_register()
738 return &emu->x86.R_EBX; in decode_rm_long_register()
740 return &emu->x86.R_ESP; in decode_rm_long_register()
742 return &emu->x86.R_EBP; in decode_rm_long_register()
744 return &emu->x86.R_ESI; in decode_rm_long_register()
746 return &emu->x86.R_EDI; in decode_rm_long_register()
755 return decode_rm_long_register(emu, emu->cur_rl); in decode_rl_long_register()
761 return decode_rm_long_register(emu, emu->cur_rh); in decode_rh_long_register()
767 * reg - Register to decode
780 switch (emu->cur_rh) { in decode_rh_seg_register()
782 return &emu->x86.R_ES; in decode_rh_seg_register()
784 return &emu->x86.R_CS; in decode_rh_seg_register()
786 return &emu->x86.R_SS; in decode_rh_seg_register()
788 return &emu->x86.R_DS; in decode_rh_seg_register()
790 return &emu->x86.R_FS; in decode_rh_seg_register()
792 return &emu->x86.R_GS; in decode_rh_seg_register()
808 base = emu->x86.R_EAX; in decode_sib_address()
811 base = emu->x86.R_ECX; in decode_sib_address()
815 base = emu->x86.R_EDX; in decode_sib_address()
818 base = emu->x86.R_EBX; in decode_sib_address()
821 base = emu->x86.R_ESP; in decode_sib_address()
822 emu->x86.mode |= SYSMODE_SEG_DS_SS; in decode_sib_address()
828 base = emu->x86.R_EBP; in decode_sib_address()
829 emu->x86.mode |= SYSMODE_SEG_DS_SS; in decode_sib_address()
833 base = emu->x86.R_ESI; in decode_sib_address()
836 base = emu->x86.R_EDI; in decode_sib_address()
841 i = emu->x86.R_EAX; in decode_sib_address()
844 i = emu->x86.R_ECX; in decode_sib_address()
847 i = emu->x86.R_EDX; in decode_sib_address()
850 i = emu->x86.R_EBX; in decode_sib_address()
856 i = emu->x86.R_EBP; in decode_sib_address()
859 i = emu->x86.R_ESI; in decode_sib_address()
862 i = emu->x86.R_EDI; in decode_sib_address()
871 * rm - RM value to decode
883 if (emu->x86.mode & SYSMODE_PREFIX_ADDR) { in decode_rl_address()
885 /* 32-bit addressing */ in decode_rl_address()
886 switch (emu->cur_rl) { in decode_rl_address()
888 offset = emu->x86.R_EAX; in decode_rl_address()
891 offset = emu->x86.R_ECX; in decode_rl_address()
894 offset = emu->x86.R_EDX; in decode_rl_address()
897 offset = emu->x86.R_EBX; in decode_rl_address()
904 if (emu->cur_mod == 0) { in decode_rl_address()
907 emu->x86.mode |= SYSMODE_SEG_DS_SS; in decode_rl_address()
908 offset = emu->x86.R_EBP; in decode_rl_address()
912 offset = emu->x86.R_ESI; in decode_rl_address()
915 offset = emu->x86.R_EDI; in decode_rl_address()
920 if (emu->cur_mod == 1) in decode_rl_address()
922 else if (emu->cur_mod == 2) in decode_rl_address()
928 /* 16-bit addressing */ in decode_rl_address()
929 switch (emu->cur_rl) { in decode_rl_address()
931 offset = emu->x86.R_BX + emu->x86.R_SI; in decode_rl_address()
934 offset = emu->x86.R_BX + emu->x86.R_DI; in decode_rl_address()
937 emu->x86.mode |= SYSMODE_SEG_DS_SS; in decode_rl_address()
938 offset = emu->x86.R_BP + emu->x86.R_SI; in decode_rl_address()
941 emu->x86.mode |= SYSMODE_SEG_DS_SS; in decode_rl_address()
942 offset = emu->x86.R_BP + emu->x86.R_DI; in decode_rl_address()
945 offset = emu->x86.R_SI; in decode_rl_address()
948 offset = emu->x86.R_DI; in decode_rl_address()
951 if (emu->cur_mod == 0) { in decode_rl_address()
954 emu->x86.mode |= SYSMODE_SEG_DS_SS; in decode_rl_address()
955 offset = emu->x86.R_BP; in decode_rl_address()
959 offset = emu->x86.R_BX; in decode_rl_address()
964 if (emu->cur_mod == 1) in decode_rl_address()
966 else if (emu->cur_mod == 2) in decode_rl_address()
975 if (emu->cur_mod != 3) { in decode_and_fetch_byte()
976 emu->cur_offset = decode_rl_address(emu); in decode_and_fetch_byte()
977 return fetch_data_byte(emu, emu->cur_offset); in decode_and_fetch_byte()
986 if (emu->cur_mod != 3) { in decode_and_fetch_word_disp()
988 emu->cur_offset = decode_rl_address(emu) + disp; in decode_and_fetch_word_disp()
989 if ((emu->x86.mode & SYSMODE_PREFIX_ADDR) == 0) in decode_and_fetch_word_disp()
990 emu->cur_offset &= 0xffff; in decode_and_fetch_word_disp()
991 return fetch_data_word(emu, emu->cur_offset); in decode_and_fetch_word_disp()
1000 if (emu->cur_mod != 3) { in decode_and_fetch_long_disp()
1002 emu->cur_offset = decode_rl_address(emu) + disp; in decode_and_fetch_long_disp()
1003 if ((emu->x86.mode & SYSMODE_PREFIX_ADDR) == 0) in decode_and_fetch_long_disp()
1004 emu->cur_offset &= 0xffff; in decode_and_fetch_long_disp()
1005 return fetch_data_long(emu, emu->cur_offset); in decode_and_fetch_long_disp()
1026 if (emu->cur_mod != 3) { in decode_and_fetch_byte_imm8()
1027 emu->cur_offset = decode_rl_address(emu); in decode_and_fetch_byte_imm8()
1029 return fetch_data_byte(emu, emu->cur_offset); in decode_and_fetch_byte_imm8()
1039 if (emu->cur_mod != 3) { in decode_and_fetch_word_imm8()
1040 emu->cur_offset = decode_rl_address(emu); in decode_and_fetch_word_imm8()
1042 return fetch_data_word(emu, emu->cur_offset); in decode_and_fetch_word_imm8()
1052 if (emu->cur_mod != 3) { in decode_and_fetch_long_imm8()
1053 emu->cur_offset = decode_rl_address(emu); in decode_and_fetch_long_imm8()
1055 return fetch_data_long(emu, emu->cur_offset); in decode_and_fetch_long_imm8()
1065 if (emu->cur_mod != 3) in write_back_byte()
1066 store_data_byte(emu, emu->cur_offset, val); in write_back_byte()
1074 if (emu->cur_mod != 3) in write_back_word()
1075 store_data_word(emu, emu->cur_offset, val); in write_back_word()
1083 if (emu->cur_mod != 3) in write_back_long()
1084 store_data_long(emu, emu->cur_offset, val); in write_back_long()
1092 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in common_inc_word_long()
1093 reg->I32_reg.e_reg = inc_long(emu, reg->I32_reg.e_reg); in common_inc_word_long()
1095 reg->I16_reg.x_reg = inc_word(emu, reg->I16_reg.x_reg); in common_inc_word_long()
1101 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in common_dec_word_long()
1102 reg->I32_reg.e_reg = dec_long(emu, reg->I32_reg.e_reg); in common_dec_word_long()
1104 reg->I16_reg.x_reg = dec_word(emu, reg->I16_reg.x_reg); in common_dec_word_long()
1117 if (emu->cur_mod != 3) { in common_binop_byte_rm_r()
1137 if (emu->cur_mod != 3) { in common_binop_ns_byte_rm_r()
1155 if (emu->cur_mod != 3) { in common_binop_word_rm_r()
1175 if (emu->cur_mod != 3) { in common_binop_byte_r_rm()
1193 if (emu->cur_mod != 3) { in common_binop_long_rm_r()
1209 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in common_binop_word_long_rm_r()
1224 if (emu->cur_mod != 3) { in common_binop_ns_word_rm_r()
1243 if (emu->cur_mod != 3) { in common_binop_ns_long_rm_r()
1257 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in common_binop_ns_word_long_rm_r()
1272 if (emu->cur_mod != 3) { in common_binop_long_r_rm()
1290 if (emu->cur_mod != 3) { in common_binop_word_r_rm()
1304 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in common_binop_word_long_r_rm()
1317 emu->x86.R_AL = (*binop)(emu, emu->x86.R_AL, srcval); in common_binop_byte_imm()
1325 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in common_binop_word_long_imm()
1329 emu->x86.R_EAX = (*binop32)(emu, emu->x86.R_EAX, srcval); in common_binop_word_long_imm()
1334 emu->x86.R_AX = (*binop16)(emu, emu->x86.R_AX, srcval); in common_binop_word_long_imm()
1341 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in common_push_word_long()
1342 push_long(emu, reg->I32_reg.e_reg); in common_push_word_long()
1344 push_word(emu, reg->I16_reg.x_reg); in common_push_word_long()
1350 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in common_pop_word_long()
1351 reg->I32_reg.e_reg = pop_long(emu); in common_pop_word_long()
1353 reg->I16_reg.x_reg = pop_word(emu); in common_pop_word_long()
1366 if (emu->cur_mod != 3) { in common_imul_long_IMM()
1399 if (emu->cur_mod != 3) { in common_imul_word_IMM()
1425 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in common_imul_imm()
1438 target = (uint16_t) (emu->x86.R_IP + (int16_t) offset); in common_jmp_near()
1440 emu->x86.R_IP = target; in common_jmp_near()
1450 if (emu->cur_mod == 3) in common_load_far_pointer()
1506 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_cmp_word_R_RM()
1522 cmp_byte(emu, emu->x86.R_AL, srcval); in x86emuOp_cmp_byte_AL_IMM()
1535 cmp_long(emu, emu->x86.R_EAX, srcval); in x86emuOp32_cmp_word_AX_IMM()
1544 cmp_word(emu, emu->x86.R_AX, srcval); in x86emuOp16_cmp_word_AX_IMM()
1550 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_cmp_word_AX_IMM()
1563 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_push_all()
1564 uint32_t old_sp = emu->x86.R_ESP; in x86emuOp_push_all()
1566 push_long(emu, emu->x86.R_EAX); in x86emuOp_push_all()
1567 push_long(emu, emu->x86.R_ECX); in x86emuOp_push_all()
1568 push_long(emu, emu->x86.R_EDX); in x86emuOp_push_all()
1569 push_long(emu, emu->x86.R_EBX); in x86emuOp_push_all()
1571 push_long(emu, emu->x86.R_EBP); in x86emuOp_push_all()
1572 push_long(emu, emu->x86.R_ESI); in x86emuOp_push_all()
1573 push_long(emu, emu->x86.R_EDI); in x86emuOp_push_all()
1575 uint16_t old_sp = emu->x86.R_SP; in x86emuOp_push_all()
1577 push_word(emu, emu->x86.R_AX); in x86emuOp_push_all()
1578 push_word(emu, emu->x86.R_CX); in x86emuOp_push_all()
1579 push_word(emu, emu->x86.R_DX); in x86emuOp_push_all()
1580 push_word(emu, emu->x86.R_BX); in x86emuOp_push_all()
1582 push_word(emu, emu->x86.R_BP); in x86emuOp_push_all()
1583 push_word(emu, emu->x86.R_SI); in x86emuOp_push_all()
1584 push_word(emu, emu->x86.R_DI); in x86emuOp_push_all()
1595 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_pop_all()
1596 emu->x86.R_EDI = pop_long(emu); in x86emuOp_pop_all()
1597 emu->x86.R_ESI = pop_long(emu); in x86emuOp_pop_all()
1598 emu->x86.R_EBP = pop_long(emu); in x86emuOp_pop_all()
1599 emu->x86.R_ESP += 4; /* skip ESP */ in x86emuOp_pop_all()
1600 emu->x86.R_EBX = pop_long(emu); in x86emuOp_pop_all()
1601 emu->x86.R_EDX = pop_long(emu); in x86emuOp_pop_all()
1602 emu->x86.R_ECX = pop_long(emu); in x86emuOp_pop_all()
1603 emu->x86.R_EAX = pop_long(emu); in x86emuOp_pop_all()
1605 emu->x86.R_DI = pop_word(emu); in x86emuOp_pop_all()
1606 emu->x86.R_SI = pop_word(emu); in x86emuOp_pop_all()
1607 emu->x86.R_BP = pop_word(emu); in x86emuOp_pop_all()
1608 emu->x86.R_SP += 2;/* skip SP */ in x86emuOp_pop_all()
1609 emu->x86.R_BX = pop_word(emu); in x86emuOp_pop_all()
1610 emu->x86.R_DX = pop_word(emu); in x86emuOp_pop_all()
1611 emu->x86.R_CX = pop_word(emu); in x86emuOp_pop_all()
1612 emu->x86.R_AX = pop_word(emu); in x86emuOp_pop_all()
1626 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_push_word_IMM()
1649 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_push_byte_IMM()
1663 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_ins_word()
1677 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_outs_word()
1774 destval = (*opc80_byte_operation[emu->cur_rh]) (emu, destval, imm); in x86emuOp_opc80_byte_RM_IMM()
1775 if (emu->cur_rh != 7) in x86emuOp_opc80_byte_RM_IMM()
1824 destval = (*opc81_long_operation[emu->cur_rh]) (emu, destval, imm); in x86emuOp32_opc81_word_RM_IMM()
1825 if (emu->cur_rh != 7) in x86emuOp32_opc81_word_RM_IMM()
1842 destval = (*opc81_word_operation[emu->cur_rh]) (emu, destval, imm); in x86emuOp16_opc81_word_RM_IMM()
1843 if (emu->cur_rh != 7) in x86emuOp16_opc81_word_RM_IMM()
1850 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_opc81_word_RM_IMM()
1888 destval = (*opc82_byte_operation[emu->cur_rh]) (emu, destval, imm); in x86emuOp_opc82_byte_RM_IMM()
1889 if (emu->cur_rh != 7) in x86emuOp_opc82_byte_RM_IMM()
1933 destval = (*opc83_long_operation[emu->cur_rh]) (emu, destval, imm); in x86emuOp32_opc83_word_RM_IMM()
1934 if (emu->cur_rh != 7) in x86emuOp32_opc83_word_RM_IMM()
1946 destval = (*opc83_word_operation[emu->cur_rh]) (emu, destval, imm); in x86emuOp16_opc83_word_RM_IMM()
1947 if (emu->cur_rh != 7) in x86emuOp16_opc83_word_RM_IMM()
1954 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_opc83_word_RM_IMM()
2013 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_xchg_word_RM_R()
2031 if (emu->cur_mod != 3) { in x86emuOp_mov_byte_RM_R()
2052 if (emu->cur_mod != 3) { in x86emuOp32_mov_word_RM_R()
2069 if (emu->cur_mod != 3) { in x86emuOp16_mov_word_RM_R()
2081 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_mov_word_RM_R()
2108 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_mov_word_R_RM()
2135 if (emu->cur_mod != 3) { in x86emuOp_mov_word_RM_SR()
2154 if (emu->cur_mod == 3) in x86emuOp_lea_word_R_M()
2158 if (emu->x86.mode & SYSMODE_PREFIX_ADDR) { in x86emuOp_lea_word_R_M()
2202 if (emu->cur_mod != 3) { in x86emuOp32_pop_RM()
2219 if (emu->cur_mod != 3) { in x86emuOp16_pop_RM()
2232 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_pop_RM()
2247 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_xchg_word_AX_CX()
2248 tmp = emu->x86.R_EAX; in x86emuOp_xchg_word_AX_CX()
2249 emu->x86.R_EAX = emu->x86.R_ECX; in x86emuOp_xchg_word_AX_CX()
2250 emu->x86.R_ECX = tmp; in x86emuOp_xchg_word_AX_CX()
2252 tmp = emu->x86.R_AX; in x86emuOp_xchg_word_AX_CX()
2253 emu->x86.R_AX = emu->x86.R_CX; in x86emuOp_xchg_word_AX_CX()
2254 emu->x86.R_CX = (uint16_t) tmp; in x86emuOp_xchg_word_AX_CX()
2267 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_xchg_word_AX_DX()
2268 tmp = emu->x86.R_EAX; in x86emuOp_xchg_word_AX_DX()
2269 emu->x86.R_EAX = emu->x86.R_EDX; in x86emuOp_xchg_word_AX_DX()
2270 emu->x86.R_EDX = tmp; in x86emuOp_xchg_word_AX_DX()
2272 tmp = emu->x86.R_AX; in x86emuOp_xchg_word_AX_DX()
2273 emu->x86.R_AX = emu->x86.R_DX; in x86emuOp_xchg_word_AX_DX()
2274 emu->x86.R_DX = (uint16_t) tmp; in x86emuOp_xchg_word_AX_DX()
2287 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_xchg_word_AX_BX()
2288 tmp = emu->x86.R_EAX; in x86emuOp_xchg_word_AX_BX()
2289 emu->x86.R_EAX = emu->x86.R_EBX; in x86emuOp_xchg_word_AX_BX()
2290 emu->x86.R_EBX = tmp; in x86emuOp_xchg_word_AX_BX()
2292 tmp = emu->x86.R_AX; in x86emuOp_xchg_word_AX_BX()
2293 emu->x86.R_AX = emu->x86.R_BX; in x86emuOp_xchg_word_AX_BX()
2294 emu->x86.R_BX = (uint16_t) tmp; in x86emuOp_xchg_word_AX_BX()
2307 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_xchg_word_AX_SP()
2308 tmp = emu->x86.R_EAX; in x86emuOp_xchg_word_AX_SP()
2309 emu->x86.R_EAX = emu->x86.R_ESP; in x86emuOp_xchg_word_AX_SP()
2310 emu->x86.R_ESP = tmp; in x86emuOp_xchg_word_AX_SP()
2312 tmp = emu->x86.R_AX; in x86emuOp_xchg_word_AX_SP()
2313 emu->x86.R_AX = emu->x86.R_SP; in x86emuOp_xchg_word_AX_SP()
2314 emu->x86.R_SP = (uint16_t) tmp; in x86emuOp_xchg_word_AX_SP()
2327 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_xchg_word_AX_BP()
2328 tmp = emu->x86.R_EAX; in x86emuOp_xchg_word_AX_BP()
2329 emu->x86.R_EAX = emu->x86.R_EBP; in x86emuOp_xchg_word_AX_BP()
2330 emu->x86.R_EBP = tmp; in x86emuOp_xchg_word_AX_BP()
2332 tmp = emu->x86.R_AX; in x86emuOp_xchg_word_AX_BP()
2333 emu->x86.R_AX = emu->x86.R_BP; in x86emuOp_xchg_word_AX_BP()
2334 emu->x86.R_BP = (uint16_t) tmp; in x86emuOp_xchg_word_AX_BP()
2347 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_xchg_word_AX_SI()
2348 tmp = emu->x86.R_EAX; in x86emuOp_xchg_word_AX_SI()
2349 emu->x86.R_EAX = emu->x86.R_ESI; in x86emuOp_xchg_word_AX_SI()
2350 emu->x86.R_ESI = tmp; in x86emuOp_xchg_word_AX_SI()
2352 tmp = emu->x86.R_AX; in x86emuOp_xchg_word_AX_SI()
2353 emu->x86.R_AX = emu->x86.R_SI; in x86emuOp_xchg_word_AX_SI()
2354 emu->x86.R_SI = (uint16_t) tmp; in x86emuOp_xchg_word_AX_SI()
2367 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_xchg_word_AX_DI()
2368 tmp = emu->x86.R_EAX; in x86emuOp_xchg_word_AX_DI()
2369 emu->x86.R_EAX = emu->x86.R_EDI; in x86emuOp_xchg_word_AX_DI()
2370 emu->x86.R_EDI = tmp; in x86emuOp_xchg_word_AX_DI()
2372 tmp = emu->x86.R_AX; in x86emuOp_xchg_word_AX_DI()
2373 emu->x86.R_AX = emu->x86.R_DI; in x86emuOp_xchg_word_AX_DI()
2374 emu->x86.R_DI = (uint16_t) tmp; in x86emuOp_xchg_word_AX_DI()
2385 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_cbw()
2386 if (emu->x86.R_AX & 0x8000) { in x86emuOp_cbw()
2387 emu->x86.R_EAX |= 0xffff0000; in x86emuOp_cbw()
2389 emu->x86.R_EAX &= 0x0000ffff; in x86emuOp_cbw()
2392 if (emu->x86.R_AL & 0x80) { in x86emuOp_cbw()
2393 emu->x86.R_AH = 0xff; in x86emuOp_cbw()
2395 emu->x86.R_AH = 0x0; in x86emuOp_cbw()
2407 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_cwd()
2408 if (emu->x86.R_EAX & 0x80000000) { in x86emuOp_cwd()
2409 emu->x86.R_EDX = 0xffffffff; in x86emuOp_cwd()
2411 emu->x86.R_EDX = 0x0; in x86emuOp_cwd()
2414 if (emu->x86.R_AX & 0x8000) { in x86emuOp_cwd()
2415 emu->x86.R_DX = 0xffff; in x86emuOp_cwd()
2417 emu->x86.R_DX = 0x0; in x86emuOp_cwd()
2438 push_word(emu, emu->x86.R_CS); in x86emuOp_call_far_IMM()
2439 emu->x86.R_CS = farseg; in x86emuOp_call_far_IMM()
2440 push_word(emu, emu->x86.R_IP); in x86emuOp_call_far_IMM()
2441 emu->x86.R_IP = faroff; in x86emuOp_call_far_IMM()
2454 flags = (emu->x86.R_EFLG & F_MSK) | F_ALWAYS_ON; in x86emuOp_pushf_word()
2455 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_pushf_word()
2469 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_popf_word()
2470 emu->x86.R_EFLG = pop_long(emu); in x86emuOp_popf_word()
2472 emu->x86.R_FLG = pop_word(emu); in x86emuOp_popf_word()
2484 emu->x86.R_FLG &= 0xffffff00; in x86emuOp_sahf()
2486 emu->x86.R_FLG |= emu->x86.R_AH; in x86emuOp_sahf()
2496 emu->x86.R_AH = (uint8_t) (emu->x86.R_FLG & 0xff); in x86emuOp_lahf()
2499 emu->x86.R_AH |= 0x2; in x86emuOp_lahf()
2512 emu->x86.R_AL = fetch_data_byte(emu, offset); in x86emuOp_mov_AL_M_IMM()
2525 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_mov_AX_M_IMM()
2526 emu->x86.R_EAX = fetch_data_long(emu, offset); in x86emuOp_mov_AX_M_IMM()
2528 emu->x86.R_AX = fetch_data_word(emu, offset); in x86emuOp_mov_AX_M_IMM()
2542 store_data_byte(emu, offset, emu->x86.R_AL); in x86emuOp_mov_M_AL_IMM()
2555 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_mov_M_AX_IMM()
2556 store_data_long(emu, offset, emu->x86.R_EAX); in x86emuOp_mov_M_AX_IMM()
2558 store_data_word(emu, offset, emu->x86.R_AX); in x86emuOp_mov_M_AX_IMM()
2574 inc = -1; in x86emuOp_movs_byte()
2578 if (emu->x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { in x86emuOp_movs_byte()
2581 count = emu->x86.R_CX; in x86emuOp_movs_byte()
2582 emu->x86.R_CX = 0; in x86emuOp_movs_byte()
2583 emu->x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); in x86emuOp_movs_byte()
2585 while (count--) { in x86emuOp_movs_byte()
2586 val = fetch_data_byte(emu, emu->x86.R_SI); in x86emuOp_movs_byte()
2587 store_byte(emu, emu->x86.R_ES, emu->x86.R_DI, val); in x86emuOp_movs_byte()
2588 emu->x86.R_SI += inc; in x86emuOp_movs_byte()
2589 emu->x86.R_DI += inc; in x86emuOp_movs_byte()
2604 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_movs_word()
2610 inc = -inc; in x86emuOp_movs_word()
2613 if (emu->x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { in x86emuOp_movs_word()
2616 count = emu->x86.R_CX; in x86emuOp_movs_word()
2617 emu->x86.R_CX = 0; in x86emuOp_movs_word()
2618 emu->x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); in x86emuOp_movs_word()
2620 while (count--) { in x86emuOp_movs_word()
2621 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_movs_word()
2622 val = fetch_data_long(emu, emu->x86.R_SI); in x86emuOp_movs_word()
2623 store_long(emu, emu->x86.R_ES, emu->x86.R_DI, val); in x86emuOp_movs_word()
2625 val = fetch_data_word(emu, emu->x86.R_SI); in x86emuOp_movs_word()
2626 store_word(emu, emu->x86.R_ES, emu->x86.R_DI, in x86emuOp_movs_word()
2629 emu->x86.R_SI += inc; in x86emuOp_movs_word()
2630 emu->x86.R_DI += inc; in x86emuOp_movs_word()
2645 inc = -1; in x86emuOp_cmps_byte()
2649 if (emu->x86.mode & SYSMODE_PREFIX_REPE) { in x86emuOp_cmps_byte()
2652 while (emu->x86.R_CX != 0) { in x86emuOp_cmps_byte()
2653 val1 = fetch_data_byte(emu, emu->x86.R_SI); in x86emuOp_cmps_byte()
2654 val2 = fetch_byte(emu, emu->x86.R_ES, emu->x86.R_DI); in x86emuOp_cmps_byte()
2656 emu->x86.R_CX -= 1; in x86emuOp_cmps_byte()
2657 emu->x86.R_SI += inc; in x86emuOp_cmps_byte()
2658 emu->x86.R_DI += inc; in x86emuOp_cmps_byte()
2662 emu->x86.mode &= ~SYSMODE_PREFIX_REPE; in x86emuOp_cmps_byte()
2663 } else if (emu->x86.mode & SYSMODE_PREFIX_REPNE) { in x86emuOp_cmps_byte()
2666 while (emu->x86.R_CX != 0) { in x86emuOp_cmps_byte()
2667 val1 = fetch_data_byte(emu, emu->x86.R_SI); in x86emuOp_cmps_byte()
2668 val2 = fetch_byte(emu, emu->x86.R_ES, emu->x86.R_DI); in x86emuOp_cmps_byte()
2670 emu->x86.R_CX -= 1; in x86emuOp_cmps_byte()
2671 emu->x86.R_SI += inc; in x86emuOp_cmps_byte()
2672 emu->x86.R_DI += inc; in x86emuOp_cmps_byte()
2676 emu->x86.mode &= ~SYSMODE_PREFIX_REPNE; in x86emuOp_cmps_byte()
2678 val1 = fetch_data_byte(emu, emu->x86.R_SI); in x86emuOp_cmps_byte()
2679 val2 = fetch_byte(emu, emu->x86.R_ES, emu->x86.R_DI); in x86emuOp_cmps_byte()
2681 emu->x86.R_SI += inc; in x86emuOp_cmps_byte()
2682 emu->x86.R_DI += inc; in x86emuOp_cmps_byte()
2696 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_cmps_word()
2698 inc = -4; in x86emuOp_cmps_word()
2703 inc = -2; in x86emuOp_cmps_word()
2707 if (emu->x86.mode & SYSMODE_PREFIX_REPE) { in x86emuOp_cmps_word()
2710 while (emu->x86.R_CX != 0) { in x86emuOp_cmps_word()
2711 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_cmps_word()
2712 val1 = fetch_data_long(emu, emu->x86.R_SI); in x86emuOp_cmps_word()
2713 val2 = fetch_long(emu, emu->x86.R_ES, in x86emuOp_cmps_word()
2714 emu->x86.R_DI); in x86emuOp_cmps_word()
2717 val1 = fetch_data_word(emu, emu->x86.R_SI); in x86emuOp_cmps_word()
2718 val2 = fetch_word(emu, emu->x86.R_ES, in x86emuOp_cmps_word()
2719 emu->x86.R_DI); in x86emuOp_cmps_word()
2722 emu->x86.R_CX -= 1; in x86emuOp_cmps_word()
2723 emu->x86.R_SI += inc; in x86emuOp_cmps_word()
2724 emu->x86.R_DI += inc; in x86emuOp_cmps_word()
2728 emu->x86.mode &= ~SYSMODE_PREFIX_REPE; in x86emuOp_cmps_word()
2729 } else if (emu->x86.mode & SYSMODE_PREFIX_REPNE) { in x86emuOp_cmps_word()
2732 while (emu->x86.R_CX != 0) { in x86emuOp_cmps_word()
2733 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_cmps_word()
2734 val1 = fetch_data_long(emu, emu->x86.R_SI); in x86emuOp_cmps_word()
2735 val2 = fetch_long(emu, emu->x86.R_ES, in x86emuOp_cmps_word()
2736 emu->x86.R_DI); in x86emuOp_cmps_word()
2739 val1 = fetch_data_word(emu, emu->x86.R_SI); in x86emuOp_cmps_word()
2740 val2 = fetch_word(emu, emu->x86.R_ES, in x86emuOp_cmps_word()
2741 emu->x86.R_DI); in x86emuOp_cmps_word()
2744 emu->x86.R_CX -= 1; in x86emuOp_cmps_word()
2745 emu->x86.R_SI += inc; in x86emuOp_cmps_word()
2746 emu->x86.R_DI += inc; in x86emuOp_cmps_word()
2750 emu->x86.mode &= ~SYSMODE_PREFIX_REPNE; in x86emuOp_cmps_word()
2752 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_cmps_word()
2753 val1 = fetch_data_long(emu, emu->x86.R_SI); in x86emuOp_cmps_word()
2754 val2 = fetch_long(emu, emu->x86.R_ES, emu->x86.R_DI); in x86emuOp_cmps_word()
2757 val1 = fetch_data_word(emu, emu->x86.R_SI); in x86emuOp_cmps_word()
2758 val2 = fetch_word(emu, emu->x86.R_ES, emu->x86.R_DI); in x86emuOp_cmps_word()
2761 emu->x86.R_SI += inc; in x86emuOp_cmps_word()
2762 emu->x86.R_DI += inc; in x86emuOp_cmps_word()
2773 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_test_AX_IMM()
2774 test_long(emu, emu->x86.R_EAX, fetch_long_imm(emu)); in x86emuOp_test_AX_IMM()
2776 test_word(emu, emu->x86.R_AX, fetch_word_imm(emu)); in x86emuOp_test_AX_IMM()
2790 inc = -1; in x86emuOp_stos_byte()
2793 if (emu->x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { in x86emuOp_stos_byte()
2796 while (emu->x86.R_CX != 0) { in x86emuOp_stos_byte()
2797 store_byte(emu, emu->x86.R_ES, emu->x86.R_DI, in x86emuOp_stos_byte()
2798 emu->x86.R_AL); in x86emuOp_stos_byte()
2799 emu->x86.R_CX -= 1; in x86emuOp_stos_byte()
2800 emu->x86.R_DI += inc; in x86emuOp_stos_byte()
2802 emu->x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); in x86emuOp_stos_byte()
2804 store_byte(emu, emu->x86.R_ES, emu->x86.R_DI, emu->x86.R_AL); in x86emuOp_stos_byte()
2805 emu->x86.R_DI += inc; in x86emuOp_stos_byte()
2819 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_stos_word()
2825 inc = -inc; in x86emuOp_stos_word()
2828 if (emu->x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { in x86emuOp_stos_word()
2831 count = emu->x86.R_CX; in x86emuOp_stos_word()
2832 emu->x86.R_CX = 0; in x86emuOp_stos_word()
2833 emu->x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); in x86emuOp_stos_word()
2835 while (count--) { in x86emuOp_stos_word()
2836 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_stos_word()
2837 store_long(emu, emu->x86.R_ES, emu->x86.R_DI, in x86emuOp_stos_word()
2838 emu->x86.R_EAX); in x86emuOp_stos_word()
2840 store_word(emu, emu->x86.R_ES, emu->x86.R_DI, in x86emuOp_stos_word()
2841 emu->x86.R_AX); in x86emuOp_stos_word()
2843 emu->x86.R_DI += inc; in x86emuOp_stos_word()
2857 inc = -1; in x86emuOp_lods_byte()
2860 if (emu->x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { in x86emuOp_lods_byte()
2863 while (emu->x86.R_CX != 0) { in x86emuOp_lods_byte()
2864 emu->x86.R_AL = fetch_data_byte(emu, emu->x86.R_SI); in x86emuOp_lods_byte()
2865 emu->x86.R_CX -= 1; in x86emuOp_lods_byte()
2866 emu->x86.R_SI += inc; in x86emuOp_lods_byte()
2868 emu->x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); in x86emuOp_lods_byte()
2870 emu->x86.R_AL = fetch_data_byte(emu, emu->x86.R_SI); in x86emuOp_lods_byte()
2871 emu->x86.R_SI += inc; in x86emuOp_lods_byte()
2885 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_lods_word()
2891 inc = -inc; in x86emuOp_lods_word()
2894 if (emu->x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { in x86emuOp_lods_word()
2897 count = emu->x86.R_CX; in x86emuOp_lods_word()
2898 emu->x86.R_CX = 0; in x86emuOp_lods_word()
2899 emu->x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); in x86emuOp_lods_word()
2901 while (count--) { in x86emuOp_lods_word()
2902 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_lods_word()
2903 emu->x86.R_EAX = fetch_data_long(emu, emu->x86.R_SI); in x86emuOp_lods_word()
2905 emu->x86.R_AX = fetch_data_word(emu, emu->x86.R_SI); in x86emuOp_lods_word()
2907 emu->x86.R_SI += inc; in x86emuOp_lods_word()
2922 inc = -1; in x86emuOp_scas_byte()
2925 if (emu->x86.mode & SYSMODE_PREFIX_REPE) { in x86emuOp_scas_byte()
2928 while (emu->x86.R_CX != 0) { in x86emuOp_scas_byte()
2929 val2 = fetch_byte(emu, emu->x86.R_ES, emu->x86.R_DI); in x86emuOp_scas_byte()
2930 cmp_byte(emu, emu->x86.R_AL, val2); in x86emuOp_scas_byte()
2931 emu->x86.R_CX -= 1; in x86emuOp_scas_byte()
2932 emu->x86.R_DI += inc; in x86emuOp_scas_byte()
2936 emu->x86.mode &= ~SYSMODE_PREFIX_REPE; in x86emuOp_scas_byte()
2937 } else if (emu->x86.mode & SYSMODE_PREFIX_REPNE) { in x86emuOp_scas_byte()
2940 while (emu->x86.R_CX != 0) { in x86emuOp_scas_byte()
2941 val2 = fetch_byte(emu, emu->x86.R_ES, emu->x86.R_DI); in x86emuOp_scas_byte()
2942 cmp_byte(emu, emu->x86.R_AL, val2); in x86emuOp_scas_byte()
2943 emu->x86.R_CX -= 1; in x86emuOp_scas_byte()
2944 emu->x86.R_DI += inc; in x86emuOp_scas_byte()
2948 emu->x86.mode &= ~SYSMODE_PREFIX_REPNE; in x86emuOp_scas_byte()
2950 val2 = fetch_byte(emu, emu->x86.R_ES, emu->x86.R_DI); in x86emuOp_scas_byte()
2951 cmp_byte(emu, emu->x86.R_AL, val2); in x86emuOp_scas_byte()
2952 emu->x86.R_DI += inc; in x86emuOp_scas_byte()
2966 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_scas_word()
2972 inc = -inc; in x86emuOp_scas_word()
2974 if (emu->x86.mode & SYSMODE_PREFIX_REPE) { in x86emuOp_scas_word()
2977 while (emu->x86.R_CX != 0) { in x86emuOp_scas_word()
2978 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_scas_word()
2979 val = fetch_long(emu, emu->x86.R_ES, in x86emuOp_scas_word()
2980 emu->x86.R_DI); in x86emuOp_scas_word()
2981 cmp_long(emu, emu->x86.R_EAX, val); in x86emuOp_scas_word()
2983 val = fetch_word(emu, emu->x86.R_ES, in x86emuOp_scas_word()
2984 emu->x86.R_DI); in x86emuOp_scas_word()
2985 cmp_word(emu, emu->x86.R_AX, (uint16_t) val); in x86emuOp_scas_word()
2987 emu->x86.R_CX -= 1; in x86emuOp_scas_word()
2988 emu->x86.R_DI += inc; in x86emuOp_scas_word()
2992 emu->x86.mode &= ~SYSMODE_PREFIX_REPE; in x86emuOp_scas_word()
2993 } else if (emu->x86.mode & SYSMODE_PREFIX_REPNE) { in x86emuOp_scas_word()
2996 while (emu->x86.R_CX != 0) { in x86emuOp_scas_word()
2997 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_scas_word()
2998 val = fetch_long(emu, emu->x86.R_ES, in x86emuOp_scas_word()
2999 emu->x86.R_DI); in x86emuOp_scas_word()
3000 cmp_long(emu, emu->x86.R_EAX, val); in x86emuOp_scas_word()
3002 val = fetch_word(emu, emu->x86.R_ES, in x86emuOp_scas_word()
3003 emu->x86.R_DI); in x86emuOp_scas_word()
3004 cmp_word(emu, emu->x86.R_AX, (uint16_t) val); in x86emuOp_scas_word()
3006 emu->x86.R_CX -= 1; in x86emuOp_scas_word()
3007 emu->x86.R_DI += inc; in x86emuOp_scas_word()
3011 emu->x86.mode &= ~SYSMODE_PREFIX_REPNE; in x86emuOp_scas_word()
3013 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_scas_word()
3014 val = fetch_long(emu, emu->x86.R_ES, emu->x86.R_DI); in x86emuOp_scas_word()
3015 cmp_long(emu, emu->x86.R_EAX, val); in x86emuOp_scas_word()
3017 val = fetch_word(emu, emu->x86.R_ES, emu->x86.R_DI); in x86emuOp_scas_word()
3018 cmp_word(emu, emu->x86.R_AX, (uint16_t) val); in x86emuOp_scas_word()
3020 emu->x86.R_DI += inc; in x86emuOp_scas_word()
3031 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_mov_word_AX_IMM()
3032 emu->x86.R_EAX = fetch_long_imm(emu); in x86emuOp_mov_word_AX_IMM()
3034 emu->x86.R_AX = fetch_word_imm(emu); in x86emuOp_mov_word_AX_IMM()
3044 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_mov_word_CX_IMM()
3045 emu->x86.R_ECX = fetch_long_imm(emu); in x86emuOp_mov_word_CX_IMM()
3047 emu->x86.R_CX = fetch_word_imm(emu); in x86emuOp_mov_word_CX_IMM()
3057 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_mov_word_DX_IMM()
3058 emu->x86.R_EDX = fetch_long_imm(emu); in x86emuOp_mov_word_DX_IMM()
3060 emu->x86.R_DX = fetch_word_imm(emu); in x86emuOp_mov_word_DX_IMM()
3070 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_mov_word_BX_IMM()
3071 emu->x86.R_EBX = fetch_long_imm(emu); in x86emuOp_mov_word_BX_IMM()
3073 emu->x86.R_BX = fetch_word_imm(emu); in x86emuOp_mov_word_BX_IMM()
3083 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_mov_word_SP_IMM()
3084 emu->x86.R_ESP = fetch_long_imm(emu); in x86emuOp_mov_word_SP_IMM()
3086 emu->x86.R_SP = fetch_word_imm(emu); in x86emuOp_mov_word_SP_IMM()
3096 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_mov_word_BP_IMM()
3097 emu->x86.R_EBP = fetch_long_imm(emu); in x86emuOp_mov_word_BP_IMM()
3099 emu->x86.R_BP = fetch_word_imm(emu); in x86emuOp_mov_word_BP_IMM()
3109 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_mov_word_SI_IMM()
3110 emu->x86.R_ESI = fetch_long_imm(emu); in x86emuOp_mov_word_SI_IMM()
3112 emu->x86.R_SI = fetch_word_imm(emu); in x86emuOp_mov_word_SI_IMM()
3122 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_mov_word_DI_IMM()
3123 emu->x86.R_EDI = fetch_long_imm(emu); in x86emuOp_mov_word_DI_IMM()
3125 emu->x86.R_DI = fetch_word_imm(emu); in x86emuOp_mov_word_DI_IMM()
3157 /* know operation, decode the mod byte to find the addressing mode. */ in x86emuOp_opcC0_byte_RM_MEM()
3159 destval = (*opcD0_byte_operation[emu->cur_rh]) (emu, destval, amt); in x86emuOp_opcC0_byte_RM_MEM()
3206 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_opcC1_word_RM_MEM()
3210 destval = (*opcD1_long_operation[emu->cur_rh]) in x86emuOp_opcC1_word_RM_MEM()
3217 destval = (*opcD1_word_operation[emu->cur_rh]) in x86emuOp_opcC1_word_RM_MEM()
3233 emu->x86.R_IP = pop_word(emu); in x86emuOp_ret_near_IMM()
3234 emu->x86.R_SP += imm; in x86emuOp_ret_near_IMM()
3249 if (emu->cur_rh != 0) in x86emuOp_mov_byte_RM_IMM()
3251 if (emu->cur_mod != 3) { in x86emuOp_mov_byte_RM_IMM()
3273 if (emu->cur_rh != 0) in x86emuOp32_mov_word_RM_IMM()
3276 if (emu->cur_mod != 3) { in x86emuOp32_mov_word_RM_IMM()
3294 if (emu->cur_rh != 0) in x86emuOp16_mov_word_RM_IMM()
3297 if (emu->cur_mod != 3) { in x86emuOp16_mov_word_RM_IMM()
3311 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_mov_word_RM_IMM()
3330 push_word(emu, emu->x86.R_BP); in x86emuOp_enter()
3331 frame_pointer = emu->x86.R_SP; in x86emuOp_enter()
3334 emu->x86.R_BP -= 2; in x86emuOp_enter()
3335 push_word(emu, fetch_word(emu, emu->x86.R_SS, in x86emuOp_enter()
3336 emu->x86.R_BP)); in x86emuOp_enter()
3340 emu->x86.R_BP = frame_pointer; in x86emuOp_enter()
3341 emu->x86.R_SP = (uint16_t) (emu->x86.R_SP - local); in x86emuOp_enter()
3351 emu->x86.R_SP = emu->x86.R_BP; in x86emuOp_leave()
3352 emu->x86.R_BP = pop_word(emu); in x86emuOp_leave()
3365 emu->x86.R_IP = pop_word(emu); in x86emuOp_ret_far_IMM()
3366 emu->x86.R_CS = pop_word(emu); in x86emuOp_ret_far_IMM()
3367 emu->x86.R_SP += imm; in x86emuOp_ret_far_IMM()
3377 emu->x86.R_IP = pop_word(emu); in x86emuOp_ret_far()
3378 emu->x86.R_CS = pop_word(emu); in x86emuOp_ret_far()
3422 emu->x86.R_IP = pop_word(emu); in x86emuOp_iret()
3423 emu->x86.R_CS = pop_word(emu); in x86emuOp_iret()
3424 emu->x86.R_FLG = pop_word(emu); in x86emuOp_iret()
3438 destval = (*opcD0_byte_operation[emu->cur_rh]) (emu, destval, 1); in x86emuOp_opcD0_byte_RM_1()
3449 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_opcD1_word_RM_1()
3454 destval = (*opcD1_long_operation[emu->cur_rh])(emu, destval, 1); in x86emuOp_opcD1_word_RM_1()
3461 destval = (*opcD1_word_operation[emu->cur_rh])(emu, destval, 1); in x86emuOp_opcD1_word_RM_1()
3477 destval = (*opcD0_byte_operation[emu->cur_rh]) in x86emuOp_opcD2_byte_RM_CL()
3478 (emu, destval, emu->x86.R_CL); in x86emuOp_opcD2_byte_RM_CL()
3489 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_opcD3_word_RM_CL()
3494 destval = (*opcD1_long_operation[emu->cur_rh]) in x86emuOp_opcD3_word_RM_CL()
3495 (emu, destval, emu->x86.R_CL); in x86emuOp_opcD3_word_RM_CL()
3502 destval = (*opcD1_word_operation[emu->cur_rh]) in x86emuOp_opcD3_word_RM_CL()
3503 (emu, destval, emu->x86.R_CL); in x86emuOp_opcD3_word_RM_CL()
3522 /* note the type change here --- returning AL and AH in AX. */ in x86emuOp_aam()
3523 emu->x86.R_AX = aam_word(emu, emu->x86.R_AL); in x86emuOp_aam()
3540 emu->x86.R_AX = aad_word(emu, emu->x86.R_AX); in x86emuOp_aad()
3554 addr = (uint16_t) (emu->x86.R_BX + (uint8_t) emu->x86.R_AL); in x86emuOp_xlat()
3555 emu->x86.R_AL = fetch_data_byte(emu, addr); in x86emuOp_xlat()
3568 if (emu->cur_mod != 3) in x86emuOp_esc_coprocess_d9()
3576 if (emu->cur_mod != 3) in x86emuOp_esc_coprocess_da()
3584 if (emu->cur_mod != 3) in x86emuOp_esc_coprocess_db()
3592 if (emu->cur_mod != 3) in x86emuOp_esc_coprocess_dc()
3600 if (emu->cur_mod != 3) in x86emuOp_esc_coprocess_dd()
3608 if (emu->cur_mod != 3) in x86emuOp_esc_coprocess_de()
3616 if (emu->cur_mod != 3) in x86emuOp_esc_coprocess_df()
3631 ip += (int16_t) emu->x86.R_IP; in x86emuOp_loopne()
3632 emu->x86.R_CX -= 1; in x86emuOp_loopne()
3633 if (emu->x86.R_CX != 0 && !ACCESS_FLAG(F_ZF)) /* CX != 0 and !ZF */ in x86emuOp_loopne()
3634 emu->x86.R_IP = ip; in x86emuOp_loopne()
3647 ip += (int16_t) emu->x86.R_IP; in x86emuOp_loope()
3648 emu->x86.R_CX -= 1; in x86emuOp_loope()
3649 if (emu->x86.R_CX != 0 && ACCESS_FLAG(F_ZF)) /* CX != 0 and ZF */ in x86emuOp_loope()
3650 emu->x86.R_IP = ip; in x86emuOp_loope()
3663 ip += (int16_t) emu->x86.R_IP; in x86emuOp_loop()
3664 emu->x86.R_CX -= 1; in x86emuOp_loop()
3665 if (emu->x86.R_CX != 0) in x86emuOp_loop()
3666 emu->x86.R_IP = ip; in x86emuOp_loop()
3681 target = (uint16_t) (emu->x86.R_IP + offset); in x86emuOp_jcxz()
3682 if (emu->x86.R_CX == 0) in x86emuOp_jcxz()
3683 emu->x86.R_IP = target; in x86emuOp_jcxz()
3696 emu->x86.R_AL = (*emu->emu_inb) (emu, port); in x86emuOp_in_byte_AL_IMM()
3709 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_in_word_AX_IMM()
3710 emu->x86.R_EAX = (*emu->emu_inl) (emu, port); in x86emuOp_in_word_AX_IMM()
3712 emu->x86.R_AX = (*emu->emu_inw) (emu, port); in x86emuOp_in_word_AX_IMM()
3726 (*emu->emu_outb) (emu, port, emu->x86.R_AL); in x86emuOp_out_byte_IMM_AL()
3739 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_out_word_IMM_AX()
3740 (*emu->emu_outl) (emu, port, emu->x86.R_EAX); in x86emuOp_out_word_IMM_AX()
3742 (*emu->emu_outw) (emu, port, emu->x86.R_AX); in x86emuOp_out_word_IMM_AX()
3753 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_call_near_IMM()
3756 ip += (int32_t) emu->x86.R_EIP; in x86emuOp_call_near_IMM()
3757 push_long(emu, emu->x86.R_EIP); in x86emuOp_call_near_IMM()
3758 emu->x86.R_EIP = ip; in x86emuOp_call_near_IMM()
3762 ip += (int16_t) emu->x86.R_IP; /* CHECK SIGN */ in x86emuOp_call_near_IMM()
3763 push_word(emu, emu->x86.R_IP); in x86emuOp_call_near_IMM()
3764 emu->x86.R_IP = ip; in x86emuOp_call_near_IMM()
3778 ip += (int16_t) emu->x86.R_IP; in x86emuOp_jump_near_IMM()
3779 emu->x86.R_IP = (uint16_t) ip; in x86emuOp_jump_near_IMM()
3793 emu->x86.R_IP = ip; in x86emuOp_jump_far_IMM()
3794 emu->x86.R_CS = cs; in x86emuOp_jump_far_IMM()
3808 target = (uint16_t) (emu->x86.R_IP + offset); in x86emuOp_jump_byte_IMM()
3809 emu->x86.R_IP = target; in x86emuOp_jump_byte_IMM()
3819 emu->x86.R_AL = (*emu->emu_inb) (emu, emu->x86.R_DX); in x86emuOp_in_byte_AL_DX()
3829 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_in_word_AX_DX()
3830 emu->x86.R_EAX = (*emu->emu_inl) (emu, emu->x86.R_DX); in x86emuOp_in_word_AX_DX()
3832 emu->x86.R_AX = (*emu->emu_inw) (emu, emu->x86.R_DX); in x86emuOp_in_word_AX_DX()
3843 (*emu->emu_outb) (emu, emu->x86.R_DX, emu->x86.R_AL); in x86emuOp_out_byte_DX_AL()
3853 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in x86emuOp_out_word_DX_AX()
3854 (*emu->emu_outl) (emu, emu->x86.R_DX, emu->x86.R_EAX); in x86emuOp_out_word_DX_AX()
3856 (*emu->emu_outw) (emu, emu->x86.R_DX, emu->x86.R_AX); in x86emuOp_out_word_DX_AX()
3896 if (emu->cur_rh == 1) in x86emuOp_opcF6_byte_RM()
3899 if (emu->cur_rh == 0) { in x86emuOp_opcF6_byte_RM()
3905 switch (emu->cur_rh) { in x86emuOp_opcF6_byte_RM()
3941 if (emu->cur_rh == 1) in x86emuOp32_opcF7_word_RM()
3944 if (emu->cur_rh == 0) { in x86emuOp32_opcF7_word_RM()
3945 if (emu->cur_mod != 3) { in x86emuOp32_opcF7_word_RM()
3959 switch (emu->cur_rh) { in x86emuOp32_opcF7_word_RM()
3990 if (emu->cur_rh == 1) in x86emuOp16_opcF7_word_RM()
3993 if (emu->cur_rh == 0) { in x86emuOp16_opcF7_word_RM()
3994 if (emu->cur_mod != 3) { in x86emuOp16_opcF7_word_RM()
4008 switch (emu->cur_rh) { in x86emuOp16_opcF7_word_RM()
4034 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_opcF7_word_RM()
4053 if (emu->cur_mod != 3) { in x86emuOp_opcFE_byte_RM()
4055 switch (emu->cur_rh) { in x86emuOp_opcFE_byte_RM()
4069 switch (emu->cur_rh) { in x86emuOp_opcFE_byte_RM()
4090 if (emu->cur_mod != 3) { in x86emuOp32_opcFF_word_RM()
4093 switch (emu->cur_rh) { in x86emuOp32_opcFF_word_RM()
4108 switch (emu->cur_rh) { in x86emuOp32_opcFF_word_RM()
4129 if (emu->cur_mod != 3) { in x86emuOp16_opcFF_word_RM()
4132 switch (emu->cur_rh) { in x86emuOp16_opcFF_word_RM()
4147 switch (emu->cur_rh) { in x86emuOp16_opcFF_word_RM()
4169 if ((emu->cur_mod == 3 && (emu->cur_rh == 3 || emu->cur_rh == 5)) || in x86emuOp_opcFF_word_RM()
4170 emu->cur_rh == 7) in x86emuOp_opcFF_word_RM()
4172 if (emu->cur_rh == 0 || emu->cur_rh == 1 || emu->cur_rh == 6) { in x86emuOp_opcFF_word_RM()
4173 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp_opcFF_word_RM()
4180 if (emu->cur_mod != 3) { in x86emuOp_opcFF_word_RM()
4183 switch (emu->cur_rh) { in x86emuOp_opcFF_word_RM()
4186 push_word(emu, emu->x86.R_CS); in x86emuOp_opcFF_word_RM()
4187 emu->x86.R_CS = destval2; in x86emuOp_opcFF_word_RM()
4188 push_word(emu, emu->x86.R_IP); in x86emuOp_opcFF_word_RM()
4189 emu->x86.R_IP = destval; in x86emuOp_opcFF_word_RM()
4193 emu->x86.R_IP = destval; in x86emuOp_opcFF_word_RM()
4194 emu->x86.R_CS = destval2; in x86emuOp_opcFF_word_RM()
4201 switch (emu->cur_rh) { in x86emuOp_opcFF_word_RM()
4203 push_word(emu, emu->x86.R_IP); in x86emuOp_opcFF_word_RM()
4204 emu->x86.R_IP = destval; in x86emuOp_opcFF_word_RM()
4207 emu->x86.R_IP = destval; in x86emuOp_opcFF_word_RM()
4242 push_word(emu, emu->x86.R_ES); in x86emu_exec_one_byte()
4245 emu->x86.R_ES = pop_word(emu); in x86emu_exec_one_byte()
4267 push_word(emu, emu->x86.R_CS); in x86emu_exec_one_byte()
4292 push_word(emu, emu->x86.R_SS); in x86emu_exec_one_byte()
4295 emu->x86.R_SS = pop_word(emu); in x86emu_exec_one_byte()
4317 push_word(emu, emu->x86.R_DS); in x86emu_exec_one_byte()
4320 emu->x86.R_DS = pop_word(emu); in x86emu_exec_one_byte()
4342 emu->x86.mode |= SYSMODE_SEGOVR_ES; in x86emu_exec_one_byte()
4345 emu->x86.R_AL = daa_byte(emu, emu->x86.R_AL); in x86emu_exec_one_byte()
4367 emu->x86.mode |= SYSMODE_SEGOVR_CS; in x86emu_exec_one_byte()
4370 emu->x86.R_AL = das_byte(emu, emu->x86.R_AL); in x86emu_exec_one_byte()
4392 emu->x86.mode |= SYSMODE_SEGOVR_SS; in x86emu_exec_one_byte()
4395 emu->x86.R_AX = aaa_word(emu, emu->x86.R_AX); in x86emu_exec_one_byte()
4418 emu->x86.mode |= SYSMODE_SEGOVR_DS; in x86emu_exec_one_byte()
4421 emu->x86.R_AX = aas_word(emu, emu->x86.R_AX); in x86emu_exec_one_byte()
4425 common_inc_word_long(emu, &emu->x86.register_a); in x86emu_exec_one_byte()
4428 common_inc_word_long(emu, &emu->x86.register_c); in x86emu_exec_one_byte()
4431 common_inc_word_long(emu, &emu->x86.register_d); in x86emu_exec_one_byte()
4434 common_inc_word_long(emu, &emu->x86.register_b); in x86emu_exec_one_byte()
4437 common_inc_word_long(emu, &emu->x86.register_sp); in x86emu_exec_one_byte()
4440 common_inc_word_long(emu, &emu->x86.register_bp); in x86emu_exec_one_byte()
4443 common_inc_word_long(emu, &emu->x86.register_si); in x86emu_exec_one_byte()
4446 common_inc_word_long(emu, &emu->x86.register_di); in x86emu_exec_one_byte()
4450 common_dec_word_long(emu, &emu->x86.register_a); in x86emu_exec_one_byte()
4453 common_dec_word_long(emu, &emu->x86.register_c); in x86emu_exec_one_byte()
4456 common_dec_word_long(emu, &emu->x86.register_d); in x86emu_exec_one_byte()
4459 common_dec_word_long(emu, &emu->x86.register_b); in x86emu_exec_one_byte()
4462 common_dec_word_long(emu, &emu->x86.register_sp); in x86emu_exec_one_byte()
4465 common_dec_word_long(emu, &emu->x86.register_bp); in x86emu_exec_one_byte()
4468 common_dec_word_long(emu, &emu->x86.register_si); in x86emu_exec_one_byte()
4471 common_dec_word_long(emu, &emu->x86.register_di); in x86emu_exec_one_byte()
4475 common_push_word_long(emu, &emu->x86.register_a); in x86emu_exec_one_byte()
4478 common_push_word_long(emu, &emu->x86.register_c); in x86emu_exec_one_byte()
4481 common_push_word_long(emu, &emu->x86.register_d); in x86emu_exec_one_byte()
4484 common_push_word_long(emu, &emu->x86.register_b); in x86emu_exec_one_byte()
4487 common_push_word_long(emu, &emu->x86.register_sp); in x86emu_exec_one_byte()
4490 common_push_word_long(emu, &emu->x86.register_bp); in x86emu_exec_one_byte()
4493 common_push_word_long(emu, &emu->x86.register_si); in x86emu_exec_one_byte()
4496 common_push_word_long(emu, &emu->x86.register_di); in x86emu_exec_one_byte()
4500 common_pop_word_long(emu, &emu->x86.register_a); in x86emu_exec_one_byte()
4503 common_pop_word_long(emu, &emu->x86.register_c); in x86emu_exec_one_byte()
4506 common_pop_word_long(emu, &emu->x86.register_d); in x86emu_exec_one_byte()
4509 common_pop_word_long(emu, &emu->x86.register_b); in x86emu_exec_one_byte()
4512 common_pop_word_long(emu, &emu->x86.register_sp); in x86emu_exec_one_byte()
4515 common_pop_word_long(emu, &emu->x86.register_bp); in x86emu_exec_one_byte()
4518 common_pop_word_long(emu, &emu->x86.register_si); in x86emu_exec_one_byte()
4521 common_pop_word_long(emu, &emu->x86.register_di); in x86emu_exec_one_byte()
4533 emu->x86.mode |= SYSMODE_SEGOVR_FS; in x86emu_exec_one_byte()
4536 emu->x86.mode |= SYSMODE_SEGOVR_GS; in x86emu_exec_one_byte()
4539 emu->x86.mode |= SYSMODE_PREFIX_DATA; in x86emu_exec_one_byte()
4542 emu->x86.mode |= SYSMODE_PREFIX_ADDR; in x86emu_exec_one_byte()
4746 test_byte(emu, emu->x86.R_AL, fetch_byte_imm(emu)); in x86emu_exec_one_byte()
4771 emu->x86.R_AL = fetch_byte_imm(emu); in x86emu_exec_one_byte()
4774 emu->x86.R_CL = fetch_byte_imm(emu); in x86emu_exec_one_byte()
4777 emu->x86.R_DL = fetch_byte_imm(emu); in x86emu_exec_one_byte()
4780 emu->x86.R_BL = fetch_byte_imm(emu); in x86emu_exec_one_byte()
4783 emu->x86.R_AH = fetch_byte_imm(emu); in x86emu_exec_one_byte()
4786 emu->x86.R_CH = fetch_byte_imm(emu); in x86emu_exec_one_byte()
4789 emu->x86.R_DH = fetch_byte_imm(emu); in x86emu_exec_one_byte()
4792 emu->x86.R_BH = fetch_byte_imm(emu); in x86emu_exec_one_byte()
4831 emu->x86.R_IP = pop_word(emu); in x86emu_exec_one_byte()
4834 common_load_far_pointer(emu, &emu->x86.R_ES); in x86emu_exec_one_byte()
4837 common_load_far_pointer(emu, &emu->x86.R_DS); in x86emu_exec_one_byte()
4971 emu->x86.mode |= SYSMODE_PREFIX_REPNE; in x86emu_exec_one_byte()
4974 emu->x86.mode |= SYSMODE_PREFIX_REPE; in x86emu_exec_one_byte()
5019 emu->x86.mode &= ~SYSMODE_CLRMASK; in x86emu_exec_one_byte()
5028 target += (int16_t) emu->x86.R_IP; in common_jmp_long()
5030 emu->x86.R_IP = (uint16_t) target; in common_jmp_long()
5041 if (emu->cur_mod != 3) { in common_set_byte()
5109 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in common_bitstring()
5148 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in common_bitsearch()
5164 shift = emu->x86.R_CL; in common_shift32()
5185 shift = emu->x86.R_CL; in common_shift16()
5199 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in common_shift()
5218 emu->x86.R_EAX = emu->cur_cycles & 0xffffffff; in x86emuOp2_rdtsc()
5219 emu->x86.R_EDX = emu->cur_cycles >> 32; in x86emuOp2_rdtsc()
5229 push_word(emu, emu->x86.R_FS); in x86emuOp2_push_FS()
5239 emu->x86.R_FS = pop_word(emu); in x86emuOp2_pop_FS()
5261 hw_cpuid(&emu->x86.R_EAX, &emu->x86.R_EBX, &emu->x86.R_ECX, in x86emuOp2_cpuid()
5262 &emu->x86.R_EDX); in x86emuOp2_cpuid()
5264 switch (emu->x86.R_EAX) { in x86emuOp2_cpuid()
5266 emu->x86.R_EAX = 1; in x86emuOp2_cpuid()
5269 emu->x86.R_EBX = 0x756e6547; in x86emuOp2_cpuid()
5270 emu->x86.R_EDX = 0x49656e69; in x86emuOp2_cpuid()
5271 emu->x86.R_ECX = 0x6c65746e; in x86emuOp2_cpuid()
5276 emu->x86.R_EAX = 0x00000480; in x86emuOp2_cpuid()
5277 emu->x86.R_EBX = emu->x86.R_ECX = 0; in x86emuOp2_cpuid()
5278 emu->x86.R_EDX = 0x00000002; in x86emuOp2_cpuid()
5280 emu->x86.R_EDX &= 0x00000012; in x86emuOp2_cpuid()
5284 emu->x86.R_EAX = emu->x86.R_EBX = emu->x86.R_ECX = in x86emuOp2_cpuid()
5285 emu->x86.R_EDX = 0; in x86emuOp2_cpuid()
5327 push_word(emu, emu->x86.R_GS); in x86emuOp2_push_GS()
5337 emu->x86.R_GS = pop_word(emu); in x86emuOp2_pop_GS()
5417 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp2_imul_R_RM()
5430 common_load_far_pointer(emu, &emu->x86.R_SS); in x86emuOp2_lss_R_IMM()
5450 common_load_far_pointer(emu, &emu->x86.R_FS); in x86emuOp2_lfs_R_IMM()
5460 common_load_far_pointer(emu, &emu->x86.R_GS); in x86emuOp2_lgs_R_IMM()
5490 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp2_movzx_byte_R_RM()
5522 if (emu->cur_rh < 4) in x86emuOp2_32_btX_I()
5529 switch (emu->cur_rh) { in x86emuOp2_32_btX_I()
5552 if (emu->cur_rh < 4) in x86emuOp2_16_btX_I()
5558 switch (emu->cur_rh) { in x86emuOp2_16_btX_I()
5575 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp2_btX_I()
5608 common_bitsearch(emu, -1); in x86emuOp2_bsr()
5638 if (emu->x86.mode & SYSMODE_PREFIX_DATA) in x86emuOp2_movsx_byte_R_RM()
5917 * |------------------
5944 * |------------------
6004 d -= 0x6; in aas_word()
6005 d -= 0x100; in aas_word()
6071 uint32_t res; /* all operands in native machine order */ in adc_byte()
6098 uint32_t res; /* all operands in native machine order */ in adc_word()
6125 uint32_t lo; /* all operands in native machine order */ in adc_long()
6158 uint32_t res; /* all operands in native machine order */ in add_byte()
6181 uint32_t res; /* all operands in native machine order */ in add_word()
6204 uint32_t lo; /* all operands in native machine order */ in add_long()
6233 uint8_t res; /* all operands in native machine order */ in and_byte()
6254 uint16_t res; /* all operands in native machine order */ in and_word()
6275 uint32_t res; /* all operands in native machine order */ in and_long()
6296 uint32_t res; /* all operands in native machine order */ in cmp_byte()
6299 res = d - s; in cmp_byte()
6326 uint32_t res; /* all operands in native machine order */ in cmp_word()
6329 res = d - s; in cmp_word()
6355 uint32_t res; /* all operands in native machine order */ in cmp_long()
6358 res = d - s; in cmp_long()
6407 d -= 6; in das_byte()
6411 d -= 0x60; in das_byte()
6427 uint32_t res; /* all operands in native machine order */ in dec_byte()
6430 res = d - 1; in dec_byte()
6451 uint32_t res; /* all operands in native machine order */ in dec_word()
6454 res = d - 1; in dec_word()
6475 uint32_t res; /* all operands in native machine order */ in dec_long()
6478 res = d - 1; in dec_long()
6499 uint32_t res; /* all operands in native machine order */ in inc_byte()
6521 uint32_t res; /* all operands in native machine order */ in inc_word()
6543 uint32_t res; /* all operands in native machine order */ in inc_long()
6565 uint8_t res; /* all operands in native machine order */ in or_byte()
6584 uint16_t res; /* all operands in native machine order */ in or_word()
6604 uint32_t res; /* all operands in native machine order */ in or_long()
6629 res = (uint8_t) - s; in neg_byte()
6633 /* calculate the borrow chain --- modified such that d=0. in neg_byte()
6655 res = (uint16_t) - s; in neg_word()
6660 /* calculate the borrow chain --- modified such that d=0. in neg_word()
6682 res = (uint32_t) - s; in neg_long()
6687 /* calculate the borrow chain --- modified such that d=0. in neg_long()
6707 /* s is the rotate distance. It varies from 0 - 8. */ in rcl_byte()
6716 * The new carry flag (was B_n) the stuff in B_n-1 .. B_0 the stuff in rcl_byte()
6725 * IF n > 0 1) CF <- b_(8-n) 2) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0 in rcl_byte()
6726 * 3) B_(n-1) <- cf 4) B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1)) in rcl_byte()
6731 /* CF <- b_(8-n) */ in rcl_byte()
6732 cf = (d >> (8 - cnt)) & 0x1; in rcl_byte()
6736 * B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0 in rcl_byte()
6743 * B_cnt-2 .. B_0 in rcl_byte()
6744 * B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1)) in rcl_byte()
6745 * shift it downward, 7-(n-2) = 9-n positions. and mask off in rcl_byte()
6748 mask = (1 << (cnt - 1)) - 1; in rcl_byte()
6749 res |= (d >> (9 - cnt)) & mask; in rcl_byte()
6753 /* B_(n-1) <- cf */ in rcl_byte()
6754 res |= 1 << (cnt - 1); in rcl_byte()
6780 cf = (d >> (16 - cnt)) & 0x1; in rcl_word()
6782 mask = (1 << (cnt - 1)) - 1; in rcl_word()
6783 res |= (d >> (17 - cnt)) & mask; in rcl_word()
6785 res |= 1 << (cnt - 1); in rcl_word()
6805 cf = (d >> (32 - cnt)) & 0x1; in rcl_long()
6807 mask = (1 << (cnt - 1)) - 1; in rcl_long()
6808 res |= (d >> (33 - cnt)) & mask; in rcl_long()
6810 res |= 1 << (cnt - 1); in rcl_long()
6830 /* s is the rotate distance. It varies from 0 - 8. d is the byte in rcr_byte()
6844 * 1) CF <- b_(n-1) in rcr_byte()
6845 * 2) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n) in rcr_byte()
6846 * 3) B_(8-n) <- cf 4) B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0) in rcr_byte()
6851 /* CF <- b_(n-1) */ in rcr_byte()
6855 * either 0 if flag not set non-zero if flag is set. in rcr_byte()
6861 cf = (d >> (cnt - 1)) & 0x1; in rcr_byte()
6863 /* B_(8-(n+1)) .. B_(0) <- b_(7) .. b_n */ in rcr_byte()
6869 mask = (1 << (8 - cnt)) - 1; in rcr_byte()
6873 * B_cnt-2 .. B_0 */ in rcr_byte()
6874 /* B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0) */ in rcr_byte()
6875 /* shift it downward, 7-(n-2) = 9-n positions. and mask off in rcr_byte()
6877 res |= (d << (9 - cnt)); in rcr_byte()
6881 /* B_(8-n) <- cf */ in rcr_byte()
6882 res |= 1 << (8 - cnt); in rcr_byte()
6914 cf = (d >> (cnt - 1)) & 0x1; in rcr_word()
6915 mask = (1 << (16 - cnt)) - 1; in rcr_word()
6917 res |= (d << (17 - cnt)); in rcr_word()
6919 res |= 1 << (16 - cnt); in rcr_word()
6947 cf = (d >> (cnt - 1)) & 0x1; in rcr_long()
6948 mask = (1 << (32 - cnt)) - 1; in rcr_long()
6951 res |= (d << (33 - cnt)); in rcr_long()
6953 res |= 1 << (32 - cnt); in rcr_long()
6974 /* s is the rotate distance. It varies from 0 - 8. d is the byte in rol_byte()
6984 * IF n > 0 1) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_(0) 2) B_(n-1) .. in rol_byte()
6985 * B_(0) <- b_(7) .. b_(8-n) */ in rol_byte()
6988 /* B_(7) .. B_(n) <- b_(8-(n+1)) .. b_(0) */ in rol_byte()
6991 /* B_(n-1) .. B_(0) <- b_(7) .. b_(8-n) */ in rol_byte()
6992 mask = (1 << cnt) - 1; in rol_byte()
6993 res |= (d >> (8 - cnt)) & mask; in rol_byte()
7021 mask = (1 << cnt) - 1; in rol_word()
7022 res |= (d >> (16 - cnt)) & mask; in rol_word()
7047 mask = (1 << cnt) - 1; in rol_long()
7048 res |= (d >> (32 - cnt)) & mask; in rol_long()
7071 /* s is the rotate distance. It varies from 0 - 8. d is the byte in ror_byte()
7080 * IF n > 0 1) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n) 2) B_(7) .. in ror_byte()
7081 * B_(8-n) <- b_(n-1) .. b_(0) */ in ror_byte()
7084 /* B_(7) .. B_(8-n) <- b_(n-1) .. b_(0) */ in ror_byte()
7085 res = (d << (8 - cnt)); in ror_byte()
7087 /* B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n) */ in ror_byte()
7088 mask = (1 << (8 - cnt)) - 1; in ror_byte()
7114 res = (d << (16 - cnt)); in ror_word()
7115 mask = (1 << (16 - cnt)) - 1; in ror_word()
7138 res = (d << (32 - cnt)); in ror_long()
7139 mask = (1 << (32 - cnt)) - 1; in ror_long()
7166 cf = d & (1 << (8 - cnt)); in shl_byte()
7180 /* was (emu->x86.R_FLG&F_CF)==F_CF)), */ in shl_byte()
7187 CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x80, F_CF); in shl_byte()
7209 cf = d & (1 << (16 - cnt)); in shl_word()
7228 CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x8000, F_CF); in shl_word()
7250 cf = d & (1 << (32 - cnt)); in shl_long()
7266 CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x80000000, F_CF); in shl_long()
7287 cf = d & (1 << (cnt - 1)); in shr_byte()
7304 CONDITIONAL_SET_FLAG((d >> (s - 1)) & 0x1, F_CF); in shr_byte()
7325 cf = d & (1 << (cnt - 1)); in shr_word()
7363 cf = d & (1 << (cnt - 1)); in shr_long()
7401 mask = (1 << (8 - cnt)) - 1; in sar_byte()
7402 cf = d & (1 << (cnt - 1)); in sar_byte()
7442 mask = (1 << (16 - cnt)) - 1; in sar_word()
7443 cf = d & (1 << (cnt - 1)); in sar_word()
7483 mask = (1 << (32 - cnt)) - 1; in sar_long()
7484 cf = d & (1 << (cnt - 1)); in sar_long()
7523 res = (d << cnt) | (fill >> (16 - cnt)); in shld_word()
7524 cf = d & (1 << (16 - cnt)); in shld_word()
7540 CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x8000, F_CF); in shld_word()
7561 res = (d << cnt) | (fill >> (32 - cnt)); in shld_long()
7562 cf = d & (1 << (32 - cnt)); in shld_long()
7578 CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x80000000, F_CF); in shld_long()
7599 cf = d & (1 << (cnt - 1)); in shrd_word()
7600 res = (d >> cnt) | (fill << (16 - cnt)); in shrd_word()
7637 cf = d & (1 << (cnt - 1)); in shrd_long()
7638 res = (d >> cnt) | (fill << (32 - cnt)); in shrd_long()
7669 uint32_t res; /* all operands in native machine order */ in sbb_byte()
7673 res = d - s - 1; in sbb_byte()
7675 res = d - s; in sbb_byte()
7695 uint32_t res; /* all operands in native machine order */ in sbb_word()
7699 res = d - s - 1; in sbb_word()
7701 res = d - s; in sbb_word()
7721 uint32_t res; /* all operands in native machine order */ in sbb_long()
7725 res = d - s - 1; in sbb_long()
7727 res = d - s; in sbb_long()
7747 uint32_t res; /* all operands in native machine order */ in sub_byte()
7750 res = d - s; in sub_byte()
7770 uint32_t res; /* all operands in native machine order */ in sub_word()
7773 res = d - s; in sub_word()
7793 uint32_t res; /* all operands in native machine order */ in sub_long()
7796 res = d - s; in sub_long()
7816 uint32_t res; /* all operands in native machine order */ in test_byte()
7835 uint32_t res; /* all operands in native machine order */ in test_word()
7854 uint32_t res; /* all operands in native machine order */ in test_long()
7873 uint8_t res; /* all operands in native machine order */ in xor_byte()
7892 uint16_t res; /* all operands in native machine order */ in xor_word()
7911 uint32_t res; /* all operands in native machine order */ in xor_long()
7930 int16_t res = (int16_t) ((int8_t) emu->x86.R_AL * (int8_t) s); in imul_byte()
7932 emu->x86.R_AX = res; in imul_byte()
7933 if (((emu->x86.R_AL & 0x80) == 0 && emu->x86.R_AH == 0x00) || in imul_byte()
7934 ((emu->x86.R_AL & 0x80) != 0 && emu->x86.R_AH == 0xFF)) { in imul_byte()
7950 int32_t res = (int16_t) emu->x86.R_AX * (int16_t) s; in imul_word()
7952 emu->x86.R_AX = (uint16_t) res; in imul_word()
7953 emu->x86.R_DX = (uint16_t) (res >> 16); in imul_word()
7954 if (((emu->x86.R_AX & 0x8000) == 0 && emu->x86.R_DX == 0x00) || in imul_word()
7955 ((emu->x86.R_AX & 0x8000) != 0 && emu->x86.R_DX == 0xFF)) { in imul_word()
7973 res = (int64_t)(int32_t)emu->x86.R_EAX * (int32_t)s; in imul_long()
7974 emu->x86.R_EAX = (uint32_t)res; in imul_long()
7975 emu->x86.R_EDX = ((uint64_t)res) >> 32; in imul_long()
7976 if (((emu->x86.R_EAX & 0x80000000) == 0 && emu->x86.R_EDX == 0x00) || in imul_long()
7977 ((emu->x86.R_EAX & 0x80000000) != 0 && emu->x86.R_EDX == 0xFF)) { in imul_long()
7993 uint16_t res = (uint16_t) (emu->x86.R_AL * s); in mul_byte()
7995 emu->x86.R_AX = res; in mul_byte()
7996 if (emu->x86.R_AH == 0) { in mul_byte()
8012 uint32_t res = emu->x86.R_AX * s; in mul_word()
8014 emu->x86.R_AX = (uint16_t) res; in mul_word()
8015 emu->x86.R_DX = (uint16_t) (res >> 16); in mul_word()
8016 if (emu->x86.R_DX == 0) { in mul_word()
8032 uint64_t res = (uint64_t) emu->x86.R_EAX * s; in mul_long()
8034 emu->x86.R_EAX = (uint32_t) res; in mul_long()
8035 emu->x86.R_EDX = (uint32_t) (res >> 32); in mul_long()
8037 if (emu->x86.R_EDX == 0) { in mul_long()
8055 dvd = (int16_t) emu->x86.R_AX; in idiv_byte()
8062 if (div > 0x7f || div < -0x7f) { in idiv_byte()
8066 emu->x86.R_AL = (int8_t) div; in idiv_byte()
8067 emu->x86.R_AH = (int8_t) mod; in idiv_byte()
8079 dvd = (((int32_t) emu->x86.R_DX) << 16) | emu->x86.R_AX; in idiv_word()
8086 if (div > 0x7fff || div < -0x7fff) { in idiv_word()
8095 emu->x86.R_AX = (uint16_t) div; in idiv_word()
8096 emu->x86.R_DX = (uint16_t) mod; in idiv_word()
8108 dvd = (((int64_t) emu->x86.R_EDX) << 32) | emu->x86.R_EAX; in idiv_long()
8115 if (div > 0x7fffffff || div < -0x7fffffff) { in idiv_long()
8125 emu->x86.R_EAX = (uint32_t) div; in idiv_long()
8126 emu->x86.R_EDX = (uint32_t) mod; in idiv_long()
8138 dvd = emu->x86.R_AX; in div_byte()
8149 emu->x86.R_AL = (uint8_t) div; in div_byte()
8150 emu->x86.R_AH = (uint8_t) mod; in div_byte()
8162 dvd = (((uint32_t) emu->x86.R_DX) << 16) | emu->x86.R_AX; in div_word()
8178 emu->x86.R_AX = (uint16_t) div; in div_word()
8179 emu->x86.R_DX = (uint16_t) mod; in div_word()
8191 dvd = (((uint64_t) emu->x86.R_EDX) << 32) | emu->x86.R_EAX; in div_long()
8208 emu->x86.R_EAX = (uint32_t) div; in div_long()
8209 emu->x86.R_EDX = (uint32_t) mod; in div_long()
8222 inc = -size; in ins()
8224 if (emu->x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { in ins()
8227 uint32_t count = ((emu->x86.mode & SYSMODE_PREFIX_DATA) ? in ins()
8228 emu->x86.R_ECX : emu->x86.R_CX); in ins()
8231 while (count--) { in ins()
8232 store_byte(emu, emu->x86.R_ES, emu->x86.R_DI, in ins()
8233 (*emu->emu_inb) (emu, emu->x86.R_DX)); in ins()
8234 emu->x86.R_DI += inc; in ins()
8239 while (count--) { in ins()
8240 store_word(emu, emu->x86.R_ES, emu->x86.R_DI, in ins()
8241 (*emu->emu_inw) (emu, emu->x86.R_DX)); in ins()
8242 emu->x86.R_DI += inc; in ins()
8246 while (count--) { in ins()
8247 store_long(emu, emu->x86.R_ES, emu->x86.R_DI, in ins()
8248 (*emu->emu_inl) (emu, emu->x86.R_DX)); in ins()
8249 emu->x86.R_DI += inc; in ins()
8253 emu->x86.R_CX = 0; in ins()
8254 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in ins()
8255 emu->x86.R_ECX = 0; in ins()
8257 emu->x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); in ins()
8261 store_byte(emu, emu->x86.R_ES, emu->x86.R_DI, in ins()
8262 (*emu->emu_inb) (emu, emu->x86.R_DX)); in ins()
8265 store_word(emu, emu->x86.R_ES, emu->x86.R_DI, in ins()
8266 (*emu->emu_inw) (emu, emu->x86.R_DX)); in ins()
8269 store_long(emu, emu->x86.R_ES, emu->x86.R_DI, in ins()
8270 (*emu->emu_inl) (emu, emu->x86.R_DX)); in ins()
8273 emu->x86.R_DI += inc; in ins()
8287 inc = -size; in outs()
8289 if (emu->x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { in outs()
8292 uint32_t count = ((emu->x86.mode & SYSMODE_PREFIX_DATA) ? in outs()
8293 emu->x86.R_ECX : emu->x86.R_CX); in outs()
8296 while (count--) { in outs()
8297 (*emu->emu_outb) (emu, emu->x86.R_DX, in outs()
8298 fetch_byte(emu, emu->x86.R_ES, in outs()
8299 emu->x86.R_SI)); in outs()
8300 emu->x86.R_SI += inc; in outs()
8305 while (count--) { in outs()
8306 (*emu->emu_outw) (emu, emu->x86.R_DX, in outs()
8307 fetch_word(emu, emu->x86.R_ES, in outs()
8308 emu->x86.R_SI)); in outs()
8309 emu->x86.R_SI += inc; in outs()
8313 while (count--) { in outs()
8314 (*emu->emu_outl) (emu, emu->x86.R_DX, in outs()
8315 fetch_long(emu, emu->x86.R_ES, in outs()
8316 emu->x86.R_SI)); in outs()
8317 emu->x86.R_SI += inc; in outs()
8321 emu->x86.R_CX = 0; in outs()
8322 if (emu->x86.mode & SYSMODE_PREFIX_DATA) { in outs()
8323 emu->x86.R_ECX = 0; in outs()
8325 emu->x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); in outs()
8329 (*emu->emu_outb) (emu, emu->x86.R_DX, in outs()
8330 fetch_byte(emu, emu->x86.R_ES, emu->x86.R_SI)); in outs()
8333 (*emu->emu_outw) (emu, emu->x86.R_DX, in outs()
8334 fetch_word(emu, emu->x86.R_ES, emu->x86.R_SI)); in outs()
8337 (*emu->emu_outl) (emu, emu->x86.R_DX, in outs()
8338 fetch_long(emu, emu->x86.R_ES, emu->x86.R_SI)); in outs()
8341 emu->x86.R_SI += inc; in outs()
8349 * NOTE: Do not inline this, as (*emu->emu_wrX) is already inline!
8354 emu->x86.R_SP -= 2; in push_word()
8355 store_word(emu, emu->x86.R_SS, emu->x86.R_SP, w); in push_word()
8362 * NOTE: Do not inline this, as (*emu->emu_wrX) is already inline!
8367 emu->x86.R_SP -= 4; in push_long()
8368 store_long(emu, emu->x86.R_SS, emu->x86.R_SP, w); in push_long()
8375 * NOTE: Do not inline this, as (*emu->emu_rdX) is already inline!
8382 res = fetch_word(emu, emu->x86.R_SS, emu->x86.R_SP); in pop_word()
8383 emu->x86.R_SP += 2; in pop_word()
8391 * NOTE: Do not inline this, as (*emu->emu_rdX) is already inline!
8398 res = fetch_long(emu, emu->x86.R_SS, emu->x86.R_SP); in pop_long()
8399 emu->x86.R_SP += 4; in pop_long()