--- np2/i286x/i286xcts.cpp 2003/10/16 17:57:29 1.1 +++ np2/i286x/i286xcts.cpp 2003/12/26 23:30:26 1.8 @@ -1,10 +1,8 @@ #include "compiler.h" -#include "nevent.h" -#include "i286.h" +#include "cpucore.h" #include "i286x.h" #include "i286xadr.h" #include "i286xcts.h" -#include "memory.h" #include "i286x.mcr" #include "i286xea.mcr" @@ -17,15 +15,15 @@ I286 _sgdt(void) { I286CLOCK(11) call p_get_ea[eax*4] lea ecx, [edi + ebp] - mov dx, word ptr GDTR + mov dx, word ptr i286core.s.GDTR call i286_memorywrite_w add bp, 2 lea ecx, [edi + ebp] - mov dx, word ptr (GDTR+2) + mov dx, word ptr (i286core.s.GDTR+2) call i286_memorywrite_w add bp, 2 lea ecx, [edi + ebp] - mov dl, byte ptr (GDTR+4) // ver0.29 + mov dl, byte ptr (i286core.s.GDTR+4) // ver0.29 mov dh, -1 jmp i286_memorywrite_w align 4 @@ -43,15 +41,15 @@ I286 _sidt(void) { I286CLOCK(12) call p_get_ea[eax*4] lea ecx, [edi + ebp] - mov dx, word ptr IDTR + mov dx, word ptr i286core.s.IDTR call i286_memorywrite_w add bp, 2 lea ecx, [edi + ebp] - mov dx, word ptr (IDTR+2) + mov dx, word ptr (i286core.s.IDTR+2) call i286_memorywrite_w add bp, 2 lea ecx, [edi + ebp] - mov dl, byte ptr (IDTR+4) // ver0.29 + mov dl, byte ptr (i286core.s.IDTR+4) mov dh, -1 jmp i286_memorywrite_w align 4 @@ -70,15 +68,15 @@ I286 _lgdt(void) { call p_get_ea[eax*4] lea ecx, [edi + ebp] call i286_memoryread_w - mov word ptr GDTR, ax + mov word ptr i286core.s.GDTR, ax add bp, 2 lea ecx, [edi + ebp] call i286_memoryread_w - mov word ptr (GDTR+2), ax + mov word ptr (i286core.s.GDTR+2), ax add bp, 2 lea ecx, [edi + ebp] - call i286_memoryread_w - mov word ptr (GDTR+4), ax + call i286_memoryread + mov byte ptr (i286core.s.GDTR+4), al ret align 4 register_eareg16: @@ -96,15 +94,15 @@ I286 _lidt(void) { call p_get_ea[eax*4] lea ecx, [edi + ebp] call i286_memoryread_w - mov word ptr IDTR, ax + mov word ptr i286core.s.IDTR, ax add bp, 2 lea ecx, [edi + ebp] call i286_memoryread_w - mov word ptr (IDTR+2), ax + mov word ptr (i286core.s.IDTR+2), ax add bp, 2 lea ecx, [edi + ebp] - call i286_memoryread_w - mov word ptr (IDTR+4), ax + call i286_memoryread + mov byte ptr (i286core.s.IDTR+4), al ret align 4 register_eareg16: @@ -117,16 +115,16 @@ I286 _smsw(void) { __asm { PREPART_EA16(3) - mov dx, MSW + mov dx, i286core.s.MSW mov word ptr I286_REG[eax*2], dx GET_NEXTPRE2 ret MEMORY_EA16(6) - mov ax, MSW + mov ax, i286core.s.MSW mov word ptr I286_MEM[ecx], ax ret extmem_eareg16: - mov dx, MSW + mov dx, i286core.s.MSW jmp i286_memorywrite_w } } @@ -135,20 +133,21 @@ I286 _smsw(void) { I286 _lmsw(void) { __asm { + and word ptr i286core.s.MSW, 1 PREPART_EA16(2) mov ax, word ptr I286_REG[eax*2] and ax, 0ch - mov MSW, ax + or i286core.s.MSW, ax GET_NEXTPRE2 ret MEMORY_EA16(3) mov ax, word ptr I286_MEM[ecx] and ax, 0ch - mov MSW, ax + or i286core.s.MSW, ax ret EXTMEM_EA16 and ax, 0ch - mov MSW, ax + or i286core.s.MSW, ax ret } } @@ -195,7 +194,7 @@ i286_cts1: movzx eax, bh align 4 loadall286: I286CLOCK(195) mov ax, word ptr mem[0x0804] // MSW - mov MSW, ax + mov i286core.s.MSW, ax mov ax, word ptr mem[0x0818] // flag mov I286_FLAG, ax and ah, 3