8085 Notes
8085 Notes
Answer:
MVI C, 20H ;loads 20H into register C i.e. C <- 20H
MOV B, C ;copies content of register C to register B
; B <- C (20H)
MVI H, 50H ;loads 50H into register H i.e. H <- 50H
MVI L, 00H ;loads 00H into register L i.e. L <- 00H
MOV M, B ;copies content of register B to memory
; i.e. location pointed by [HL] pair
; i.e. [HL] = [5000H] <- B (20H)
HLT ; program stopped
1
Saurab Tharu(191809)
The output of assembler with corresponding Hex-code, M-cycles and T-states is depicted
as shown in figure below:
The contents of General purpose registers, accumulator, memory (M), flags and some
special registers after the execution of given program is shown below:
2
Saurab Tharu(191809)
The contents of memory location including mnemonics of given program, specified data
after execution is given below:
3
Saurab Tharu(191809)
Answer:
MVI H, 45H ; H = 45H
MVI L, 60H ; L = 60H
MVI A, 54H ; A = 54H
MOV M, A ; M = [4560H] = A = 54H i.e. M = [4560H] = 54H
MOV C, M ; C = M = 54H i.e. C = 54H
MVI H, 56H ; H = 56H
MVI L, 00H ; L = 00H
MVI B, 73H ; B = 73H
MOV M, B ; M = [5600H] = B = 73H i.e. M = [5600H] = 73H
MOV D, M ; D = M = 73H i.e. D = 73H
MOV M, C ; M = [5600H] = C = 54H i.e. M = [5600H] = 54H
MVI H, 45H ; H = 45H
MVI L, 60H ; L = 60H
MOV M, D ; M = [4560H] = D = 73H
HLT ; program stopped
4
Saurab Tharu(191809)
The output of assembler with corresponding Hex-code, M-cycles and T-states is depicted
as shown in figure below:
5
Saurab Tharu(191809)
The contents of General purpose registers, accumulator, memory (M), flags and some
special registers after the execution of given program is shown below:
The contents of memory location including mnemonics of given program, specified data
after execution is given below:
6
Saurab Tharu(191809)
Answer:
LXI H, 7090H ; [H] = 70H and [L] = 90H i.e. [HL] = 7090H
MVI M, 35H ; M = [HL] = 7090H <- 35H
LDA 7090H ; A <- [7090H] i.e. A = 35H
MVI A, 45H ; A = 45H
STA 7100H ; [7100H] <- [A] i.e. 7100H = 45H
HLT ; program stopped
The output of assembler with corresponding Hex-code, M-cycles and T-states is depicted
as shown in figure below:
7
Saurab Tharu(191809)
The contents of General purpose registers, accumulator, memory (M), flags and some
special registers after the execution of given program is shown below:
The contents of memory location including mnemonics of given program, specified data
after execution is given below:
8
Saurab Tharu(191809)
Answer:
suppose [7080H] = 56H
LXI B,7080H ; [B] = 70H and [C] = 80H i.e. [BC] = 7080H
LDAX B ; A =[BC] = [7080H] = 56H i.e. A = 56H
LXI D,7090H ; [D] = 70H and [E] = 90H i.e. [DE] = 7090H
MVI A, 34H ; A = 34H
STAX D ; [D] = [7090H] = A = 34H
HLT ; program stopped
The output of assembler with corresponding Hex-code, M-cycles and T-states is depicted
as shown in figure below:
9
Saurab Tharu(191809)
The contents of General purpose registers, accumulator, memory (M), flags and some
special registers after the execution of given program is shown below:
The contents of memory location including mnemonics of given program, specified data
after execution is given below:
10
Saurab Tharu(191809)
Answer:
LXI H,4590H ; H = 45H and L = 90H i.e. [HL] = 4590H
MVI M,22H ; M = 22H i.e [HL] = [4590H] = 22H
MVI L,91H ; L = 91H
MVI M,4AH ; M = 4AH i.e. [HL] = [4591H] = 4AH
LHLD 4590H ; L = [4590H] = 22H
; H = [4591H] = 4AH
LXI H,AB34H ; H = ABH and L = 34H i.e. [HL] = AB34H
SHLD 7890H ; [7890H] = L = 34H
; [7891H] = H = ABH
HLT ; program stopped
The output of assembler with corresponding Hex-code, M-cycles and T-states is depicted
as shown in figure below:
11
Saurab Tharu(191809)
The contents of General purpose registers, accumulator, memory (M), flags and some
special registers after the execution of given program is shown below:
12
Saurab Tharu(191809)
The contents of memory location including mnemonics of given program, specified data
after execution is given below:
13
Saurab Tharu(191809)
Answer:
LXI B,5678H ; B = 56H and C = 78H i.e. [BC] = 5678H
MOV H,B ; H = B = 56H
MOV L,C ; L = C = 78H
LXI D,89ABH ; D = 89H and E = ABH i.e. [DE] = 89ABH
XCHG ; H = 89H and L = ABH
; D = 56H and E = 78H
MOV B,H ; B = 89H
MOV C,L ; C = ABH
HLT ; program stopped
The output of assembler with corresponding Hex-code, M-cycles and T-states is depicted
as shown in figure below:
14
Saurab Tharu(191809)
The contents of General purpose registers, accumulator, memory (M), flags and some
special registers after the execution of given program is shown below:
15
Saurab Tharu(191809)
The contents of memory location including mnemonics of given program, specified data
after execution is given below:
16
Saurab Tharu(191809)
Answer:
IN 40H ; Read data from input port 40H and store in accumulator(A)
; A = Content received by 40H
MOV B,A ; B = [A] i.e. B = content of A
MVI A,ABH ; A = ABH
OUT 34H ; copies the content of accumulator to the output port 34H
; [34H] = content of A = ABH
HLT ; program stopped
The output of assembler with corresponding Hex-code, M-cycles and T-states is depicted
as shown in figure below:
17
Saurab Tharu(191809)
The contents of General purpose registers, accumulator, memory (M), flags and some
special registers after the execution of given program is shown below:
The contents of memory location including mnemonics of given program, specified data
after execution is given below:
18
Saurab Tharu(191809)
19
Saurab Tharu(191809)
ARITHMETIC INSTRUCTIONS
Answer:
MVI A,34H ; A = 34H
MVI C,45H ; C = 45H
ADD C ; A = A + C = 34H + 45H
ADI 9BH ; A = A + 9BH
HLT ; program stopped
The output of assembler with corresponding Hex-code, M-cycles and T-states is depicted
as shown in figure below:
20
Saurab Tharu(191809)
The contents of General purpose registers, accumulator, memory (M), flags and some
special registers after the execution of given program is shown below:
The contents of memory location including mnemonics of given program, specified data
after execution is given below:
21
Saurab Tharu(191809)
Answer:
MVI A,34H ; A = 34H
MVI C,45H ; C = 45H
SUB C ; A = A - C = 34H - 45H
SUI 9BH ; A = A - 9BH
HLT ; program stopped
The output of assembler with corresponding Hex-code, M-cycles and T-states is depicted
as shown in figure below:
22
Saurab Tharu(191809)
The contents of General purpose registers, accumulator, memory (M), flags and some
special registers after the execution of given program is shown below:
The contents of memory location including mnemonics of given program, specified data
after execution is given below:
23
Saurab Tharu(191809)
3. Illustrate INR, INX, DCR and DCX instructions using a simple ALP.
Answer:
MVI C,6AH ; C = 6AH
INR C ; C = C + 1
LXI B,A35BH ; [BC] = A35BH
INX B ; [BC] = [BC] + 1
DCR B ; B = B - 1
DCX B ; [BC] = [BC] - 1
HLT ; program stopped
The output of assembler with corresponding Hex-code, M-cycles and T-states is depicted
as shown in figure below:
24
Saurab Tharu(191809)
The contents of General purpose registers, accumulator, memory (M), flags and some
special registers after the execution of given program is shown below:
25
Saurab Tharu(191809)
4. Write an ALP to add 16 bit numbers using ADD and ADC instructions.
Answer:
MVI A,45H ; A = 45H
MVI B,F8H ; B = F8H
ADD B ; A = A + B
MVI C,67H ; C = 67H
ADC C ; A = A + C + CY
ADI 78H ; A = A + 78H + CY
HLT ; program stopped
The output of assembler with corresponding Hex-code, M-cycles and T-states is depicted
as shown in figure below:
26
Saurab Tharu(191809)
The contents of General purpose registers, accumulator, memory (M), flags and some
special registers after the execution of given program is shown below:
The contents of memory location including mnemonics of given program, specified data
after execution is given below:
27
Saurab Tharu(191809)
Answer:
The output of assembler with corresponding Hex-code, M-cycles and T-states is depicted
as shown in figure below:
28
Saurab Tharu(191809)
The contents of General purpose registers, accumulator, memory (M), flags and some
special registers after the execution of given program is shown below:
The contents of memory location including mnemonics of given program, specified data
after execution is given below:
29
Saurab Tharu(191809)
Answer:
The output of assembler with corresponding Hex-code, M-cycles and T-states is depicted
as shown in figure below:
30
Saurab Tharu(191809)
The contents of General purpose registers, accumulator, memory (M), flags and some
special registers after the execution of given program is shown below:
The contents of memory location including mnemonics of given program, specified data
after execution is given below:
31
Saurab Tharu(191809)
32
Saurab Tharu(191809)
33
Saurab Tharu(191809)
34
Saurab Tharu(191809)
35
Saurab Tharu(191809)
36
Saurab Tharu(191809)
37
Saurab Tharu(191809)
38
Saurab Tharu(191809)
39
Saurab Tharu(191809)
40
Saurab Tharu(191809)
41
Saurab Tharu(191809)
42
Saurab Tharu(191809)
43
Saurab Tharu(191809)
44
Saurab Tharu(191809)
45
Saurab Tharu(191809)
46