-1

The Intel 8086 CPU could address up to 1 MB of memory using segmentation, and this CPU have 4 segment registers, which are CS and SS and DS and ES. Each segment in memory can have a maximum size of 64 KB. I want to know what are the possible ways of putting CS,SS,DS and ES in RAM and Are there any specific ways that we could not put CS,SS,DS and ES in RAM? how many of CS,SS,DS and ES can we use in a RAM?

4
  • 2
    Why would you not be able to point any segment register at any range of physical memory? That is, I don't understand what is behind the question. Can you add any detail about why you think this might be an issue? Dec 19 '20 at 16:11
  • 1
    The segment registers are accessible and modifiable, and the 8086 has no concept of privilege, so code can modify the segment registers ranging from frequently to seldom. devblogs.microsoft.com/oldnewthing/20200728-00/?p=104012
    – Erik Eidt
    Dec 19 '20 at 16:12
  • @another-dave It is a research that I am doing and I can't find anything useful in the Internet Dec 19 '20 at 16:18
  • @AsraZibaie This question's a lot better than the last one, but you've probably hit the automatic question block now. See if you can improve this question, if you need to ask another one soon. (If you need help, let me know.)
    – wizzwizz4
    Dec 19 '20 at 19:56
4

I want to know what are the possible ways of putting CS,SS,DS and ES in RAM

Each of them can point to any location in RAM dividable by 16 (ending in xxxx0).

Since each of them is 16 bits, there are 65536 locations to point them to, resulting in a total of 2^64 possible combinations, right?

Are there any specific ways that we could not put CS,SS,DS and ES in RAM?

They can have any value allowed with 16 bit, so 0..65535. Thus, as mentioned before, each can point to any location within the 2^20 address space were the lower 4 address bits are zero and address the 64 KiB including thereafter.

how many of CS,SS,DS and ES can we use in a RAM?

All 4 are usable to point to, given that they do have dedicated meaning during execution.

It is a research that I am doing and I can't find anything useful in the Internet

Maybe you're simply looking to hard for some secret, where none exists?

A segment is simply 64 KiB of RAM. In case of the 8086 (or any other real mode x86) it starts at the address build from the value the segment register holds times 16. In virtual mode it turns into a handle to a segment descriptor (*1) pointing to a segment of arbitrary size and location defined by the descriptor, but I guess that's another story.


*1 - In fact, even in real mode it's best to think of the content of a segment register as a handle, not an address value ... but that as well may be beyond your question, right?

Not the answer you're looking for? Browse other questions tagged or ask your own question.