Skip to content

wrapping word writes (eg. MOV [0FFFFh],AX)Β #18

@thamesynne

Description

@thamesynne

basically, the problem is that the real 8088 wraps around at the end of a segment, and will read or write the high byte of AX at/to DS:0 at this point (and everything above the 8018x will crash with a segfault). 8086tiny - in fairness, along with just about every other 8086 emulator in the world - doesn't do that; instead it reads or writes the first byte after the current segment.

the same problem occurs when the segment address is > 0F000h; a real 8086 will wrap back around to 0, whereas 8086tiny has an accidental HMA! (and more seriously, a 65520-byte-sized array out-of-bounds error)

as I say, this is stuff that just about every other 8086 emulator misses, so it's forgiveable - but nonetheless, it's not how an 8086 behaves... and anything that relies on 8086 behaviour may potentially cause in-universe - or worse, out-of-universe - memory corruption.

(and of course, LDS and LES require the detection of addresses above 0xFFFD...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions