Assembly Language: 1.machine Language: This Is The Machine
Assembly Language: 1.machine Language: This Is The Machine
Executing:
MVI A,60H
Causes <A> = 60H
Instruction is used to initialise (set) an 8-
bit register to a desired value.
5. MVI M, data8
(Move to Memory Immediate)
The specified 8 bit data is copied to the
memory location whose address is in
Register pair H..
Example: Let <HL> = 2860H
Executing:
MVI M,20H
Causes <2860H> = 20H
Instruction is used to initialise (set) a
memory location to a desired value.
6. LXI rp, data16
(Load Register Pair Immediate)
The specified register pair rp, is loaded with
the specified 16-bit address or data.
Executing:
LXI H, 2060H
Causes <HL> = 2060H
Instruction is used to initialise (set) a
register pair to a desired 16 bit
address/data
7. LDA address
(Load Accumulator Direct)
The content of the specified memory address
is copied to the Accumulator (Register A)
Example: Assume memory address location
2050H contains 88H i.e. <2050H> = 88H
Executing:
LDA 2050H
Causes <A> = <2050H > = 88H
8. STA address
(Store Accumulator Direct)
The content of the Accumulator is Copied
(stored) to the specified memory address.
Example: Assume the Accumulator contains
22H i.e. <A> = 22H
Executing:
STA 2055H
Causes <2055H > = <A> = 22H
9. LHLD address
(Load H and L Direct)
The contents of 2 memory locations starting at the specified
address are copied to register pair H in this manner:
<L> = <address>
<H> = <<address + 1>
Example: Assume memory locations 2080H and 2081H contain
10H and 15H respectively.
Executing:
LHLD 2080H
Executing:
INR M
Causes <2050H> = <2050>’ + 1
<2050H> = 30H + 1
= 31H
15. DCR r (Decrement Register)
The specified 8-bit register is
decremented by 1
Example: Assume <A> = 30H
Executing:
DCR A
Causes <A> = <A’> - 1
<A> = 30H - 1
= 2FH
16. DCR M (Decrement Memory)
The content of memory location whose address
is in register pair H is decremented by 1.
Example: Register pair H contains memory
address 2030H that happens to contain 41H .
Executing:
DCR M
Causes <2030H> = <2030>’ - 1
<2030H> = 41H - 1
= 40H
17. INX rp
(Increment Register Pair)
The content of the specified register pair is
incremented by 1.
Example: Assume <HL> = 20FFH
Executing:
INX H
Causes <HL> = <HL’> + 1
<HL> = 20FFH + 1
= 2100H
Although Intel 8085 CPU is an 8 bit CPU the INX
instruction is executed 16-bitwise taking care of the
overflow from the lower register.
18. DCX rp
(Decrement Register Pair)
The content of the specified register pair is
decremented by 1.
Example: Assume <BC> = 3100H
Executing:
DCX B
Causes <BC> = <BC’> - 1
<BC> = 3100H - 1
= 30FFH
Although Intel 8085 CPU is an 8 bit CPU the DCX
instruction is executed 16-bitwise taking care of the
borrow into the lower register.
19. DAD rp
(Double Add Register Pair)
The content of the specified register pair is added to the
content of register pair H. The result is stored in register
pair H.
Example: Assume <BC> = 3500H and <HL> = 4700H
Executing:
DAD B
Causes <HL> = <HL’> + <BC>
<HL> = 4700H + 3500H
= 7C00H
Note: Register pair H behaves like a 16 bit Accumulator for
this 16-bit arithmetic operation.
20. DAA
(Decimal Adjust Accumulator)
The content of the Accumulator is
adjusted to BCD according to these rules:
1.A 6 is added to the Accumulator nibble
if a nibble is above 9.
2.A 6 is added to the lower nibble in case
the AC flag = 1 and also a 6 is added to
the upper nibble if the CY flag = 1.
Used for BCD arithmetic.
20. DAA …
Example: Assume <A> = 3AH and
both <CY> and <AC> = 0
Executing:
DAA
Causes <A> = <A’> + 06H
= 3AH + 06H = 40H
20. DAA …
Example: Assume <A> = 71H and
<CY> = 0 but <AC> = 1
Executing:
DAA
Causes <A> = <A’> + 06H
= 71H + 06H = 77H
Exercise
1. Write a program to add two
numbers 40H and 50H and store
the Result at Address 8180H.
2. Write a program to add content of
memory location at 8160H to
content of memory location at
8170H and store the result at
address 8190H.
Solutions to Problem 1
In Assembly language programming there is
no unique solution. It all depends on the logic
one comes up with when programming.