Online Book Reader

Home Category

Code_ The Hidden Language of Computer Hardware and Software - Charles Petzold [110]

By Root 1612 0
in the 8080. For many instructions, an address can be formed from the sum of the index register and the byte that follows the opcode.

While the 6800 does just about the same operations as the 8080—loading, storing, adding, subtracting, shifting, jumping, calling—it should be obvious that the opcodes and the mnemonics are completely different. Here, for example, are the 6800 Branch instructions:

Opcode

Instruction

Meaning

20h

BRA

Branch

22h

BHI

Branch If Higher

23h

BLS

Branch If Lower or Same

24h

BCC

Branch If Carry Clear

25h

BCS

Branch If Carry Set

26h

BNE

Branch If Not Equal

27h

BEQ

Branch If Equal

28h

BVC

Branch If Overflow Clear

29h

BVS

Branch If Overflow Set

2Ah

BPL

Branch If Plus

2Bh

BMI

Branch If Minus

2Ch

BGE

Branch If Greater than or Equal to Zero

2Dh

BLT

Branch If Less than Zero

2Eh

BGT

Branch If Greater than Zero

2Fh

BLE

Branch If Less than or Equal to Zero

The 6800 doesn't have a Parity flag like the 8080, but it does have a flag the 8080 doesn't have—an Overflow flag. Some of these Branch instructions depend on combinations of flags.

Of course the 8080 and 6800 instructions sets are different. The two chips were designed about the same time by two different groups of engineers at two different companies. What this incompatibility means is that neither chip can execute the other chip's machine codes. Nor can an assembly-language program written for one chip be translated into opcodes that run on the other chip. Writing computer programs that run on more than one processor is the subject of Chapter 24.

Here's another interesting difference between the 8080 and the 6800: In both microprocessors, the instruction LDA loads the accumulator from a specified memory address. In the 8080, for example, the following sequence of bytes:

will load the accumulator with the byte stored at memory address 347Bh. Now compare that with the 6800 LDA instruction using the so-called 6800 extended addressing mode:

This sequence of bytes loads accumulator A with the byte stored at memory address 7B34h.

The difference is subtle. You expect the opcode to be different, of course: 3Ah for the 8080 and B6h for the 6800. But the two microprocessors treat the address that follows the opcode differently. The 8080 assumes that the low-order byte comes first, followed by the high-order byte. The 6800 assumes that the high-order byte comes first!

This fundamental difference in how Intel and Motorola microprocessors store multibyte values has never been resolved. To this very day, Intel microprocessors continue to store multibyte values with the least-significant byte first (that is, at the lowest memory address), and Motorola microprocessors store multibyte values with the most-significant byte first.

These two methods are known as little-endian (the Intel way) and big-endian (the Motorola way). It might be fun to argue over which method is better, but before you do so, be aware that the term Big-Endian comes from Jonathan Swift's Gulliver's Travels and refers to the war between Lilliput and Blefuscu over which end of an egg to break before eating it. Such an argument is probably purposeless. (On the other hand, I feel obliged to confess that the approach I used in the Chapter 17 computer wasn't the one I personally prefer!) Despite neither method being intrinsically "right," the difference does create an additional incompatibility problem when sharing information between systems based on little-endian and big-endian machines.

What became of these two microprocessors? The 8080 was used in what some people have called the first personal computer but which is probably more accurately the first home computer. This is the Altair 8800, which appeared on the cover of the January 1975 issue of Popular Electronics.

When you look at the Altair 8800, the lights and switches on the front panel should seem familiar. This is the same type of primitive "control panel" interface that I proposed for the 64-KB RAM array in Chapter 16.

The 8080 was followed by the Intel

Return Main Page Previous Page Next Page

®Online Book Reader