I was given the physical address 5E3DAh, and i should set the value 1 in this physical address. I know 8086 register cannot handle 20 bit addresses, therefore my question is how do I reach to that specific address?
Asked
Active
Viewed 499 times
0
-
3Do you know about segment:offset addressing? – Carl Norum Feb 11 '20 at 21:11
-
I can. It has 20 bit address space. – Eraklon Feb 11 '20 at 21:11
-
1You use segment registers in combination with regular registers. 5xxx goes in the segment register, and xxxA goes in the regular register. Where to put the xxx (the middle three hex digits) is your choice. You either use the default segment for the instructions and addressing modes you want to use, or use an alternate segment register with a segment override prefix. – Erik Eidt Feb 11 '20 at 21:11
-
@MichaelPetch: that looks like an answer; you could post it as such even though it's relatively short. – Peter Cordes Feb 12 '20 at 01:58
-
To address 20 bits Intel devised real mode [segment:offset](https://thestarman.pcministry.com/asm/debug/Segments.html) addressing. A segment combined with an offset can address a 20 bit physical address. If given a 20 bit physical address you can take the top 4 nibbles (hex digits) and place them in a segment register and use the lower nibble (lowest hex digit) as an offset. Code like this should work: `mov ax, 0x5e3dh` `mov ds, ax` `mov byte ptr DS:[0Ah], 1` 0x5E3D:0x000A represents physical address 0x5E3DA. (0x5E3D<<4)+0xA = 0x5E3DA. – Michael Petch Feb 12 '20 at 15:01