3

In real mode and 32-bit protected mode, 16-bit addressing is used to reference memory via the ModR/M byte. This addressing is only supported in i386 instructions with use of legacy prefixes, and entirely unsupported in x86-64 instructions.

However, the ModR/M byte is also used by the 8-bit specific opcodes, which makes me question if 8-bit addressing was present in the original 16-bit x86 instruction set. Although an 8-bit address is very limited, it'd be entirely possible to encode such an instruction in the same style as 16-bit instructions with a different opcode.

For example, instead of

add (bx, si), ax

you'd have

add (bl, dh), al

It's hard to find any pre-i386 documentation, so I'm in the dark. Was this ever supported?

Sep Roland
  • 33,889
  • 7
  • 43
  • 76
  • 1
    FWIW, I don't believe so. Nobody ever said "256 bytes ought to be enough for anybody" ;) – 500 - Internal Server Error Oct 18 '22 at 14:50
  • No, addressing is a16, a32, or a64. There is no a8 addressing size. The only similar thing is `xlatb` which loads from `byte [ds:rbx/ebx/bx+al]`. – ecm Oct 18 '22 at 15:59
  • 1
    the 8088/86 docs were pretty easy to find pdfs of the original iapx88 book. I got the pdf and can buy originals on amazon as well for like eight bucks. Hmm that 8 bucks is from intel sold through amazon, used sellers from five bucks...if you get the right pdf, even though it is a scan, you can do text searches... – old_timer Oct 18 '22 at 19:04
  • 20 bit address, not counting the i/o vs mem signal. segment/offset, offset by 4 bits. this was before intel started splitting them into two books one for hardware one for software. – old_timer Oct 18 '22 at 19:08
  • 1
    http://bitsavers.org is a good source for historic documentation. [Here](http://bitsavers.org/components/intel/8086/9800722-03_The_8086_Family_Users_Manual_Oct79.pdf) for instance is the 8086 User's Manual. You may also be interested in the [Retrocomputing.SE] Stack Exchange. – Nate Eldredge Oct 19 '22 at 13:57

1 Answers1

8

Only via XLAT, which effectively does mov al, [bx + al] (which is not encodeable as a mov).

Modern 16-bit real mode uses the same machine-code format as 8086, that's what it means to be backwards compatible. (With only very minor differences, like that there's now an instruction-length limit of 15 bytes, vs. 8086 would happily fetch an unlimited number of prefixes, even if that meant wrapping around IP within a 64k segment full of rep prefixes.)

NASM x86 16-bit addressing modes lists all the ModRM modes: they only include 16-bit registers.

add [bx + si], al is encodeable (as 00 00), but add [bl + dh], al isn't.

PDFs of 8086 manuals are available if you want to check historical documents. Also, Stephen Morse, the primary architect of 8086's ISA, wrote a book "The 8086/8088 primer", which is now available for free on his web site: https://stevemorse.org/8086/.

Earlier ancestors of 8086, like 8080 which only has 8-bit registers, are not x86 CPUs.


Related:

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847