Question:
Assembly Language question help!?
2010-07-28 14:38:21 UTC
If we say that 'a processor is 64K'. Does it mean all of its segments, Windows(code, data, stack..) each is of 64K? How many lines of address bus are required to access it, and how?
Another query, when we are using registers in our assembly program, are these registers are free for our program. I mean isn't computer is using them for its own task?
From where i can learn segmented memory model concept, any tutorial. I am using iAPX88.
Three answers:
Greater Meridian
2010-07-28 20:03:23 UTC
I'd try finding "The 8086 Book" by Russell Rector and Hal Alexy, which discusses both the 8088 (known as the iAPX88) and the 8086. They both share the same instruction set, and this book gives a complete, minutely detailed description of the addressing and timing differences between them.



The 8088 had 16-bit internal data transfer and 8-bit external data transfer, while the 8086 had a 16-bit external bus. The address lines ranged from A0 to A19 on the 8086, which gave it 20 bits of addressing range (and when the 80x86 machines were introduced, they used the A20 line to toggle between using "real mode memory" and memory above 1024K.



The 8086 could address 1024K of memory, but memory-mapped I/O used by hardware such as the CGA, EGA, and VGA graphics adapter cards used some of that memory, and the operating system ISRs (Interrupt Service Routines) and drivers used more of it, until a 640K "nominal" address space available to a program wound up being 528K or so.



As far as 64K segments go, you need to consider physical address calculation on these machines, which involves storing a segment value in one 16-bit register and an offset value in another 16-bit register. The physical addresses are calculated by shifting the segment register value left four bits and adding the offset value in the other register to it. But the 8086 only has 20 address lines, and that limits the range of physical addresses available. With a given value in one of the segment registers, shift it left 4 bits and increment the register by one and shift that left 4 bits; and when you subtract the first shifted value from it you'll have 65536, which is 64K. Also, under some circumstances, you could use a segment register to address the top of memory, and when the processor added the offset to it the value would wrap around and you'd actually be addressing the low part of memory instead of memory above 1024K. That's a story in itself.



Your best bet for learning what the segmented memory model(s) mean is to get to a library (college or university) and look at some of their old C programming books. It used to be widely discussed that the various memory models, "tiny", "small", "compact", "large", and "huge" were explicitly used as compiler directives in order to cause the object file output to conform to a particular format (as, for instance, ".COM" programs under DOS). If you can find a C book that makes a big deal about these memory models, it'll be sure to have plenty of details explaining why.
2010-07-28 14:45:30 UTC
We don't say that a processor is 64k, we say that it's 32 bits or 64 bits. That's how many lines there are and how many bits there are.



Windows maintains the registers it needs as it needs them, you're free to use them as you wish (as long as what you do makes sense, of course.)
Richard
2010-07-28 14:49:51 UTC
We say 'a processor is 64 bit' This refers to the data bus size not the address bus size.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...