Page 198 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 198
Introduction to Microprocessors
Notes • Control transfer - conditional, unconditional, call subroutine, return from subroutine and
restarts.
• Input/Output instructions.
• Other - setting/clearing flag bits, enabling/disabling interrupts, stack operations, etc.
14.4 Differences between Intel 8080 and 8085 Processors
There were multiple versions of 8085 microprocessors. The original version of the 8085
microprocessor without suffix "A" was manufactured by Intel only, and was very quickly replaced
with 8085A containing bug fixes. A few years after that, around 1980, Intel introduced 8085AH -
HMOS version of 8085A. There was also 80C85A - CMOS version of the 8085A. It's not clear if
80C85 was ever manufactured by Intel or not, but it was produced by at least two second source
manufacturers - OKI and Tundra Semiconductor. Tundra Semiconductor manufactured the fastest
8085 microprocessor running at 8 MHz.
Second source manufacturers: AMD, Mitsubishi, NEC, OKI, Siemens, Toshiba. Soviet Union also
manufactured clones of Intel 8085 CPU.
14.4.1 Arithmetic
The arithmetic instructions usually include addition, subtraction, division, multiplication,
incrementing, and decrementing although division & multiplication were not available in most
early CPU's. There are two flags used with arithmetic that tell the program what was the outcome
of an instruction. One is the Carry (C) flag. The other is the Zero (Z) flag. The C flag will be
explained in the following example of addition. The Z flag, if set, says that the result of the
instruction left a value of 0 in the accumulator. We will see the Z flag used in a later lesson.
Addition
This is straightforward and is simply to add two numbers together and get the result. However
there is one more thing. If, in the addition, the result was too big to fit into the accumulator, part
of it might be lost. There is a safeguard against this. Take the case of 11111111b (255) and 11111111b
(255). These are the largest numbers that can fit into an 8-bit register or memory location. You can
add these as decimal numbers. The binary value for 510 is 111111110b (9 bits). The accumulator is
only 8 bits wide, it is a byte. How do you fit a 9-bit number into 8 bits of space? The answer is, you
can't, and it's called an OVERFLOW condition. So how do we get around this dilemma? We do it
with the CARRY (C) flag. If the result of the addition is greater than 8 bits, the CARRY (C) flag
will hold the 9th bit. In this case the accumulator would have in 11111110b (254) and the C flag
would be a 1, or set. This 1 has the value of 256 because this is the 9th bit. We haven't covered a 9-
bit number, but they come up all the time as overflows in addition. Since we are using base 2, and
we found out in lesson 2 that the 8th bit (bit 7) in a byte is worth 128, then the 9th bit is worth 2
times that, or 256. Adding 254 and 256, we get 510, the answer, and we didn't lose anything,
because of the C flag. Had the result of the addition not caused an overflow, the C flag would be
0, or cleared.
Subtraction
In the case of subtraction, the process is more difficult to explain, and as such, I'm not going to
cover it here. It involves 1's compliment and 2's compliment representation.
Multiplication and Division
In the micro we will be using, the 8085, multiply and divide instructions are not available so we
will wait till later (EL31G-Microprocessors II) to talk about them. They do, however, do just what
the names suggest.
192 LOVELY PROFESSIONAL UNIVERSITY