VOGONS


Reply 20 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

The zip file I attached to a few posts back contains the assembly executed up to that point. Looking at the data read, which is supposed to be IO.SYS, I notice, when comparing it to the IO.SYS extracted using Winimage, that it's wrong. So the first sector (19) read is correct (It's the root directory), but the retrieval or calculation of the starting cluster/sector goes wrong? Anyone can see the bug? The root directory is read when Interrupt 13h is called with AX=0201h, at the first time. The first sector of IO.SYS is read to 0000:0700 (ES:BX).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 21 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

@SarahWalker: The log is already 3 posts back (The debuggerlog.zip file contains the log). I think that the problem lies in how IO.SYS is loaded: First sector 19 is read, which contains the FAT root directory. Next the first sector containing the contents of IO.SYS is looked up. I think that the calculation of the first sector goes wrong (wrong base?). I know it's somewhere between the first 0000:7D76 and the following address at 0000:7D74, where it's supposed to read the first sector of IO.SYS?

BTW, anyone has the disassembly of the boot sector of MS-DOS 3.3?

It calculated the first sector of IO.SYS to be at:

Head: 1, Track: 0, Sector: 16. Start sector: 33, Destination: ES:BX=0000:00000700

BTW does anyone have a disassembly of the boot sector, IO.SYS and MSDOS.SYS of MS-DOS 3.3? Just so that I can verify if the disassembly goes wrong (and know what it's doing)?

Or, when possible, a good freeware disassembler for a 8086, which can run on Windows 8.1 64-bit?

Edit: It seems the first 2 sectors of IO.SYS are read correctly. Next some strange data is read:

0:00:17:23.2.0000: Function 02 called.

0:00:17:23.6.0000: Read 9/9 sectors from drive 00, start 1. Requested: Head: 0, Track: 0, Sector: 2. Start sector: 1, Destination: ES:BX=0800:00000000

Anyone knows what's it's supposed to read here? The rest of IO.SYS (which shouldn't be there: it points to the start of the FAT, 9 sectors long)?

Or does anyone know a good emulator to compare my assembly output with? In which I can let the boot sector start and compare runtime disassembly with?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 22 of 87, by Jepael

User metadata
Rank Oldbie
Rank
Oldbie

Two first FAT table entries are reserved and not used as FAT entries. One of the reserved entries contains a "media descriptor byte" or something equivalent and this byte can be used to detect what kind/size flppy there is so it can set the correct parameters to BIOS and actually use the rest of the floppy. Without this the logical parameters of the media is not known (you could have a single-side 40-track floppy in a double-sided 80-track drive)

Reply 23 of 87, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

0000:7C9E (03)ADDB AL,BL
This disassembly is improper, based on the affected registers (->ADDB AX,BX).
The debugger log doesn't show the code getting anywhere near where you show the latest problem.
0000:7E48 (8B)MOVW AX,[DS:SI-17FFF]
This disassembly is improper, and the value that is fetched is wrong, too.
As a result, it all goes very wrong.

Reply 24 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++
peterferrie wrote:
0000:7C9E (03)ADDB AL,BL This disassembly is improper, based on the affected registers (->ADDB AX,BX). The debugger log doesn't […]
Show full quote

0000:7C9E (03)ADDB AL,BL
This disassembly is improper, based on the affected registers (->ADDB AX,BX).
The debugger log doesn't show the code getting anywhere near where you show the latest problem.
0000:7E48 (8B)MOVW AX,[DS:SI-17FFF]
This disassembly is improper, and the value that is fetched is wrong, too.
As a result, it all goes very wrong.

You're right. This is (luckily) simply a debugger disassembly done wrong (says ADDW instead of ADDB with 16-bit registers instead of 8-bit now). The instruction is executed as it's supposed now.

The strange value -17FFF was a signed display error: it was using the calculation

sprintf(result,"-%04X",0xFFFF-unsigned2signed16(displacement));

instead of

sprintf(result,"-%04X",0-unsigned2signed16(displacement));

, which caused the incorrect disassembly (only disassembly, the normal execution doesn't rely on the sprintf).

So -17FFF=0x8000(unsigned displacement value)=>0-0x8000=-8000, so it's

MOVW AX,[DS:SI-8000]

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 25 of 87, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

Technically, that should still be '+'. However, as I said, the value that is fetched is wrong.
The sequence should be something like 3, 0x40, 5, 0x60, 7, 0x80, etc, not 3, 0. It's a cluster number, so it can't be zero.

Reply 26 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

How do you mean '+'? The unsigned number 0x8000 equals -32768 when read as a signed value from memory (bit 15 equalling a value of -32768).
So the value is -32768 + value&0x7FFF = -32768 + 0 = -32768, converted to hex -8000. This value is added to the address offset computated, so SI + -8000 = SI-8000, it's substracting from SI, lowering it with 32768.

Here's the new log:

Filename
debuggerlog_20150311_0726.zip
File size
1.71 MiB
Downloads
62 downloads
File comment
Most recent debugger log
File license
Fair use/fair dealing exception

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 27 of 87, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

Okay, + or - isn't the point here. I'm just referring to Intel documentation.
However...

*The value that is being read is wrong*.
Look in your log for 0000:7e48. You'll find it multiple times, reading the value 0.
It can't be zero ever. It most certainly can't be zero multiple times.
Focus on that part.

Reply 28 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

This is the first time the read gives invalid information:

0:00:18:02.7.0000: ModR/M address: 0000:FFFF8000=FFFF8000

0:00:18:02.8.0000: 0000:7E48 (8B)MOVW AX,[DS:SI-8000]

0:00:18:02.8.0000: Registers:

0:00:18:02.8.0000: AX: 0000, BX: 0003, CX: 0005, DX: 0000

0:00:18:02.8.0000: CS: 0000, DS: 0000, ES: 0070, SS: 0000

0:00:18:02.8.0000: SP: 7BDE, BP: 7BE2, SI: 0000, DI: 0000

0:00:18:02.8.0000: IP: 7E48, FLAGS: 0246

0:00:18:02.9.0000: FLAGSINFO:c1P0a0ZstIdo0000

So the error is somewhere between this point and the previous point (which DO give results)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 30 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

The location of the previous error is now giving me:

0:00:16:55.3.0999: ModR/M address: 0000:8004=00008004

0:00:16:55.3.0999: 0000:7E48 (8B)MOVW AX,[DS:SI-8000]

0:00:16:55.3.0999: Registers:

0:00:16:55.3.0999: AX: 0004, BX: 0003, CX: 0005, DX: 0000

0:00:16:55.3.0999: CS: 0000, DS: 0000, ES: 0070, SS: 0000

0:00:16:55.3.0999: SP: 7BDE, BP: 7BE2, SI: 0004, DI: 0000

0:00:16:55.5.0000: IP: 7E48, FLAGS: 0203

0:00:16:55.5.0000: FLAGSINFO:C1p0a0zstIdo0000



0:00:16:55.6.0999: ModR/M address: 0000:7BF2=00007BF2

0:00:16:55.6.0999: 0000:7E4C (F7)TESTW [SS:BP+10],01

0:00:16:55.6.0999: Registers:

0:00:16:55.6.0999: AX: 0040, BX: 0003, CX: 0005, DX: 0000

0:00:16:55.6.0999: CS: 0000, DS: 0000, ES: 0070, SS: 0000

0:00:16:55.6.0999: SP: 7BDE, BP: 7BE2, SI: 0004, DI: 0000

0:00:16:55.8.0000: IP: 7E4C, FLAGS: 0203

0:00:16:55.8.0000: FLAGSINFO:C1p0a0zstIdo0000
Filename
debuggerlog_20150312_1922.zip
File size
673.33 KiB
Downloads
67 downloads
File comment
Debugger logs (Both CPU and INT 13h)
File license
Fair use/fair dealing exception

Edit: I'm getting this:

0:00:14:48.4.0000: 0000:7D23 (EA)JMP 0070:0000

0:00:14:48.4.0000: Registers:

0:00:14:48.4.0000: AX: 0001, BX: 0021, CX: F000, DX: 0100

0:00:14:48.4.0000: CS: 0000, DS: 0000, ES: 0000, SS: 0000

0:00:14:48.4.0000: SP: 7BF8, BP: 0000, SI: 7DF6, DI: 052B

0:00:14:48.4.0000: IP: 7D23, FLAGS: 0206

0:00:14:48.4.0000: FLAGSINFO:c1P0a0zstIdo0000



0:00:14:48.7.0000: 0070:0000 (FA)CLI

0:00:14:48.7.0000: Registers:

0:00:14:48.7.0000: AX: 0001, BX: 0021, CX: F000, DX: 0100

0:00:14:48.7.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:48.7.0000: SP: 7BF8, BP: 0000, SI: 7DF6, DI: 052B

0:00:14:48.7.0000: IP: 0000, FLAGS: 0206

0:00:14:48.8.0000: FLAGSINFO:c1P0a0zstIdo0000



0:00:14:49.0.0000: 0070:0001 (33)XORW AX,AX

0:00:14:49.0.0000: Registers:

0:00:14:49.0.0000: AX: 0001, BX: 0021, CX: F000, DX: 0100

0:00:14:49.0.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:49.0.0000: SP: 7BF8, BP: 0000, SI: 7DF6, DI: 052B

0:00:14:49.0.0000: IP: 0001, FLAGS: 0006

0:00:14:49.1.0000: FLAGSINFO:c1P0a0zstido0000



0:00:14:49.3.0000: 0070:0003 (8E)MOVW SS,AX

0:00:14:49.3.0000: Registers:

0:00:14:49.3.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:49.3.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:49.3.0000: SP: 7BF8, BP: 0000, SI: 7DF6, DI: 052B

0:00:14:49.3.0000: IP: 0003, FLAGS: 0046

Show last 651 lines
0:00:14:49.4.0000: FLAGSINFO:c1P0a0Zstido0000



0:00:14:49.6.0000: 0070:0005 (BC)MOVW SP, 7BE2

0:00:14:49.6.0000: Registers:

0:00:14:49.6.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:49.6.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:49.6.0000: SP: 7BF8, BP: 0000, SI: 7DF6, DI: 052B

0:00:14:49.7.0000: IP: 0005, FLAGS: 0046

0:00:14:49.7.0000: FLAGSINFO:c1P0a0Zstido0000



0:00:14:49.9.0000: 0070:0008 (BD)MOVW BP, 7BE2

0:00:14:49.9.0000: Registers:

0:00:14:49.9.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:49.9.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:49.9.0000: SP: 7BE2, BP: 0000, SI: 7DF6, DI: 052B

0:00:14:49.9.0000: IP: 0008, FLAGS: 0046

0:00:14:50.0.0000: FLAGSINFO:c1P0a0Zstido0000



0:00:14:50.2.0000: 0070:000B (FB)STI

0:00:14:50.2.0000: Registers:

0:00:14:50.2.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:50.2.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:50.2.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:50.2.0000: IP: 000B, FLAGS: 0046

0:00:14:50.2.0000: FLAGSINFO:c1P0a0Zstido0000



0:00:14:50.5.0000: ModR/M address: 0000:7BF6=00007BF6

0:00:14:51.2.0000: 0070:000C (89)MOVW [SS:BP+14],BX

0:00:14:51.2.0000: Registers:

0:00:14:51.2.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:51.2.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:51.2.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:51.3.0000: IP: 000C, FLAGS: 0246

0:00:14:51.3.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:51.5.0000: ModR/M address: 0000:7BFC=00007BFC

0:00:14:51.5.0000: 0070:000F (88)MOVB [SS:BP+1A],CH

0:00:14:51.5.0000: Registers:

0:00:14:51.5.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:51.5.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:51.5.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:51.6.0000: IP: 000F, FLAGS: 0246

0:00:14:51.6.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:51.8.0000: ModR/M address: 0000:7BFA=00007BFA

0:00:14:52.1.0000: 0070:0012 (88)MOVB [SS:BP+18],DL

0:00:14:52.1.0000: Registers:

0:00:14:52.1.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:52.1.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:52.2.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:52.2.0000: IP: 0012, FLAGS: 0246

0:00:14:52.2.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:52.4.0000: 0070:0015 (33)XORW AX,AX

0:00:14:52.4.0000: Registers:

0:00:14:52.4.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:52.4.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:52.4.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:52.5.0000: IP: 0015, FLAGS: 0246

0:00:14:52.5.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:52.7.0000: 0070:0017 (8E)MOVW DS,AX

0:00:14:52.7.0000: Registers:

0:00:14:52.7.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:52.7.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:52.7.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:52.7.0000: IP: 0017, FLAGS: 0246

0:00:14:52.8.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:53.0.0000: 0070:0019 (A1)MOVW AX,[DS:7C18]

0:00:14:53.0.0000: Registers:

0:00:14:53.0.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:53.0.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:53.0.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:53.0.0000: IP: 0019, FLAGS: 0246

0:00:14:53.1.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:53.3.0000: ModR/M address: 0000:7BF8=00007BF8

0:00:14:53.3.0000: 0070:001C (89)MOVW [SS:BP+16],AX

0:00:14:53.3.0000: Registers:

0:00:14:53.3.0000: AX: 0012, BX: 0021, CX: F000, DX: 0100

0:00:14:53.3.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:53.4.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:53.4.0000: IP: 001C, FLAGS: 0246

0:00:14:53.4.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:53.6.0000: 0070:001F (A1)MOVW AX,[DS:7C1A]

0:00:14:53.6.0000: Registers:

0:00:14:53.6.0000: AX: 0012, BX: 0021, CX: F000, DX: 0100

0:00:14:53.6.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:53.6.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:53.7.0000: IP: 001F, FLAGS: 0246

0:00:14:53.7.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:53.9.0000: ModR/M address: 0000:7BE2=00007BE2

0:00:14:53.9.0000: 0070:0022 (89)MOVW [SS:BP+00],AX

0:00:14:53.9.0000: Registers:

0:00:14:53.9.0000: AX: 0002, BX: 0021, CX: F000, DX: 0100

0:00:14:53.9.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:53.9.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:54.0.0000: IP: 0022, FLAGS: 0246

0:00:14:54.0.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:54.2.0000: 0070:0025 (A1)MOVW AX,[DS:7C16]

0:00:14:54.2.0000: Registers:

0:00:14:54.2.0000: AX: 0002, BX: 0021, CX: F000, DX: 0100

0:00:14:54.2.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:54.2.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:54.3.0000: IP: 0025, FLAGS: 0246

0:00:14:54.3.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:54.5.0000: ModR/M address: 0000:7BEA=00007BEA

0:00:14:54.5.0000: 0070:0028 (89)MOVW [SS:BP+08],AX

0:00:14:54.5.0000: Registers:

0:00:14:54.5.0000: AX: 0009, BX: 0021, CX: F000, DX: 0100

0:00:14:54.5.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:54.5.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:54.6.0000: IP: 0028, FLAGS: 0246

0:00:14:54.6.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:54.8.0000: 0070:002B (A1)MOVW AX,[DS:7C1C]

0:00:14:54.8.0000: Registers:

0:00:14:54.8.0000: AX: 0009, BX: 0021, CX: F000, DX: 0100

0:00:14:54.8.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:54.8.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:54.8.0000: IP: 002B, FLAGS: 0246

0:00:14:54.9.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:55.1.0000: ModR/M address: 0000:7BEC=00007BEC

0:00:14:55.1.0000: 0070:002E (89)MOVW [SS:BP+0A],AX

0:00:14:55.1.0000: Registers:

0:00:14:55.1.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:55.1.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:55.1.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:55.2.0000: IP: 002E, FLAGS: 0246

0:00:14:55.2.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:55.4.0000: 0070:0031 (A1)MOVW AX,[DS:7C0E]

0:00:14:55.4.0000: Registers:

0:00:14:55.4.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:55.4.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:55.4.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:55.5.0000: IP: 0031, FLAGS: 0246

0:00:14:55.5.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:55.8.0000: ModR/M address: 0000:7BF0=00007BF0

0:00:14:55.8.0000: 0070:0034 (89)MOVW [SS:BP+0E],AX

0:00:14:55.8.0000: Registers:

0:00:14:55.8.0000: AX: 0001, BX: 0021, CX: F000, DX: 0100

0:00:14:55.8.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:55.8.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:55.9.0000: IP: 0034, FLAGS: 0246

0:00:14:55.9.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:56.1.0000: 0070:0037 (A1)MOVW AX,[DS:7C0B]

0:00:14:56.1.0000: Registers:

0:00:14:56.1.0000: AX: 0001, BX: 0021, CX: F000, DX: 0100

0:00:14:56.1.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:56.1.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:56.1.0000: IP: 0037, FLAGS: 0246

0:00:14:56.2.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:56.4.0000: ModR/M address: 0000:7BEE=00007BEE

0:00:14:56.4.0000: 0070:003A (89)MOVW [SS:BP+0C],AX

0:00:14:56.4.0000: Registers:

0:00:14:56.4.0000: AX: 0200, BX: 0021, CX: F000, DX: 0100

0:00:14:56.4.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:56.4.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:56.5.0000: IP: 003A, FLAGS: 0246

0:00:14:56.5.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:56.7.0000: 0070:003D (33)XORW AX,AX

0:00:14:56.7.0000: Registers:

0:00:14:56.7.0000: AX: 0200, BX: 0021, CX: F000, DX: 0100

0:00:14:56.7.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:56.7.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:56.7.0000: IP: 003D, FLAGS: 0246

0:00:14:56.8.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:57.0.0000: 0070:003F (8E)MOVW DS,AX

0:00:14:57.0.0000: Registers:

0:00:14:57.0.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:57.0.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:57.0.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:57.0.0000: IP: 003F, FLAGS: 0246

0:00:14:57.1.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:57.3.0000: 0070:0041 (A1)MOVW AX,[DS:7C0B]

0:00:14:57.3.0000: Registers:

0:00:14:57.3.0000: AX: 0000, BX: 0021, CX: F000, DX: 0100

0:00:14:57.3.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:57.3.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:57.3.0000: IP: 0041, FLAGS: 0246

0:00:14:57.4.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:57.6.0000: 0070:0044 (33)XORW BX,BX

0:00:14:57.6.0000: Registers:

0:00:14:57.6.0000: AX: 0200, BX: 0021, CX: F000, DX: 0100

0:00:14:57.6.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:57.6.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:57.6.0000: IP: 0044, FLAGS: 0246

0:00:14:57.7.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:57.9.0000: ModR/M address: 0000:7C0D=00007C0D

0:00:14:57.9.0000: 0070:0046 (8A)MOVB BL,[DS:7C0D]

0:00:14:57.9.0000: Registers:

0:00:14:57.9.0000: AX: 0200, BX: 0000, CX: F000, DX: 0100

0:00:14:57.9.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:57.9.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:58.0.0000: IP: 0046, FLAGS: 0246

0:00:14:58.0.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:58.2.0000: 0070:004A (F7)MULW BX

0:00:14:58.2.0000: Registers:

0:00:14:58.2.0000: AX: 0200, BX: 0001, CX: F000, DX: 0100

0:00:14:58.2.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:58.2.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:58.2.0000: IP: 004A, FLAGS: 0246

0:00:14:58.3.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:00:14:58.5.0000: ModR/M address: 0000:7BE4=00007BE4

0:00:14:58.5.0000: 0070:004C (89)MOVW [SS:BP+02],AX

0:00:14:58.5.0000: Registers:

0:00:14:58.5.0000: AX: 0200, BX: 0001, CX: F000, DX: 0000

0:00:14:58.5.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:58.5.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:58.6.0000: IP: 004C, FLAGS: 0206

0:00:14:58.6.0000: FLAGSINFO:c1P0a0zstIdo0000



0:00:14:58.8.0000: ModR/M address: 0000:7BFB=00007BFB

0:00:14:58.8.0000: 0070:004F (C6)MOVB [SS:BP+19],01

0:00:14:58.8.0000: Registers:

0:00:14:58.8.0000: AX: 0200, BX: 0001, CX: F000, DX: 0000

0:00:14:58.8.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:58.8.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:58.9.0000: IP: 004F, FLAGS: 0206

0:00:14:58.9.0000: FLAGSINFO:c1P0a0zstIdo0000



0:00:14:59.1.0000: ModR/M address: 0000:7BFC=00007BFC

0:00:14:59.1.0000: 0070:0053 (80)CMPB [SS:BP+1A],F8

0:00:14:59.1.0000: Registers:

0:00:14:59.1.0000: AX: 0200, BX: 0001, CX: F000, DX: 0000

0:00:14:59.1.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:59.1.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:59.2.0000: IP: 0053, FLAGS: 0206

0:00:14:59.2.0000: FLAGSINFO:c1P0a0zstIdo0000



0:00:14:59.4.0000: 0070:0057 (75)JNZ 0082

0:00:14:59.4.0000: Registers:

0:00:14:59.4.0000: AX: 0200, BX: 0001, CX: F000, DX: 0000

0:00:14:59.5.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:59.5.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:59.5.0000: IP: 0057, FLAGS: 0293

0:00:14:59.5.0000: FLAGSINFO:C1p0A0zStIdo0000



0:00:14:59.7.0000: 0070:0082 (0E)PUSH CS

0:00:14:59.7.0000: Registers:

0:00:14:59.7.0000: AX: 0200, BX: 0001, CX: F000, DX: 0000

0:00:14:59.7.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:59.7.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:59.7.0000: IP: 0082, FLAGS: 0293

0:00:14:59.7.0000: FLAGSINFO:C1p0A0zStIdo0000



0:00:14:60.0.0000: 0070:0083 (1F)POP DS

0:00:14:60.0.0000: Registers:

0:00:14:60.0.0000: AX: 0200, BX: 0001, CX: F000, DX: 0000

0:00:14:60.0.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:00:14:60.0.0000: SP: 7BE0, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:60.1.0000: IP: 0083, FLAGS: 0293

0:00:14:60.1.0000: FLAGSINFO:C1p0A0zStIdo0000



0:00:14:60.3.0000: 0070:0084 (33)XORW AX,AX

0:00:14:60.3.0000: Registers:

0:00:14:60.3.0000: AX: 0200, BX: 0001, CX: F000, DX: 0000

0:00:14:60.3.0000: CS: 0070, DS: 0070, ES: 0000, SS: 0000

0:00:14:60.3.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:60.3.0000: IP: 0084, FLAGS: 0293

0:00:14:60.3.0000: FLAGSINFO:C1p0A0zStIdo0000



0:00:14:60.6.0000: 0070:0086 (8E)MOVW ES,AX

0:00:14:60.6.0000: Registers:

0:00:14:60.6.0000: AX: 0000, BX: 0001, CX: F000, DX: 0000

0:00:14:60.6.0000: CS: 0070, DS: 0070, ES: 0000, SS: 0000

0:00:14:60.6.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:60.6.0000: IP: 0086, FLAGS: 0256

0:00:14:60.7.0000: FLAGSINFO:c1P0A0ZstIdo0000



0:00:14:60.9.0000: 0070:0088 (BE)MOVW SI, 0099

0:00:14:60.9.0000: Registers:

0:00:14:60.9.0000: AX: 0000, BX: 0001, CX: F000, DX: 0000

0:00:14:60.9.0000: CS: 0070, DS: 0070, ES: 0000, SS: 0000

0:00:14:60.9.0000: SP: 7BE2, BP: 7BE2, SI: 7DF6, DI: 052B

0:00:14:60.9.0000: IP: 0088, FLAGS: 0256

0:00:14:61.0.0000: FLAGSINFO:c1P0A0ZstIdo0000



0:00:14:61.2.0000: 0070:008B (BF)MOVW DI, 7D00

0:00:14:61.2.0000: Registers:

0:00:14:61.2.0000: AX: 0000, BX: 0001, CX: F000, DX: 0000

0:00:14:61.2.0000: CS: 0070, DS: 0070, ES: 0000, SS: 0000

0:00:14:61.2.0000: SP: 7BE2, BP: 7BE2, SI: 0099, DI: 052B

0:00:14:61.2.0000: IP: 008B, FLAGS: 0256

0:00:14:61.2.0000: FLAGSINFO:c1P0A0ZstIdo0000



0:00:14:61.5.0000: 0070:008E (B9)MOVW CX, 0175

0:00:14:61.5.0000: Registers:

0:00:14:61.5.0000: AX: 0000, BX: 0001, CX: F000, DX: 0000

0:00:14:61.5.0000: CS: 0070, DS: 0070, ES: 0000, SS: 0000

0:00:14:61.5.0000: SP: 7BE2, BP: 7BE2, SI: 0099, DI: 7D00

0:00:14:61.5.0000: IP: 008E, FLAGS: 0256

0:00:14:61.5.0000: FLAGSINFO:c1P0A0ZstIdo0000



0:00:14:61.8.0000: 0070:0091 (90)NOP

0:00:14:61.8.0000: Registers:

0:00:14:61.8.0000: AX: 0000, BX: 0001, CX: 0175, DX: 0000

0:00:14:61.8.0000: CS: 0070, DS: 0070, ES: 0000, SS: 0000

0:00:14:61.8.0000: SP: 7BE2, BP: 7BE2, SI: 0099, DI: 7D00

0:00:14:61.8.0000: IP: 0091, FLAGS: 0256

0:00:14:61.8.0000: FLAGSINFO:c1P0A0ZstIdo0000



0:00:14:62.1.0000: 0070:0092 (A4)REP MOVSB

0:00:14:62.1.0000: Registers:

0:00:14:62.1.0000: AX: 0000, BX: 0001, CX: 0175, DX: 0000

0:00:14:62.1.0000: CS: 0070, DS: 0070, ES: 0000, SS: 0000

0:00:14:62.1.0000: SP: 7BE2, BP: 7BE2, SI: 0099, DI: 7D00

0:00:14:62.1.0000: IP: 0092, FLAGS: 0256

0:00:14:62.1.0000: FLAGSINFO:c1P0A0ZstIdo0000

I guess this means IO.SYS is loaded correctly this time (at 0070:0000)?

But, looking at my int13.log, it seems it keeps loading blocks at the same location (ES:BX 0070:0000) after sector 33 (which is the first sector of IO.SYS)?

Looking at the contents loaded, up to sector 83, it's the rest of IO.SYS (sector 83 contains the last part of IO.SYS). But why does it keep loading parts of itself at 0070:0000 (ES:BX)?

It maybe an error in opcode 01? The data at the address isn't being increased:

0:00:16:23.1.0000: ModR/M address: 0000:7BF4=00007BF4

0:00:16:23.1.0000: 0000:7D5C (01)ADDW [SS:BP+12],AX

0:00:16:23.1.0000: Registers:

0:00:16:23.1.0000: AX: 0200, BX: 0000, CX: 0005, DX: 0000

0:00:16:23.1.0000: CS: 0000, DS: 0000, ES: 0070, SS: 0000

0:00:16:23.1.0000: SP: 7BE0, BP: 7BE2, SI: 0001, DI: 0000

0:00:16:23.2.0000: IP: 7D5C, FLAGS: 0206

0:00:16:23.2.0000: FLAGSINFO:c1P0a0zstIdo0000

Edit: I've found out that all 16-bit moves from register to memory (which uses my self-written procedure) used a 8-bit write to MODR/M instead of 16-bit. This caused only the low byte (which is always 0) to be written as 0, thus having no effect on increasing the location for the next cluster.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 31 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

I'm now getting a:

NEC IO.SYS for MS-DOS(R)  Version 3.30
Copyright (C) 1988 NEC Corporation
Copyright (C) 1981-1987 Microsoft Corporation

This text is blinking.

Then it's doing nothing anymore (no disk I/O).

Looking at the disassembly log:

0:02:10:06.6.0000: 0070:4125 (B9)MOVW CX, 4000

0:02:10:06.6.0000: Registers:

0:02:10:06.6.0000: AX: 0200, BX: 078C, CX: 0000, DX: 0000

0:02:10:06.6.0000: CS: 0070, DS: 0690, ES: 0070, SS: 0000

0:02:10:06.6.0000: SP: 06F4, BP: 0001, SI: 0070, DI: 052D

0:02:10:06.6.0000: IP: 4125, FLAGS: 0203

0:02:10:06.7.0000: FLAGSINFO:C1p0a0zstIdo0000



0:02:10:06.8.0999: 0070:4128 (E2)LOOP 4128

0:02:10:06.8.0999: Registers:

0:02:10:06.8.0999: AX: 0200, BX: 078C, CX: 4000, DX: 0000

0:02:10:06.8.0999: CS: 0070, DS: 0690, ES: 0070, SS: 0000

0:02:10:06.8.0999: SP: 06F4, BP: 0001, SI: 0070, DI: 052D

0:02:10:07.0.0000: IP: 4128, FLAGS: 0203

0:02:10:07.0.0000: FLAGSINFO:C1p0a0zstIdo0000

So this keeps looping until CX=0.

Finally it gets to ADDB.

0:03:02:30.5.0000: 0070:36D5 (B2)MOVB DL, 80

0:03:02:30.5.0000: Registers:

0:03:02:30.5.0000: AX: 0004, BX: 078C, CX: 0000, DX: 048D

0:03:02:30.5.0000: CS: 0070, DS: 0690, ES: 0070, SS: 0000

0:03:02:30.5.0000: SP: 0700, BP: 7BE2, SI: 1E80, DI: 1E7C

0:03:02:30.6.0000: IP: 36D5, FLAGS: 0206

0:03:02:30.6.0000: FLAGSINFO:c1P0a0zstIdo0000



0:03:02:30.8.0000: 0070:36D7 (B4)MOVB AH, 08

0:03:02:30.8.0000: Registers:

0:03:02:30.8.0000: AX: 0004, BX: 078C, CX: 0000, DX: 0480

0:03:02:30.8.0000: CS: 0070, DS: 0690, ES: 0070, SS: 0000

0:03:02:30.8.0000: SP: 0700, BP: 7BE2, SI: 1E80, DI: 1E7C

0:03:02:30.9.0000: IP: 36D7, FLAGS: 0206

0:03:02:30.9.0000: FLAGSINFO:c1P0a0zstIdo0000



0:03:02:31.1.0000: 0070:36D9 (CD)INT 13

0:03:02:31.1.0000: Registers:

0:03:02:31.1.0000: AX: 0804, BX: 078C, CX: 0000, DX: 0480

0:03:02:31.1.0000: CS: 0070, DS: 0690, ES: 0070, SS: 0000

0:03:02:31.1.0000: SP: 0700, BP: 7BE2, SI: 1E80, DI: 1E7C

0:03:02:31.2.0000: IP: 36D9, FLAGS: 0206

0:03:02:31.2.0000: FLAGSINFO:c1P0a0zstIdo0000

After this it just gets:

0:03:02:31.4.0000: ModR/M address: 0690:260C=00008F0C

0:03:02:31.4.0000: F000:0FB5 (00)ADDB [DS:BX+SI],AL

0:03:02:31.4.0000: Registers:

0:03:02:31.4.0000: AX: 0804, BX: 078C, CX: 0000, DX: 0480

0:03:02:31.4.0000: CS: F000, DS: 0690, ES: 0070, SS: 0000

0:03:02:31.4.0000: SP: 06FA, BP: 7BE2, SI: 1E80, DI: 1E7C

0:03:02:31.5.0000: IP: 0FB5, FLAGS: 0006

0:03:02:31.5.0000: FLAGSINFO:c1P0a0zstido0000

So there's just 0 bytes I think.

Attachments

  • Filename
    debuggerlog_20150312_2038.zip
    File size
    1.58 MiB
    Downloads
    63 downloads
    File comment
    Debugger disassembly log and INT 13h log
    File license
    Fair use/fair dealing exception

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 32 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

I think I've found the problem:

0:02:04:79.5.0000: ModR/M address: 0000:004C=0000004C

0:02:04:79.5.0000: 0070:34E3 (C7064C00B50F)MOVW [DS:004C],0fb5

0:02:04:79.5.0000: Registers:

0:02:04:79.5.0000: AX: F000, BX: 0021, CX: F000, DX: 0000

0:02:04:79.5.0000: CS: 0070, DS: 0000, ES: 0070, SS: 0000

0:02:04:79.5.0000: SP: 7BE0, BP: 7BE2, SI: 74E2, DI: 72D4

0:02:04:79.6.0000: IP: 34E3, FLAGS: 0056

0:02:04:79.6.0000: FLAGSINFO:c1P0A0Zstido0000

This overwrites my BIOS INT13 handler's offset with something of MS-DOS? Is this instruction supposed to happen? Is the segment supposed to be adjusted too? Or is this a decoding error?

I've also adjusted the debugger and MMU to generate a full log of the read opcode data. (instead of just giving the execution byte of the opcode, it now gives the entire instruction that was decoded by the CPU, for finding errors in CPU decoding or simply for completeness of the debugger (like Turbo Debugger used to do))

Filename
debugger_20150313_0917.zip
File size
2.27 MiB
Downloads
63 downloads
File comment
Debugger log.
File license
Fair use/fair dealing exception

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 33 of 87, by SarahWalker

User metadata
Rank Member
Rank
Member

The instruction immediately following is interpreted wrong :

0:02:04:79.5.0000: ModR/M address: 0000:004C=0000004C
0:02:04:79.5.0000: 0070:34E3 (C7064C00B50F)MOVW [DS:004C],0fb5
0:02:04:79.5.0000: Registers:
0:02:04:79.5.0000: AX: F000, BX: 0021, CX: F000, DX: 0000
0:02:04:79.5.0000: CS: 0070, DS: 0000, ES: 0070, SS: 0000
0:02:04:79.5.0000: SP: 7BE0, BP: 7BE2, SI: 74E2, DI: 72D4
0:02:04:79.6.0000: IP: 34E3, FLAGS: 0056
0:02:04:79.6.0000: FLAGSINFO:c1P0A0Zstido0000

0:02:04:79.8.0000: 0070:34E9 (8C0E)MOVW SI,CS
0:02:04:79.8.0000: Registers:
0:02:04:79.8.0000: AX: F000, BX: 0021, CX: F000, DX: 0000
0:02:04:79.8.0000: CS: 0070, DS: 0000, ES: 0070, SS: 0000
0:02:04:79.8.0000: SP: 7BE0, BP: 7BE2, SI: 74E2, DI: 72D4
0:02:04:79.8.0000: IP: 34E9, FLAGS: 0056
0:02:04:79.9.0000: FLAGSINFO:c1P0A0Zstido0000

8C0E4E00 is MOV [DS:004E], CS

Reply 34 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

Fixed that little bug. It now gives a MOV [DS:004E],CS instruction (there were some errors in ModR/M decoding).

Now, according to my INT13 log, it seems to be getting into an infinite loop:

0:06:12:63.0.0000: Function 02 called.

0:06:12:63.0.0000: Read 1/1 sectors from drive 00, start 34. Requested: Head: 1, Track: 0, Sector: 17. Start sector: 34, Destination: ES:BX=0690:00004000

0:06:14:08.2.0000: Function 02 called.

0:06:14:08.2.0000: Read 1/1 sectors from drive 00, start 734. Requested: Head: 0, Track: 20, Sector: 15. Start sector: 734, Destination: ES:BX=0690:00004600

0:06:15:01.7.0000: Function 02 called.

0:06:15:01.7.0000: Read 1/1 sectors from drive 00, start 1278. Requested: Head: 1, Track: 35, Sector: 1. Start sector: 1278, Destination: ES:BX=0690:00004800

0:06:15:82.1.0000: Function 02 called.

0:06:15:82.1.0000: Read 1/1 sectors from drive 00, start 1720. Requested: Head: 1, Track: 47, Sector: 11. Start sector: 1720, Destination: ES:BX=0690:00004A00

0:06:16:82.6.0000: Function 02 called.

0:06:16:82.6.0000: Read 1/1 sectors from drive 00, start 1781. Requested: Head: 0, Track: 49, Sector: 18. Start sector: 1781, Destination: ES:BX=0690:00004C00

This keeps repeating (infinitely?) on and on with increasing BX values (start location increased every sector read).

Filename
debuggerlog_20150313_1011.zip
File size
4.62 MiB
Downloads
63 downloads
File comment
Debugger log with opcode 8C bugfix.
File license
Fair use/fair dealing exception

Is it expecting something after this location:

0:03:14:06.7.0000: 0070:0F57 (CD13)INT 13

0:03:14:06.7.0000: Registers:

0:03:14:06.7.0000: AX: 0201, BX: 1C00, CX: 3112, DX: 0000

0:03:14:06.7.0000: CS: 0070, DS: 0070, ES: 0690, SS: 0000

0:03:14:06.7.0000: SP: 06EA, BP: 0005, SI: 0522, DI: 0482

0:03:14:06.8.0000: IP: 0F57, FLAGS: 0046

0:03:14:06.8.0000: FLAGSINFO:c1P0a0Zstido0000

Is this my error?

0:03:14:07.0.0000: 0070:0FB5 (2EA3C000)MOVW [CS:00C0],AX

0:03:14:07.0.0000: Registers:

0:03:14:07.0.0000: AX: 0201, BX: 1C00, CX: 3112, DX: 0000

0:03:14:07.0.0000: CS: 0070, DS: 0070, ES: 0690, SS: 0000

0:03:14:07.0.0000: SP: 06E4, BP: 0005, SI: 0522, DI: 0482

0:03:14:07.1.0000: IP: 0FB5, FLAGS: 0046

0:03:14:07.1.0000: FLAGSINFO:c1P0a0Zstido0000



0:03:14:07.3.0000: 0070:0FB9 (9C)PUSHF

0:03:14:07.3.0000: Registers:

0:03:14:07.3.0000: AX: 0201, BX: 1C00, CX: 3112, DX: 0000

0:03:14:07.3.0000: CS: 0070, DS: 0070, ES: 0690, SS: 0000

0:03:14:07.3.0000: SP: 06E4, BP: 0005, SI: 0522, DI: 0482

0:03:14:07.3.0000: IP: 0FB9, FLAGS: 0046

0:03:14:07.4.0000: FLAGSINFO:c1P0a0Zstido0000



0:03:14:07.6.0000: 0070:0FBA (80FC05)CMPB AH,05

0:03:14:07.6.0000: Registers:

0:03:14:07.6.0000: AX: 0201, BX: 1C00, CX: 3112, DX: 0000

0:03:14:07.6.0000: CS: 0070, DS: 0070, ES: 0690, SS: 0000

0:03:14:07.6.0000: SP: 06E2, BP: 0005, SI: 0522, DI: 0482

0:03:14:07.7.0000: IP: 0FBA, FLAGS: 0046

0:03:14:07.7.0000: FLAGSINFO:c1P0a0Zstido0000



0:03:14:07.9.0000: 0070:0FBD (750A)JNZ 0FC9

0:03:14:07.9.0000: Registers:

0:03:14:07.9.0000: AX: 0201, BX: 1C00, CX: 3112, DX: 0000

0:03:14:07.9.0000: CS: 0070, DS: 0070, ES: 0690, SS: 0000

0:03:14:07.9.0000: SP: 06E2, BP: 0005, SI: 0522, DI: 0482

0:03:14:08.0.0000: IP: 0FBD, FLAGS: 0093

Show last 117 lines
0:03:14:08.0.0000: FLAGSINFO:C1p0A0zStido0000



0:03:14:08.2.0000: 0070:0FC9 (80FC08)CMPB AH,08

0:03:14:08.2.0000: Registers:

0:03:14:08.2.0000: AX: 0201, BX: 1C00, CX: 3112, DX: 0000

0:03:14:08.2.0000: CS: 0070, DS: 0070, ES: 0690, SS: 0000

0:03:14:08.3.0000: SP: 06E2, BP: 0005, SI: 0522, DI: 0482

0:03:14:08.3.0000: IP: 0FC9, FLAGS: 0093

0:03:14:08.3.0000: FLAGSINFO:C1p0A0zStido0000



0:03:14:08.5.0000: 0070:0FCC (7412)JZ 0FE0

0:03:14:08.5.0000: Registers:

0:03:14:08.5.0000: AX: 0201, BX: 1C00, CX: 3112, DX: 0000

0:03:14:08.5.0000: CS: 0070, DS: 0070, ES: 0690, SS: 0000

0:03:14:08.5.0000: SP: 06E2, BP: 0005, SI: 0522, DI: 0482

0:03:14:08.5.0000: IP: 0FCC, FLAGS: 0097

0:03:14:08.6.0000: FLAGSINFO:C1P0A0zStido0000



0:03:14:08.8.0000: 0070:0FCE (80FC15)CMPB AH,15

0:03:14:08.8.0000: Registers:

0:03:14:08.8.0000: AX: 0201, BX: 1C00, CX: 3112, DX: 0000

0:03:14:08.8.0000: CS: 0070, DS: 0070, ES: 0690, SS: 0000

0:03:14:08.8.0000: SP: 06E2, BP: 0005, SI: 0522, DI: 0482

0:03:14:08.8.0000: IP: 0FCE, FLAGS: 0097

0:03:14:08.9.0000: FLAGSINFO:C1P0A0zStido0000



0:03:14:09.1.0000: 0070:0FD1 (740D)JZ 0FE0

0:03:14:09.1.0000: Registers:

0:03:14:09.1.0000: AX: 0201, BX: 1C00, CX: 3112, DX: 0000

0:03:14:09.1.0000: CS: 0070, DS: 0070, ES: 0690, SS: 0000

0:03:14:09.1.0000: SP: 06E2, BP: 0005, SI: 0522, DI: 0482

0:03:14:09.1.0000: IP: 0FD1, FLAGS: 0097

0:03:14:09.2.0000: FLAGSINFO:C1P0A0zStido0000



0:03:14:09.4.0000: ModR/M address: 0070:00B4=000007B4

0:03:14:09.4.0000: 0070:0FD3 (2EFF1EB400)CALL [CS:00B4]

0:03:14:09.4.0000: Registers:

0:03:14:09.4.0000: AX: 0201, BX: 1C00, CX: 3112, DX: 0000

0:03:14:09.4.0000: CS: 0070, DS: 0070, ES: 0690, SS: 0000

0:03:14:09.4.0000: SP: 06E2, BP: 0005, SI: 0522, DI: 0482

0:03:14:09.5.0000: IP: 0FD3, FLAGS: 0097

0:03:14:09.5.0000: FLAGSINFO:C1P0A0zStido0000



0:03:14:09.7.0000: ModR/M address: 0070:2122=00002822

0:03:14:09.7.0000: F000:00E0 (FE380700)<INTERNAL CALLBACK> 0007

0:03:14:09.7.0000: Registers:

0:03:14:09.7.0000: AX: 0201, BX: 1C00, CX: 3112, DX: 0000

0:03:14:09.7.0000: CS: F000, DS: 0070, ES: 0690, SS: 0000

0:03:14:09.8.0000: SP: 06DE, BP: 0005, SI: 0522, DI: 0482

0:03:14:09.8.0000: IP: 00E0, FLAGS: 0097

0:03:14:09.8.0000: FLAGSINFO:C1P0A0zStido0000



0:03:14:10.0.0000: F000:00E4 (CF)IRET

0:03:14:10.0.0000: Registers:

0:03:14:10.1.0000: AX: 0001, BX: 1C00, CX: 3112, DX: 0000

0:03:14:10.1.0000: CS: F000, DS: 0070, ES: 0690, SS: 0000

0:03:14:10.1.0000: SP: 06DE, BP: 0005, SI: 0522, DI: 0482

0:03:14:10.1.0000: IP: 00E4, FLAGS: 0097

0:03:14:10.1.0000: FLAGSINFO:C1P0A0zStido0000

What's at address 0000:07B4 in memory?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 35 of 87, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

Start here:

0:02:04:50.4.0000: 0070:3534 (2E891E7833)MOVW [CS:3378],BX
0:02:04:50.4.0000: AX: 0000, BX: 0021, CX: F002, DX: 0000
0:02:04:50.4.0000: CS: 0070, DS: 0000, ES: 0070, SS: 0000

note the values in CS (70) and BX (21). Then we reach

0:03:04:48.6.0000: 0070:3F30 (03067833)ADDW AX,[DS:3378]
0:03:04:48.6.0000: AX: 0033, BX: 0035, CX: 0001, DX: 0000
0:03:04:48.6.0000: CS: 0070, DS: 0070, ES: 0690, SS: 0000

note the value in DS (70) and see what happens next:

0:03:04:48.9.0000: 0070:3F34 (8BD0)MOVW DX,AX
0:03:04:48.9.0000: AX: 0033, BX: 0035, CX: 0001, DX: 0000

DS:3378 is apparently zero, despite the write above.

Reply 36 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

Some INT13 call is overwriting a lot of memory in the range that value is saved:

0:10:29:40.6.0000: Written to memory: 000006F0=46

0:10:29:40.7.0000: Written to memory: 000006F1=00

0:10:29:40.7.0000: Written to memory: 000006EE=70

0:10:29:40.8.0000: Written to memory: 000006EF=00

0:10:29:40.8.0000: Written to memory: 000006EC=59

0:10:29:40.9.0000: Written to memory: 000006ED=0F

0:10:29:40.9.0000: 0070:0F57 (CD13)INT 13

0:10:29:41.0.0000: Registers:

0:10:29:41.0.0000: AX: 0209, BX: 0000, CX: 0002, DX: 0000

0:10:29:41.1.0000: CS: 0070, DS: 0070, ES: 02A0, SS: 0000

0:10:29:41.1.0000: SP: 06F2, BP: 0005, SI: 0522, DI: 0482

0:10:29:41.2.0000: IP: 0F57, FLAGS: 0046

0:10:29:41.2.0000: FLAGSINFO:c1P0a0Zstido0000



0:10:29:41.3.0000: Written to memory: 000007C0=09

0:10:29:41.3.0000: Written to memory: 000007C1=02

0:10:29:41.4.0000: 0070:0FB5 (2EA3C000)MOVW [CS:00C0],AX

0:10:29:41.4.0000: Registers:

0:10:29:41.5.0000: AX: 0209, BX: 0000, CX: 0002, DX: 0000

0:10:29:41.5.0000: CS: 0070, DS: 0070, ES: 02A0, SS: 0000

0:10:29:41.6.0000: SP: 06EC, BP: 0005, SI: 0522, DI: 0482

0:10:29:41.6.0000: IP: 0FB5, FLAGS: 0046

0:10:29:41.7.0000: FLAGSINFO:c1P0a0Zstido0000



0:10:29:41.8.0000: Written to memory: 000006EA=46

0:10:29:41.8.0000: Written to memory: 000006EB=00

0:10:29:41.9.0000: 0070:0FB9 (9C)PUSHF

0:10:29:41.9.0000: Registers:

0:10:29:41.9.0000: AX: 0209, BX: 0000, CX: 0002, DX: 0000

0:10:29:42.0.0000: CS: 0070, DS: 0070, ES: 02A0, SS: 0000

Show last 151 lines
0:10:29:42.0.0000: SP: 06EC, BP: 0005, SI: 0522, DI: 0482

0:10:29:42.1.0000: IP: 0FB9, FLAGS: 0046

0:10:29:42.1.0000: FLAGSINFO:c1P0a0Zstido0000



0:10:29:42.2.0000: 0070:0FBA (80FC05)CMPB AH,05

0:10:29:42.3.0000: Registers:

0:10:29:42.3.0000: AX: 0209, BX: 0000, CX: 0002, DX: 0000

0:10:29:42.4.0000: CS: 0070, DS: 0070, ES: 02A0, SS: 0000

0:10:29:42.4.0000: SP: 06EA, BP: 0005, SI: 0522, DI: 0482

0:10:29:42.5.0000: IP: 0FBA, FLAGS: 0046

0:10:29:42.5.0000: FLAGSINFO:c1P0a0Zstido0000



0:10:29:42.6.0000: 0070:0FBD (750A)JNZ 0FC9

0:10:29:42.6.0000: Registers:

0:10:29:42.7.0000: AX: 0209, BX: 0000, CX: 0002, DX: 0000

0:10:29:42.7.0000: CS: 0070, DS: 0070, ES: 02A0, SS: 0000

0:10:29:42.8.0000: SP: 06EA, BP: 0005, SI: 0522, DI: 0482

0:10:29:42.8.0000: IP: 0FBD, FLAGS: 0093

0:10:29:42.9.0000: FLAGSINFO:C1p0A0zStido0000



0:10:29:43.0.0000: 0070:0FC9 (80FC08)CMPB AH,08

0:10:29:43.0.0000: Registers:

0:10:29:43.1.0000: AX: 0209, BX: 0000, CX: 0002, DX: 0000

0:10:29:43.1.0000: CS: 0070, DS: 0070, ES: 02A0, SS: 0000

0:10:29:43.2.0000: SP: 06EA, BP: 0005, SI: 0522, DI: 0482

0:10:29:43.2.0000: IP: 0FC9, FLAGS: 0093

0:10:29:43.2.0000: FLAGSINFO:C1p0A0zStido0000



0:10:29:43.3.0000: 0070:0FCC (7412)JZ 0FE0

0:10:29:43.4.0000: Registers:

0:10:29:43.4.0000: AX: 0209, BX: 0000, CX: 0002, DX: 0000

0:10:29:43.5.0000: CS: 0070, DS: 0070, ES: 02A0, SS: 0000

0:10:29:43.5.0000: SP: 06EA, BP: 0005, SI: 0522, DI: 0482

0:10:29:43.6.0000: IP: 0FCC, FLAGS: 0097

0:10:29:43.6.0000: FLAGSINFO:C1P0A0zStido0000



0:10:29:43.7.0000: 0070:0FCE (80FC15)CMPB AH,15

0:10:29:43.8.0000: Registers:

0:10:29:43.8.0000: AX: 0209, BX: 0000, CX: 0002, DX: 0000

0:10:29:43.9.0000: CS: 0070, DS: 0070, ES: 02A0, SS: 0000

0:10:29:43.9.0000: SP: 06EA, BP: 0005, SI: 0522, DI: 0482

0:10:29:43.9.0000: IP: 0FCE, FLAGS: 0097

0:10:29:44.0.0000: FLAGSINFO:C1P0A0zStido0000



0:10:29:44.1.0000: 0070:0FD1 (740D)JZ 0FE0

0:10:29:44.1.0000: Registers:

0:10:29:44.2.0000: AX: 0209, BX: 0000, CX: 0002, DX: 0000

0:10:29:44.2.0000: CS: 0070, DS: 0070, ES: 02A0, SS: 0000

0:10:29:44.3.0000: SP: 06EA, BP: 0005, SI: 0522, DI: 0482

0:10:29:44.3.0000: IP: 0FD1, FLAGS: 0097

0:10:29:44.4.0000: FLAGSINFO:C1P0A0zStido0000



0:10:29:44.4.0000: Written to memory: 000006E8=70

0:10:29:44.5.0000: Written to memory: 000006E9=00

0:10:29:44.5.0000: Written to memory: 000006E6=D8

0:10:29:44.6.0000: Written to memory: 000006E7=0F

0:10:29:44.6.0000: ModR/M address: 0070:00B4=000007B4

0:10:29:44.7.0000: 0070:0FD3 (2EFF1EB400)CALL [CS:00B4]

0:10:29:44.7.0000: Registers:

0:10:29:44.8.0000: AX: 0209, BX: 0000, CX: 0002, DX: 0000

0:10:29:44.8.0000: CS: 0070, DS: 0070, ES: 02A0, SS: 0000

0:10:29:44.9.0000: SP: 06EA, BP: 0005, SI: 0522, DI: 0482

0:10:29:44.9.0000: IP: 0FD3, FLAGS: 0097

0:10:29:45.0.0000: FLAGSINFO:C1P0A0zStido0000



0:10:29:45.1.0000: Written to memory: 000006E4=00

0:10:29:45.1.0000: Written to memory: 000006E5=F0

0:10:29:45.2.0000: Written to memory: 000006E2=E5

0:10:29:45.2.0000: Written to memory: 000006E3=00

0:10:29:45.3.0000: F000:00E0 (9AE60000F0)CALL f000:00e6

0:10:29:45.3.0000: Registers:

0:10:29:45.4.0000: AX: 0209, BX: 0000, CX: 0002, DX: 0000

0:10:29:45.4.0000: CS: F000, DS: 0070, ES: 02A0, SS: 0000

0:10:29:45.4.0000: SP: 06E6, BP: 0005, SI: 0522, DI: 0482

0:10:29:45.5.0000: IP: 00E0, FLAGS: 0097

0:10:29:45.5.0000: FLAGSINFO:C1P0A0zStido0000

(lots of memory is overwritten by this INT13 call (reading 9 sectors)), clearing the value that was stored at 0070:3378 by reading 9 sectors to 02A0:0000 up to 02A0:2DA2.

Filename
debuggerlog_20150314_1634.zip
File size
2.12 MiB
Downloads
70 downloads
File comment
Debugger log with memory writes logged (including internal interrupt calls).
File license
Fair use/fair dealing exception

This seems to load the value into ES:

0:10:28:23.4.0000: 0070:3A19 (A17F33)MOVW AX,[DS:337F]

0:10:28:23.5.0000: Registers:

0:10:28:23.5.0000: AX: F009, BX: 0100, CX: 0009, DX: 0001

0:10:28:23.5.0000: CS: 0070, DS: 0070, ES: 0070, SS: 0000

0:10:28:23.6.0000: SP: 06FE, BP: 7BE2, SI: 0001, DI: 0000

0:10:28:23.6.0000: IP: 3A19, FLAGS: 0056

0:10:28:23.7.0000: FLAGSINFO:c1P0A0Zstido0000



0:10:28:23.8.0000: 0070:3A1C (8EC0)MOVW ES,AX

0:10:28:23.8.0000: Registers:

0:10:28:23.9.0000: AX: 02A0, BX: 0100, CX: 0009, DX: 0001

0:10:28:23.9.0000: CS: 0070, DS: 0070, ES: 0070, SS: 0000

0:10:28:24.0.0000: SP: 06FE, BP: 7BE2, SI: 0001, DI: 0000

0:10:28:24.0.0000: IP: 3A1C, FLAGS: 0056

0:10:28:24.1.0000: FLAGSINFO:c1P0A0Zstido0000

Edit: This seems to be loaded at:

0:07:20:76.1.0000: 0070:362C (A10B7C)MOVW AX,[DS:7C0B]

0:07:20:76.2.0000: Registers:

0:07:20:76.3.0000: AX: 03C0, BX: 078C, CX: F000, DX: 0009

0:07:20:76.3.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:76.3.0000: SP: 06F8, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:76.4.0000: IP: 362C, FLAGS: 0246

0:07:20:76.4.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:07:20:76.5.0000: 0070:362F (B109)MOVB CL, 09

0:07:20:76.6.0000: Registers:

0:07:20:76.6.0000: AX: 0200, BX: 078C, CX: F000, DX: 0009

0:07:20:76.7.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:76.8.0000: SP: 06F8, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:76.8.0000: IP: 362F, FLAGS: 0246

0:07:20:76.8.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:07:20:76.9.0000: 0070:3631 (D3E8)SHRW AX,CL

0:07:20:77.0.0000: Registers:

0:07:20:77.0.0000: AX: 0200, BX: 078C, CX: F009, DX: 0009

0:07:20:77.1.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:77.1.0000: SP: 06F8, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:77.2.0000: IP: 3631, FLAGS: 0246

0:07:20:77.2.0000: FLAGSINFO:c1P0a0ZstIdo0000



0:07:20:77.3.0000: 0070:3633 (59)POP CX

0:07:20:77.4.0000: Registers:

0:07:20:77.4.0000: AX: 0001, BX: 078C, CX: F009, DX: 0009

0:07:20:77.5.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:77.5.0000: SP: 06F8, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:77.6.0000: IP: 3633, FLAGS: 0202

Show last 167 lines
0:07:20:77.6.0000: FLAGSINFO:c1p0a0zstIdo0000



0:07:20:77.7.0000: 0070:3634 (F7E2)MULW DX

0:07:20:77.8.0000: Registers:

0:07:20:77.8.0000: AX: 0001, BX: 078C, CX: F000, DX: 0009

0:07:20:77.9.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:77.9.0000: SP: 06FA, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:78.0.0000: IP: 3634, FLAGS: 0202

0:07:20:78.0.0000: FLAGSINFO:c1p0a0zstIdo0000



0:07:20:78.1.0000: 0070:3636 (8BD0)MOVW DX,AX

0:07:20:78.2.0000: Registers:

0:07:20:78.2.0000: AX: 0009, BX: 078C, CX: F000, DX: 0000

0:07:20:78.2.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:78.3.0000: SP: 06FA, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:78.3.0000: IP: 3636, FLAGS: 0206

0:07:20:78.4.0000: FLAGSINFO:c1P0a0zstIdo0000



0:07:20:78.5.0000: 0070:3638 (D1E2)SHLW DX,1

0:07:20:78.5.0000: Registers:

0:07:20:78.5.0000: AX: 0009, BX: 078C, CX: F000, DX: 0009

0:07:20:78.6.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:78.6.0000: SP: 06FA, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:78.7.0000: IP: 3638, FLAGS: 0206

0:07:20:78.8.0000: FLAGSINFO:c1P0a0zstIdo0000



0:07:20:78.9.0000: 0070:363A (D1E2)SHLW DX,1

0:07:20:78.9.0000: Registers:

0:07:20:78.9.0000: AX: 0009, BX: 078C, CX: F000, DX: 0012

0:07:20:79.0.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:79.1.0000: SP: 06FA, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:79.1.0000: IP: 363A, FLAGS: 0206

0:07:20:79.2.0000: FLAGSINFO:c1P0a0zstIdo0000



0:07:20:79.3.0000: 0070:363C (D1E2)SHLW DX,1

0:07:20:79.3.0000: Registers:

0:07:20:79.3.0000: AX: 0009, BX: 078C, CX: F000, DX: 0024

0:07:20:79.4.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:79.4.0000: SP: 06FA, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:79.5.0000: IP: 363C, FLAGS: 0206

0:07:20:79.5.0000: FLAGSINFO:c1P0a0zstIdo0000



0:07:20:79.6.0000: 0070:363E (D1E2)SHLW DX,1

0:07:20:79.6.0000: Registers:

0:07:20:79.7.0000: AX: 0009, BX: 078C, CX: F000, DX: 0048

0:07:20:79.8.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:79.8.0000: SP: 06FA, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:79.8.0000: IP: 363E, FLAGS: 0206

0:07:20:79.9.0000: FLAGSINFO:c1P0a0zstIdo0000



0:07:20:80.0.0000: 0070:3640 (D1E2)SHLW DX,1

0:07:20:80.0.0000: Registers:

0:07:20:80.0.0000: AX: 0009, BX: 078C, CX: F000, DX: 0090

0:07:20:80.1.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:80.1.0000: SP: 06FA, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:80.2.0000: IP: 3640, FLAGS: 0206

0:07:20:80.2.0000: FLAGSINFO:c1P0a0zstIdo0000



0:07:20:80.3.0000: 0070:3642 (58)POP AX

0:07:20:80.3.0000: Registers:

0:07:20:80.4.0000: AX: 0009, BX: 078C, CX: F000, DX: 0120

0:07:20:80.4.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:80.4.0000: SP: 06FA, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:80.5.0000: IP: 3642, FLAGS: 0202

0:07:20:80.5.0000: FLAGSINFO:c1p0a0zstIdo0000



0:07:20:80.6.0000: 0070:3643 (2BC2)SUBW AX,DX

0:07:20:80.6.0000: Registers:

0:07:20:80.7.0000: AX: 03C0, BX: 078C, CX: F000, DX: 0120

0:07:20:80.7.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:80.9.0000: SP: 06FC, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:80.9.0000: IP: 3643, FLAGS: 0202

0:07:20:81.0.0000: FLAGSINFO:c1p0a0zstIdo0000



0:07:20:81.1.0000: Written to memory: 00003A7F=A0

0:07:20:81.1.0000: Written to memory: 00003A80=02

0:07:20:81.2.0000: 0070:3645 (2EA37F33)MOVW [CS:337F],AX

0:07:20:81.2.0000: Registers:

0:07:20:81.3.0000: AX: 02A0, BX: 078C, CX: F000, DX: 0120

0:07:20:81.4.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:81.5.0000: SP: 06FC, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:81.5.0000: IP: 3645, FLAGS: 0206

0:07:20:81.6.0000: FLAGSINFO:c1P0a0zstIdo0000

This seems to be based at:

0:07:20:76.1.0000: 0070:362C (A10B7C)MOVW AX,[DS:7C0B]

0:07:20:76.2.0000: Registers:

0:07:20:76.3.0000: AX: 03C0, BX: 078C, CX: F000, DX: 0009

0:07:20:76.3.0000: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:07:20:76.3.0000: SP: 06F8, BP: 7BE2, SI: 7C36, DI: 052D

0:07:20:76.4.0000: IP: 362C, FLAGS: 0246

0:07:20:76.4.0000: FLAGSINFO:c1P0a0ZstIdo0000

0000:7C0B seems to contain the sector size (512 bytes).

Is this correct?

So it decodes to the following formula:

destination segment = ((Sector size(512)>>9)*9)
destination segment -= (destination segment<<5)

destination of the load is destination segment:0000

Is this the correct formula for determining the segment?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 37 of 87, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

I'll have to investigate later what you're seeing. However, if you see reads to segment 0x70 while running from segment 0x70, then that's your problem.
These are the reads that you should see:
9ea0:0 (9 sectors)
690:0 (6)
690:c00 (0x12)
690:3000 (0x12)
690:5400 (0x11)
986:10 (1)
b72:10 (1)
b72:10 (1)
b51:10 (1)
c8b:0 (1)
c8b:200 (0x12)
c8b:2600 (0x12)
c8b:4a00 (0x0c)
b30:10 (1)

Reply 38 of 87, by crazyc

User metadata
Rank Member
Rank
Member
superfury wrote:

... by reading 9 sectors to 02A0:0000 up to 02A0:2DA2.

It's reading the first FAT at the top of ram. Your int 12 is returning 0xf and 0xf * 1024 = 0x3c00. Since the FAT is 9 sectors and 9 * 512 = 0x1200 (0x2da2 is 9 * 0x512) then 0x3c00 - 0x1200 = 0x2a00. Peter's list shows the FAT read to 0x9ea00 which is 0x1200 bytes below the start of the EBDA which is at 0x9fc00.

Reply 39 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

Fixed the INT12 handler: it now gives the correct size (it was unimplemented), 640KB to be exact. The segment is almost correct. It's at 9EE0:0000 instead of 9EA0:0000. Anyone knows the cause?

Also the final read I've logged, which is supposed to be 1 sector to 986:10, seems to go wrong?

0:01:48:54.9.0000: Function 02 called.

0:01:48:63.7.0000: Read 1/1 sectors from drive 00, start 0. Requested: Head: 0, Track: 0, Sector: 1. Start sector: 0, Destination: ES:BX=0070:00000281

0:01:49:00.6.0000: Function 02 called.

0:01:49:91.8.0000: Read 9/9 sectors from drive 00, start 1. Requested: Head: 0, Track: 0, Sector: 2. Start sector: 1, Destination: ES:BX=9EE0:00000000

0:01:52:32.9.0000: Function 02 called.

0:01:52:89.1.0000: Read 6/6 sectors from drive 00, start 84. Requested: Head: 0, Track: 2, Sector: 13. Start sector: 84, Destination: ES:BX=0690:00000000

0:01:53:01.0.0000: Function 02 called.

0:01:54:88.2.0000: Read 18/18 sectors from drive 00, start 90. Requested: Head: 1, Track: 2, Sector: 1. Start sector: 90, Destination: ES:BX=0690:00000C00

0:01:55:03.9.0000: Function 02 called.

0:01:56:73.6.0000: Read 18/18 sectors from drive 00, start 108. Requested: Head: 0, Track: 3, Sector: 1. Start sector: 108, Destination: ES:BX=0690:00003000

0:01:56:85.5.0000: Function 02 called.

0:01:58:50.4.0000: Read 17/17 sectors from drive 00, start 126. Requested: Head: 1, Track: 3, Sector: 1. Start sector: 126, Destination: ES:BX=0690:00005400

Anyone knows what's going wrong?

Filename
debugger_20150316_1916.zip
File size
2.4 MiB
Downloads
58 downloads
File comment
Latest debugger log with incorrect FAT destination address.
File license
Fair use/fair dealing exception

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io