On Sunday 31 October 2004 17:37, Mark Rogers wrote:
Graham wrote:
Interestingly (to me at least), in the days when we programmed everything in assembler, 8-bit microprocessors had a set of BCD (Binary Coded Decimal) instructions that allowed computations to mirror what we expect in real life. They were put there for use by pocket calculators, which is why these machines give the *right* answers and recur a third rather than a tenth.
Do you have any reference to this use of BCD? I only know of the use of BCD instructions with integer values, where their purpose is somewhat different (in particular the ease with which BCD can be displayed on 7-segment displays with very little processing capability, compared with decimal values).
All of the processors of the day had BCD instructions. I just hauled out a 68000 manual and that too has the instructions, though whether anyone ever used them on a 16-bit CPU is open to question.
The following is entirely from memory so could be inaccurate on any count:
The first true micro was the 4004, designed in the early 70's for Busicom, a Japanese calculator manufacturer. They'd asked a small outfit called Intel to design a custom chipset for a new machine, but the guys at Intel figured they could do the job better with a stored-program chip, so the 4004 was born. It had a truly awful architecture and 4-bit serial hardware interface, but as far as I know included the all-important BCD instructions (and not much else!). It was followed by the 4040, a parallel device that was a bit easier to use, then in about 1974 the 8080 came along; the first machine to have a half-way decent instruction set and reasonable interfaces. Motorola followed a year or so later with the 6800, the first single-voltage device, then the 6802, which included an on-chip oscillator; this made it a doddle to build a system around in your back room (which I did). Ah, those blissful days!
Neither Intel nor Motorola had the courage to abandon compatibility with the past (can't speak for Itania and PPCs), which is why later chips have a number of little-used legacy instructions. Not that you can run a 4004 calculator program on a Pentium, but I suppose it could be translated pretty well word for word. Rather useful, eh?
-- GT