Logical, Segmented Address or Physical Address

Started by
4 comments, last by Leadorn 21 years, 9 months ago
Hi When I assign my pointer to screen is 0xA000 0000 a Physical adress or Logical, Segmented Address byte far *Screen=(byte far*)0xA000 0000; Logical, Segmented Address: 0FE6:012Bh • Offset, Index Address: 012Bh • Physical Address: 0FE60h -> 65120 + 012Bh -> 299 = 0FF8Bh -> 65149
Advertisement
Well it depends on what mode the processor is switched in, the video memory is mapped to the location in memory 0xA0000 and thats the physical address. Only so much of the video memory is accessable through here so the video card uses a paging process to determine which section of video memory is mapped to 0xA0000-0xBFFFF.

Say the processor is in real mode and that the segment size is 16bytes, then you would set the segment to 0xA000 which is then translated into 0xA0000 by the processor''s MMU (memory management unit) which is the physical address.

Say the processor is setup for a linear memory model then 0xA0000 is the address that must be used and no conversion is done by the MMU.

There are several memory models the processor can follow and so the answer to that question will vary...the only constant is that the video memory is mapped to the physical memory location 0xA0000-0xBFFFF.

hope this helps
--Andrew
?????????????
Say the processor is in real mode and that the segment size is 16bytes
?????????????
you mean 16 bit adress....

So the system bus is in 20 bit and the segment:offset becomes the Physical adress (system bus adress).

I´ve seen a pdf doc about the memory map this is how it looks.

Realmode
FFFFFh
------
| |
|____|
| |
| cs | code segment
|____|
|____|
| es |
|____|Extra segment
| |
|____|
| |
| ss |
|____|
| |
|____|
| ds |
|____|
| |
| |
|____|
00000h
1024 kb
Is ds, es, ss and ds default the segment adress like shown in this nice asci pic?


is this dump correct dump some mem från segment a000 : offset 0
-d a000:0
A000:0000 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
A000:0010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
A000:0020 00 00 7E 81 A5 81 81 BD-99 81 81 7E 00 00 00 00 ..~........~....
A000:0030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
A000:0040 00 00 7E FF DB FF FF C3-E7 FF FF 7E 00 00 00 00 ..~........~....
A000:0050 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
A000:0060 00 00 00 00 6C FE FE FE-FE 7C 38 10 00 00 00 00 ....l....|8.....
A000:0070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................


Well if I understand what you are trying to ask correctly, the segment registers can point to anything. For example, you could have the ss, cs, ds, and es all pointing to the same spot in memory - it doesnt matter. However, when you call push/pop the processor will use the section in memory ss and sp point to. As far as that memory dump, it looks fine... it starts pointing at the first byte in video memory and displays whats there and increments the memory location.

I hope that answers any quetions
--Andrew
You guys, rel mode doesn''t have 16 byte segments. It has 64K segments. Each segment has 16 unique bytes. You guys shoudl seriously rad about Protected Mode and unless you''re writing and OS, don''t worry about it.
Well what I meant is that each segment is differant by 16bytes, so if your at segment 0x0000 and then you go to segment 0x0001 there is a 16 byte difference between the two. But right, each segment can have a max of 65535bytes however, it is possible to get 2^32bytes per segment by switching into protected mode and setting up 32bit addressing and switching back to real mode (I think thats right anyways) I believe its called Big Real Mode. Anyways, he knows what I meant.

This topic is closed to new replies.

Advertisement