Assorted 32-bit Fixes
The list of fixes in this release includes:
- Make 32-bit multiply results more x86-compatible when overflow occurs
- Use normal JavaScript multiplication when both multiplicands are <= 16 bits
- Be clearer about which exceptions are "traps" and which are "faults"
- Treat Divide Error (#DE) exceptions as "faults" (must point at the DIV instruction)
- Treat data breakpoint (#DB) exceptions as "traps" (generated after trapped instruction)
- Fix IDT vector 0 dispatching, which was misidentified as a cached segment probe
- Make CALLF restartable whenever pushing triggers a segment or page fault
- Fix V86-mode interrupt frames (frame size is always 32-bit)
Fix # 7 eliminated a common crash in the Windows 95 Explorer, where a CALLF instruction with the stack pointing at a not-present page might not be restartable.
Fix # 8 makes WDEB386 work more reliably, especially when stepping through V86-mode code. If you prefer to use WDEB386 instead of the built-in PCjs Debugger, press F8 immediately after starting the Windows 95 Test Machine, choose boot menu option 5, and then type "WDEB386 /C:2 /V C:\WINDOWS\WIN.COM".
COM2 I/O is connected the same <textarea> window that the PCjs Debugger uses; make sure that window has focus before pressing CTRL-C to wake WDEB386.
Work continues on 32-bit multiplication and division compatibility testing. I've created a simple DOS-compatible test suite named test386.com in the /tests/pc/80386 folder that runs through a series of arithmetic operations and dumps the results to COM2. Run the same tests on another machine, capture the output, and diff the results.
test386.com is built from test386.nasm by running make
in the /tests/pc/80386 folder; you must have make
and nasm
installed on your machine. Also, since OS X continues to ship with an ancient version of nasm
(v0.98.40), I've tried to make all my nasm source files compatible with that version.
test386.com can also be loaded as pseudo ROM image using the command-line version of PCjs. In the /modules/pcjs/bin folder, run:
node pcjs --cmd="load test386.json"
test386.json is a JSON-style machine definition file that loads test386.com as a ROM image; the test machine is also configured to connect COM2 I/O to the console, making it easy to view and capture the test's output.