trunk/src/emu/cpu/i386/i386op16.c
| r21477 | r21478 | |
| 3660 | 3660 | CYCLES(cpustate,CYCLES_RET_IMM_INTERSEG); |
| 3661 | 3661 | } |
| 3662 | 3662 | |
| 3663 | | static void I386OP(load_far_pointer16)(i386_state *cpustate, int s) |
| 3663 | static bool I386OP(load_far_pointer16)(i386_state *cpustate, int s) |
| 3664 | 3664 | { |
| 3665 | 3665 | UINT8 modrm = FETCH(cpustate); |
| 3666 | 3666 | UINT16 selector; |
| 3667 | 3667 | |
| 3668 | 3668 | if( modrm >= 0xc0 ) { |
| 3669 | | fatalerror("i386: load_far_pointer16 NYI\n"); |
| 3669 | //logerror("i386: load_far_pointer16 NYI\n"); // don't log, NT will use this a lot |
| 3670 | i386_trap(cpustate,6, 0, 0); |
| 3671 | return false; |
| 3670 | 3672 | } else { |
| 3671 | 3673 | UINT32 ea = GetEA(cpustate,modrm,0); |
| 3672 | 3674 | STORE_REG16(modrm, READ16(cpustate,ea + 0)); |
| 3673 | 3675 | selector = READ16(cpustate,ea + 2); |
| 3674 | 3676 | i386_sreg_load(cpustate,selector,s,NULL); |
| 3675 | 3677 | } |
| 3678 | return true; |
| 3676 | 3679 | } |
| 3677 | 3680 | |
| 3678 | 3681 | static void I386OP(lds16)(i386_state *cpustate) // Opcode 0xc5 |
| 3679 | 3682 | { |
| 3680 | | I386OP(load_far_pointer16)(cpustate, DS); |
| 3681 | | CYCLES(cpustate,CYCLES_LDS); |
| 3683 | if(I386OP(load_far_pointer16)(cpustate, DS)) |
| 3684 | CYCLES(cpustate,CYCLES_LDS); |
| 3682 | 3685 | } |
| 3683 | 3686 | |
| 3684 | 3687 | static void I386OP(lss16)(i386_state *cpustate) // Opcode 0x0f 0xb2 |
| 3685 | 3688 | { |
| 3686 | | I386OP(load_far_pointer16)(cpustate, SS); |
| 3687 | | CYCLES(cpustate,CYCLES_LSS); |
| 3689 | if(I386OP(load_far_pointer16)(cpustate, SS)) |
| 3690 | CYCLES(cpustate,CYCLES_LSS); |
| 3688 | 3691 | } |
| 3689 | 3692 | |
| 3690 | 3693 | static void I386OP(les16)(i386_state *cpustate) // Opcode 0xc4 |
| 3691 | 3694 | { |
| 3692 | | I386OP(load_far_pointer16)(cpustate, ES); |
| 3693 | | CYCLES(cpustate,CYCLES_LES); |
| 3695 | if(I386OP(load_far_pointer16)(cpustate, ES)) |
| 3696 | CYCLES(cpustate,CYCLES_LES); |
| 3694 | 3697 | } |
| 3695 | 3698 | |
| 3696 | 3699 | static void I386OP(lfs16)(i386_state *cpustate) // Opcode 0x0f 0xb4 |
| 3697 | 3700 | { |
| 3698 | | I386OP(load_far_pointer16)(cpustate, FS); |
| 3699 | | CYCLES(cpustate,CYCLES_LFS); |
| 3701 | if(I386OP(load_far_pointer16)(cpustate, FS)) |
| 3702 | CYCLES(cpustate,CYCLES_LFS); |
| 3700 | 3703 | } |
| 3701 | 3704 | |
| 3702 | 3705 | static void I386OP(lgs16)(i386_state *cpustate) // Opcode 0x0f 0xb5 |
| 3703 | 3706 | { |
| 3704 | | I386OP(load_far_pointer16)(cpustate, GS); |
| 3705 | | CYCLES(cpustate,CYCLES_LGS); |
| 3707 | if(I386OP(load_far_pointer16)(cpustate, GS)) |
| 3708 | CYCLES(cpustate,CYCLES_LGS); |
| 3706 | 3709 | } |