|
|
| version 1.10, 2003/12/01 10:45:46 | version 1.11, 2003/12/08 00:55:31 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "i286.h" | #include "cpucore.h" |
| #include "i286c.h" | #include "i286c.h" |
| #include "memory.h" | #include "memory.h" |
| #include "i286c.mcr" | #include "i286c.mcr" |
| Line 13 I286_0F _sgdt(UINT op) { | Line 13 I286_0F _sgdt(UINT op) { |
| I286_WORKCLOCK(11); | I286_WORKCLOCK(11); |
| if (op < 0xc0) { | if (op < 0xc0) { |
| ad = GET_EA(op, &seg); | ad = GET_EA(op, &seg); |
| i286_memorywrite_w(seg + ad, i286core.s.GDTR.limit); | i286_memorywrite_w(seg + ad, I286_GDTR.limit); |
| i286_memorywrite_w(seg + LOW16(ad + 2), i286core.s.GDTR.base); | i286_memorywrite_w(seg + LOW16(ad + 2), I286_GDTR.base); |
| i286_memorywrite_w(seg + LOW16(ad + 4), | i286_memorywrite_w(seg + LOW16(ad + 4), |
| (REG16)(0xff00 + i286core.s.GDTR.base24)); | (REG16)(0xff00 + I286_GDTR.base24)); |
| } | } |
| else { | else { |
| INT_NUM(6, I286_IP - 2); | INT_NUM(6, I286_IP - 2); |
| Line 31 I286_0F _sidt(UINT op) { | Line 31 I286_0F _sidt(UINT op) { |
| I286_WORKCLOCK(12); | I286_WORKCLOCK(12); |
| if (op < 0xc0) { | if (op < 0xc0) { |
| ad = GET_EA(op, &seg); | ad = GET_EA(op, &seg); |
| i286_memorywrite_w(seg + ad, i286core.s.IDTR.limit); | i286_memorywrite_w(seg + ad, I286_IDTR.limit); |
| i286_memorywrite_w(seg + LOW16(ad + 2), i286core.s.IDTR.base); | i286_memorywrite_w(seg + LOW16(ad + 2), I286_IDTR.base); |
| i286_memorywrite_w(seg + LOW16(ad + 4), | i286_memorywrite_w(seg + LOW16(ad + 4), |
| (REG16)(0xff00 + i286core.s.IDTR.base24)); | (REG16)(0xff00 + I286_IDTR.base24)); |
| } | } |
| else { | else { |
| INT_NUM(6, I286_IP - 2); | INT_NUM(6, I286_IP - 2); |
| Line 49 I286_0F _lgdt(UINT op) { | Line 49 I286_0F _lgdt(UINT op) { |
| I286_WORKCLOCK(11); | I286_WORKCLOCK(11); |
| if (op < 0xc0) { | if (op < 0xc0) { |
| ad = GET_EA(op, &seg); | ad = GET_EA(op, &seg); |
| i286core.s.GDTR.limit = i286_memoryread_w(seg + ad); | I286_GDTR.limit = i286_memoryread_w(seg + ad); |
| i286core.s.GDTR.base = i286_memoryread_w(seg + LOW16(ad + 2)); | I286_GDTR.base = i286_memoryread_w(seg + LOW16(ad + 2)); |
| i286core.s.GDTR.base24 = i286_memoryread(seg + LOW16(ad + 4)); | I286_GDTR.base24 = i286_memoryread(seg + LOW16(ad + 4)); |
| i286core.s.GDTR.reserved = i286_memoryread(seg + LOW16(ad + 5)); | I286_GDTR.reserved = i286_memoryread(seg + LOW16(ad + 5)); |
| } | } |
| else { | else { |
| INT_NUM(6, I286_IP - 2); | INT_NUM(6, I286_IP - 2); |
| Line 67 I286_0F _lidt(UINT op) { | Line 67 I286_0F _lidt(UINT op) { |
| I286_WORKCLOCK(11); | I286_WORKCLOCK(11); |
| if (op < 0xc0) { | if (op < 0xc0) { |
| ad = GET_EA(op, &seg); | ad = GET_EA(op, &seg); |
| i286core.s.IDTR.limit = i286_memoryread_w(seg + ad); | I286_IDTR.limit = i286_memoryread_w(seg + ad); |
| i286core.s.IDTR.base = i286_memoryread_w(seg + LOW16(ad + 2)); | I286_IDTR.base = i286_memoryread_w(seg + LOW16(ad + 2)); |
| i286core.s.IDTR.base24 = i286_memoryread(seg + LOW16(ad + 4)); | I286_IDTR.base24 = i286_memoryread(seg + LOW16(ad + 4)); |
| i286core.s.IDTR.reserved = i286_memoryread(seg + LOW16(ad + 5)); | I286_IDTR.reserved = i286_memoryread(seg + LOW16(ad + 5)); |
| } | } |
| else { | else { |
| INT_NUM(6, I286_IP - 2); | INT_NUM(6, I286_IP - 2); |
| Line 81 I286_0F _smsw(UINT op) { | Line 81 I286_0F _smsw(UINT op) { |
| if (op >= 0xc0) { | if (op >= 0xc0) { |
| I286_WORKCLOCK(3); | I286_WORKCLOCK(3); |
| *(REG16_B20(op)) = i286core.s.MSW; | *(REG16_B20(op)) = I286_MSW; |
| } | } |
| else { | else { |
| I286_WORKCLOCK(6); | I286_WORKCLOCK(6); |
| i286_memorywrite_w(CALC_EA(op), i286core.s.MSW); | i286_memorywrite_w(CALC_EA(op), I286_MSW); |
| } | } |
| } | } |
| Line 93 I286_0F _lmsw(UINT op) { | Line 93 I286_0F _lmsw(UINT op) { |
| if (op >= 0xc0) { | if (op >= 0xc0) { |
| I286_WORKCLOCK(2); | I286_WORKCLOCK(2); |
| i286core.s.MSW = *(REG16_B20(op)); | I286_MSW = *(REG16_B20(op)); |
| } | } |
| else { | else { |
| I286_WORKCLOCK(3); | I286_WORKCLOCK(3); |
| i286core.s.MSW = i286_memoryread_w(CALC_EA(op)); | I286_MSW = i286_memoryread_w(CALC_EA(op)); |
| } | } |
| } | } |
| Line 113 I286_0F _loadall286(void) { | Line 113 I286_0F _loadall286(void) { |
| UINT16 tmp; | UINT16 tmp; |
| I286_WORKCLOCK(195); | I286_WORKCLOCK(195); |
| i286core.s.MSW = LOADINTELWORD(mem + 0x804); | I286_MSW = LOADINTELWORD(mem + 0x804); |
| tmp = LOADINTELWORD(mem + 0x818); | tmp = LOADINTELWORD(mem + 0x818); |
| I286_OV = tmp & O_FLAG; | I286_OV = tmp & O_FLAG; |
| I286_FLAG = tmp & (0xfff ^ O_FLAG); | I286_FLAG = tmp & (0xfff ^ O_FLAG); |