Commit graph

37 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto
ec52f30bc5 [FAST486]
- Fix return values of Fast486OpcodeSahf and Fast486OpcodeLahf handlers.
- [TheFlash], can you please see what we should return after calling Fast486ExceptionWithErrorCode in Fast486OpcodePopFlags ?

svn path=/branches/ntvdm/; revision=62313
2014-02-23 21:02:02 +00:00
Aleksandar Andrejevic
011259b78f [FAST486]
Update the AC flag in the POPF instruction.


svn path=/branches/ntvdm/; revision=62278
2014-02-21 01:15:03 +00:00
Aleksandar Andrejevic
f8861a562a [FAST486]
Remove the waiting code for the HLT instruction until I figure out how to do it properly.


svn path=/branches/ntvdm/; revision=61276
2013-12-15 05:08:57 +00:00
Aleksandar Andrejevic
978c08c15c [FAST486]
Implement the BOUND instruction.


svn path=/branches/ntvdm/; revision=61205
2013-12-03 01:30:15 +00:00
Aleksandar Andrejevic
e7a6deb93f [FAST486]
The current "fast" method used in MOVS gives incorrect results. It has been temporarily
replaced with a slow method that works correctly.
The string functions do nothing when CX is 0 on entry, fix CMPS and SCAS.


svn path=/branches/ntvdm/; revision=61203
2013-12-03 00:12:55 +00:00
Aleksandar Andrejevic
03ecfdff3f [FAST486]
Fix MOVS and STOS when DF = 1. The starting position in the block was off by 1.


svn path=/branches/ntvdm/; revision=61163
2013-12-01 03:16:49 +00:00
Aleksandar Andrejevic
7393337fcf [FAST486]
Use the size of CS, and not SS, in Fast486OpcodePopReg.


svn path=/branches/ntvdm/; revision=61159
2013-11-30 23:14:54 +00:00
Aleksandar Andrejevic
81c27b5b19 [FAST486]
Start implementing the FPU. Stubplement the FPU opcode handlers.


svn path=/branches/ntvdm/; revision=61141
2013-11-29 03:00:59 +00:00
Aleksandar Andrejevic
8e356f7a95 [FAST486]
The 486 doesn't have AC, VIF, VIP or ID.
Fix and simplify POPF.
[NTVDM]
Fix the count in the XMS copy function (INT 15h, AH = 87h).


svn path=/branches/ntvdm/; revision=61082
2013-11-23 01:34:03 +00:00
Aleksandar Andrejevic
24954c9d07 [FAST486]
DAA, DAS: Update the flags.
AAA, AAS: Subtract from AX instead of AL. The specification says AL, but
so far in all known CPUs and emulators, AX is subtracted.
AAD: Clear AH.


svn path=/branches/ntvdm/; revision=61069
2013-11-22 02:02:05 +00:00
Aleksandar Andrejevic
363543b325 [FAST486]
Fix the calculation of AF in ADC and the calculation of AF and CF in SBB.


svn path=/branches/ntvdm/; revision=61068
2013-11-22 01:22:00 +00:00
Aleksandar Andrejevic
c0d571c92a [FAST486]
In the string functions, use ADSIZE and not OPSIZE.
In SCAS and CMPS, fix the "(1 << 32) - 1" bug.


svn path=/branches/ntvdm/; revision=61067
2013-11-22 00:46:28 +00:00
Aleksandar Andrejevic
9c999826e1 [FAST486]
Put the conditional expression in parenthesis so that the addition happens after it.


svn path=/branches/ntvdm/; revision=61063
2013-11-21 04:07:15 +00:00
Aleksandar Andrejevic
f90a1db2b7 [FAST486]
The top half of EIP is cleared after a 16-bit jump.


svn path=/branches/ntvdm/; revision=61058
2013-11-20 14:21:47 +00:00
Aleksandar Andrejevic
b456a8b355 [FAST486]
Make the parameters to Fast486ReadModrm*Operands optional, so that
unnecessary extra reads aren't performed. This also eliminates the
need for dummy variables.


svn path=/branches/ntvdm/; revision=61055
2013-11-20 08:01:10 +00:00
Aleksandar Andrejevic
5e54387a9c [FAST486]
Fix the previous fix. ESI was already updated earlier in the function.


svn path=/branches/ntvdm/; revision=60990
2013-11-14 03:11:33 +00:00
Aleksandar Andrejevic
14a31007fc [FAST486]
Fix previous fix.


svn path=/branches/ntvdm/; revision=60989
2013-11-14 03:03:23 +00:00
Aleksandar Andrejevic
9c66549845 [FAST486]
Update the register values in REP LODS.


svn path=/branches/ntvdm/; revision=60988
2013-11-14 02:54:20 +00:00
Aleksandar Andrejevic
53dfb7da48 [FAST486]
LOOP and JECXZ use the ADSIZE attribute, not OPSIZE.


svn path=/branches/ntvdm/; revision=60977
2013-11-13 19:20:04 +00:00
Aleksandar Andrejevic
0aed89f779 [FAST486]
Fix the 3-byte IMUL instruction. If the operand size is 16-bit, the
result should be written in 16-bit too.


svn path=/branches/ntvdm/; revision=60963
2013-11-12 18:21:30 +00:00
Aleksandar Andrejevic
e3c68b1796 [FAST486]
Fix a bug in the LDS and LES instructions.


svn path=/branches/ntvdm/; revision=60936
2013-11-11 03:16:07 +00:00
Aleksandar Andrejevic
9677ec13ad [FAST486]
Don't mix up ADSIZE and OPSIZE (continued).


svn path=/branches/ntvdm/; revision=60927
2013-11-10 23:42:57 +00:00
Aleksandar Andrejevic
a2f3c339f4 [FAST486]
Don't mix up ADSIZE and OPSIZE.


svn path=/branches/ntvdm/; revision=60926
2013-11-10 23:34:34 +00:00
Hermès Bélusca-Maïto
a106a3b21e [FAST486]: Code formatting only (remove endlines spaces).
svn path=/branches/ntvdm/; revision=60894
2013-11-09 14:23:40 +00:00
Hermès Bélusca-Maïto
aab2a03dc2 [FAST486]: Fix OUT instruction (IoWrite instead of IoRead).
svn path=/branches/ntvdm/; revision=60893
2013-11-09 14:15:39 +00:00
Aleksandar Andrejevic
43ee57f2f7 [FAST486][NTVDM]
The behavior of the I/O port bus depends on the data width. In the case
of 16-bit/32-bit access, two/four adjacent ports will be accessed.


svn path=/branches/ntvdm/; revision=60891
2013-11-09 03:30:27 +00:00
Hermès Bélusca-Maïto
92ce0174ac [FAST486]: Code formatting only.
svn path=/branches/ntvdm/; revision=60857
2013-11-03 23:13:53 +00:00
Hermès Bélusca-Maïto
3b6b1a7f37 [FAST486]: Replace (boolean_condition) ? TRUE : FALSE; by: (boolean_condition) .
svn path=/branches/ntvdm/; revision=60856
2013-11-03 22:44:55 +00:00
Aleksandar Andrejevic
13b771ac15 [FAST486]
Fix a bug in the IRET instruction.


svn path=/branches/ntvdm/; revision=60817
2013-11-01 02:08:34 +00:00
Hermès Bélusca-Maïto
861776bd7e [FAST486][NTVDM]
- Introduce a Fast486Initialize which is used to set up the CPU callbacks (and use default ones if some of the given callbacks are NULL), and to reset it the first time. Now Fast486Reset is meant to be used for only resetting the CPU to a safe state.
- Hence we are now sure that State->WhateverCallback is never NULL (and is theoretically valid), so don't do NULL-checks when calling them, but call them directly. The default cases for those checks become the default calls for the default callbacks.
- Remove the now-unneeded EmulatorIdle function.

svn path=/branches/ntvdm/; revision=60814
2013-11-01 01:46:58 +00:00
Hermès Bélusca-Maïto
39a527a21e [FAST486][NTVDM]
BOP numbers are 1 byte and map to a function (over 255). But one can pass additional "parameters" to those functions by adding extra bytes, however such functions must advance "by hand" the instruction pointer.

[NTVDM]
- Take into account our previous remark for the BIOS interrupt stubs, and comment them.
- Rework EmulatorBiosOperation (move almost all of its existing code into subfunctions in bop.c) so that one can call many other BOP functions in the future (WIP). The BOP number (still called) EMULATOR_INT_BOP (of value 0xFF) is used for internal 16 --> 32 bit switching for our 32bit bios.
- It appears that the IoRead/WriteCallback and IdleCallback must not be NULL for using fast486. I'm committing a temporary fix that I will definitely fix in a subsequent commit.

svn path=/branches/ntvdm/; revision=60812
2013-11-01 00:01:07 +00:00
Hermès Bélusca-Maïto
2c8e8ba5d3 [FAST486]
- Remove an unneeded inclusion to the CRT header: limits.h (and use instead NDK definitions for max/min long values).
- Remove unneeded comments...
[NTVDM]
Remove an unneeded add_dependencies(...) command.

svn path=/branches/ntvdm/; revision=60767
2013-10-27 11:42:44 +00:00
Aleksandar Andrejevic
f5d3c9254c [FAST486]
Separate external interrupts from interrupt signals (which are
interrupts whose number is not known until they can be serviced,
just like hardware interrupts on a real CPU).
[NTVDM]
Improve the PIC emulation code (IRQ priorities, etc...).
Instead of checking for interrupts in the main loop, move the
PS/2 input parsing to a different thread.
Improve BIOS keyboard IRQ handling.


svn path=/branches/ntvdm/; revision=60761
2013-10-27 00:37:01 +00:00
Aleksandar Andrejevic
67b093f38c [FAST486]
Create a macro SWAP (swaps two variables) to shorten the code.
Implement the BSWAP instruction.


svn path=/branches/ntvdm/; revision=60717
2013-10-20 00:55:31 +00:00
Aleksandar Andrejevic
1a968e6f61 [FAST486]
Fix more prefix handling.
Create the macros TOGGLE_ADSIZE and TOGGLE_OPSIZE to shorten the code.


svn path=/branches/ntvdm/; revision=60715
2013-10-19 23:43:53 +00:00
Aleksandar Andrejevic
97c51f53c4 [FAST486]
Fix prefix handling.
Create a macro NO_LOCK_PREFIX to shorten the code.


svn path=/branches/ntvdm/; revision=60714
2013-10-19 23:03:40 +00:00
Hermès Bélusca-Maïto
51040fc61e Bye bye Soft386, welcome Fast486, courtesy Aleksandar Andrejevic.
[NTVDM]: Define by default NEW_EMULATOR, i.e. use Fast486 instead of softx86.

svn path=/branches/ntvdm/; revision=60703
2013-10-19 16:55:51 +00:00
Renamed from lib/soft386/opcodes.c (Browse further)