Module 1 Lecture 4
Module 1 Lecture 4
Module 1
03-09-2021 2
Module 1
03-09-2021 3
8085 microprocessor
9/3/2021 4
8085 microprocessor
9/3/2021 5
8085 microprocessor
9/3/2021 6
8085 microprocessor
9/3/2021 7
8085 microprocessor
9/3/2021 9
8085 microprocessor
9/3/2021 10
8085 microprocessor
9/3/2021 11
8085 microprocessor
Before After
A F9 2050 F9
B 20 50 C
9/3/2021 12
8085 microprocessor
9/3/2021 13
8085 microprocessor
Before After
D 10 30 E D 20 50 E
H 20 50 L H 10 30 L
9/3/2021 14
8085 microprocessor
9/3/2021 15
8085 microprocessor
9/3/2021 16
Module 1
03-09-2021 17
8085 microprocessor
Before After
A 47 XX A 98
B 51 XX C B 51 XX C
9/3/2021 18
8085 microprocessor
9/3/2021 19
8085 microprocessor
9/3/2021 20
8085 microprocessor
DAD rp
o Add register pair to H and L registers.
o The 16-bit contents of the specified register pair are added to the contents of the HL
register and the sum is saved in the HL register.
o Ex – Assume register pair HL contains 0242H. Multiply the contents by 2.
DAD H
Before After
H 02 42 L H 04 84 L
9/3/2021 21
8085 microprocessor
9/3/2021 22
8085 microprocessor
DAA
o Decimal Adjust Accumulator
o The contents of the accumulator are changed to binary coded decimal (BCD)
o Instruction work as follows:
• If the value of the low order four bits (D3 – D0) in the accumulator is greater than 9 or if the AC flag is set, the
instruction adds 6 (06) to the low – order four bits.
• If the value of the higher order bits (D7 – D4) in the accumulator is greater than 9 or if the carry flag is set, the
instruction adds 6 (60) to the high order four bits.
9/3/2021 23
8085 microprocessor
DAA
o Ex – If A = 0011 1001 = 39BCD
C = 0001 0010 = 12BCD
ADD C A = 0100 1011 = 4B H
DAA ; adds (06H)0000 0110 because 1011>9
Now A = 0100 1011 + 0000 0110 = 51BCD
9/3/2021 24
8085 microprocessor
9/3/2021 25
8085 microprocessor
9/3/2021 26
8085 microprocessor
9/3/2021 27
8085 microprocessor
9/3/2021 28
8085 microprocessor
9/3/2021 29
8085 microprocessor
9/3/2021 30
8085 microprocessor
9/3/2021 31
8085 microprocessor
9/3/2021 32