14-11-2012, 01:16 PM
Comparison AND JUMP INSTRUCTIONS OF THE 8085
MICROPROCESSOR
Comparison AND JUMP INSTRUCTIONS OF THE 8085 MICROPROCESSOR .pdf (Size: 139.79 KB / Downloads: 46)
THEORY
Compare Operations (CMP, CPI) :- These instructions compare the accumulator
with the required 8-bit data, setting the appropriate flag and leaving the accumulator
untouched.
Notes of flags affection
We can see from the previous experiments that only arithmetic and logical
instructions affect the flag register, and we notice some exceptions.
1- The four rotate instructions, STC, CMC, and DAD instructions affect carry flag only
and we can write the effect is: CY.
2- DCR and INR instructions affect all the flag bits except the carry bit and we can
write the effect is: All but CY.
3- INX, DCX, and CMA instructions don’t affect any flag bits and we can write the
effect is: None.
4- Other arithmetic and logical instructions affect all the flag bits and we can write the
effect is: All.
Counters
Designing a counter is a frequent programming application. Counters are used
primarily to keep track of events.
A counter is designed by loading an appropriate count in a register. A loop is set
up decrement the count for a down-counter (counts in the descending order) by using
the DCR (decrement by one) instruction or to increment the count for an up-counter
(counts in the ascending order) by using the INR (increment by one) instruction. A loop
is established to update the counter, and each count is checked to determine whether it
has reached the final number; if not the loop is repeated.
LAB Work
1- exclusive or register A and B, then add 3 to register C if the parity is even otherwise
add 30h to C, when A=35h, B=20h, C=10h
2- Check if the content of register B is even then C=1, otherwise C=2. (by using two
methods)
3- Calculate the sum of numbers between 10 and 1.