Reputation: 67
I am given the register values for CS, DS, SS, ES, SP, BP, SI, DI, AX, BX, CX, DX. How would I go about finding the size in hex bytes of the Code Segment?
Upvotes: 0
Views: 4085
Reputation: 148965
You cannot.
8086 is rather outdated now, but some dynosaurus remember about it. It was a 16 bits processor but with 20 bits for the addresses : the 4 segment registers (CS, DS, ES and SS) had values shifted by 4 and the offset were added to that. The total addressable memory was 1 Mbyte.
The maximum size of any segment was 65536 bytes (0x10000). But the actual size of the code segment was not known to the processor. There was no memory protection, and it was allowed to write data in the middle of the code segment (what might be right or wrong depending if programmer knew why :-( ).
There used to be different common memory models (ref :8086 Memory Model):
So :
Upvotes: 2