EmbeddedRelated.com
Forums

Virtual memory and memory protection

Started by ssubbarayan August 19, 2005
Paul Keinanen wrote:
> When the 8086 came out there was a lot of marketing hype about the > compatibility between 8080 and 8086. It was quickly found out that > these are not binary compatible, but that some assembler macros or > some translating software to automatically convert 8080 assembler to > 8086 assembler. However, I have never heard anyone using these > translation tools :-).
The original WordStar was supposedly ported (i.e. translated) this way. Terje -- - <Terje.Mathisen@hda.hydro.com> "almost all programming can be viewed as an exercise in caching"
Terje Mathisen wrote:
> The original WordStar was supposedly ported (i.e. translated) this way.
A fair number of CP/M programs were ported to MS-DOS that way. Most 8080 instructions mapped exactly to one or two 8086 instructions, so performance was not bad. MS-DOS itself also had a fair bit of campatibility built in (function numbers and semantics for much of the early the INT 21h API, for example). There was (is?) even a far call to the MS-DOS kernel embedded in location +5 of the PSP, which would accept the function number in CL (this matches the CP/M OS calling convention - "call 5").
On 2005-08-23, robertwessel2@yahoo.com <robertwessel2@yahoo.com> wrote:
> >> The original WordStar was supposedly ported (i.e. translated) this way. > > A fair number of CP/M programs were ported to MS-DOS that way. Most > 8080 instructions mapped exactly to one or two 8086 instructions, so > performance was not bad.
That's no excuse for designing such a register-starved architecture. I can see why the 8086 needed at least as many registers as the 8080 -- but there's no reason why they couldn't have tossed in a few extra ones... -- Grant Edwards grante Yow! hubub, hubub, HUBUB, at hubub, hubub, hubub, HUBUB, visi.com hubub, hubub, hubub.
Paul Keinanen wrote:
> > some translating software to automatically convert 8080 assembler to > 8086 assembler. However, I have never heard anyone using these > translation tools :-).
I've ported from COP8 to NEC 78K0 using exactly this method. Horrible but it can be done.
Grant Edwards wrote:
> On 2005-08-23, robertwessel2@yahoo.com <robertwessel2@yahoo.com> wrote: > > > >> The original WordStar was supposedly ported (i.e. translated) this way. > > > > A fair number of CP/M programs were ported to MS-DOS that way. Most > > 8080 instructions mapped exactly to one or two 8086 instructions, so > > performance was not bad. > > That's no excuse for designing such a register-starved > architecture. I can see why the 8086 needed at least as many > registers as the 8080 -- but there's no reason why they > couldn't have tossed in a few extra ones...
It's hard to argue with that, but it had (more-or-less) twice what the 8080 had, and it still fit in 29K transistors. Remember this was introduced in 1978. The 68K was introduced a year later and had more than twice as many transistors. Also remember this is all mostly before the RISC revolution (the 801 project was running by 1978, but was not really publicly known).
Grant Edwards wrote:
> <robertwessel2@yahoo.com> wrote: >>
... snip ...
>> >> A fair number of CP/M programs were ported to MS-DOS that way. >> Most 8080 instructions mapped exactly to one or two 8086 >> instructions, so performance was not bad. > > That's no excuse for designing such a register-starved > architecture. I can see why the 8086 needed at least as many > registers as the 8080 -- but there's no reason why they > couldn't have tossed in a few extra ones...
They did. That was designed about 1975. At the time I believe a PDP11 had 16 registers, of which one was the SP and one was the IP, and cost a lot more than an 8086, besides being bigger. Now count the original 8086 registers: AX, BX, CX, DX, SI, DI, BP, SP, IP, CS, DS, ES, SS. all of which were programatically available, with suitable caveats. An 8080 had: PSW (=A+flags), BC, DE, HL, SP, IP. ie from 6 to 13. Many registers in both could be accessed as high and low byte independantly. Both could do 16 bit arithmetic. The 86 could also do multiply and divide and other things. -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson
Tauno Voipio wrote:
> glen herrmannsfeldt wrote:
>> The 8086, as far as I remember, was an improved 8080. >> It wasn't supposed to be used for all the things people actually >> did with it.
> The 8086 is the base model of current PC processors. The > current Pentiums, Athlons and whatnot all still can > use the basic 8086 instruction set, but they do not > understand about 8080 instructions.
The 8086 was designed to be assembly source compatible with the 8080. Assembly code could be run through an intel supplied program to generate 8086 code, except most likely self modifying code. -- glen
CBFalconer wrote:
> Grant Edwards wrote: > >><robertwessel2@yahoo.com> wrote: >> > ... snip ... > >>>A fair number of CP/M programs were ported to MS-DOS that way. >>>Most 8080 instructions mapped exactly to one or two 8086 >>>instructions, so performance was not bad. >> >>That's no excuse for designing such a register-starved >>architecture. I can see why the 8086 needed at least as many >>registers as the 8080 -- but there's no reason why they >>couldn't have tossed in a few extra ones... > > > They did. That was designed about 1975. At the time I believe a > PDP11 had 16 registers, of which one was the SP and one was the IP, > and cost a lot more than an 8086, besides being bigger. Now count > the original 8086 registers: > > AX, BX, CX, DX, SI, DI, BP, SP, IP, CS, DS, ES, SS. > > all of which were programatically available, with suitable > caveats. An 8080 had: > > PSW (=A+flags), BC, DE, HL, SP, IP. > > ie from 6 to 13. Many registers in both could be accessed as high > and low byte independantly. Both could do 16 bit arithmetic. The > 86 could also do multiply and divide and other things.
I sure wouldn't count the segment registers in with the other registers. By my reckoning it went from 6 to 9 registers more or less available for use, but none were really general purpose. It wasn't bad for it's day. --Larry
>> They did. That was designed about 1975. At the time I believe a >> PDP11 had 16 registers, of which one was the SP and one was the IP, >> and cost a lot more than an 8086, besides being bigger.
It only had 8, six general purpose, SP, and PC (aka IP).
>> Now count the original 8086 registers: >> >> AX, BX, CX, DX, SI, DI, BP, SP, IP, CS, DS, ES, SS.
That's also six general registers, SP, IP and BP which handles something that would often otherwise require one of the general ones. The 8086 had more usable registers than a PDP-11. Amazing but true. We can argue whether the simpler addressing modes made the '86 registers less useful. R's, John
Larry Elmore wrote:
> I sure wouldn't count the segment registers in with the other registers. > By my reckoning it went from 6 to 9 registers more or less available > for use, but none were really general purpose. It wasn't bad for it's day.
While this is splitting hairs, you can argue that IP, flags and SP are special use registers on both CPUs, and the four segment registers are special use on the 8086. That leaves you with A, BC, DE and HL* as "normal" registers on the 8080, compared to AX, BX, CX, DX, DI, SI and BP on the '86. And in general, the 8086 registers are more general purpose than the ones on the 8080. We can quibble about how to count the various special registers, but "about twice as many usable registers on the 8086" is a pretty reasonable assessment. *For people not remembering the 8080: those are seven byte-wide registers (A, B, C, D, E, H and L), six of which could be used in pairs as 16-bit registers (BC, DE and HL).