Laboratory Experiments Manual MP
Laboratory Experiments Manual MP
Machine
Codes
21, 00, 80
Labels
Mnemonics Operands
8503
7E
MOV
8504
23
INX
8505
66
ADD
8506
8509
32, 03, 80
76
STA
HLT
LXI
Comments
Experimental Results
Input DATA
Memory
8000
8001
Data
26H
62H
RESULT
Memory location
8003
Data
88H
Conclusion:
The addition of two 8-bit numbers is performed using 8085 microprocessor
where sum is 8-bit. Precautions:
1. Properly connect the 8085 microprocessor kit with power
supply terminals. 2.
checking connections
3. Handle the Trainer kit
carefully. Viva-Voice Questions:
a memory location?
3. How you can read a data from a memory
location? 4.
8085 ?
5. What is the function of RESET key of a 8085 microprocessor kit
Machine
Codes
21, 01, 85
Labels
Mnemonics Operands
8003
36, F2
MVI
8005
23
INX
8006
36, 2F
MVI
8008
8009
7E
0E, 00
MOV
MVI
800B
2B
DCX
LXI
Comments
800C
66
ADD
800D
D2, 11, 85
JNC
LEVEL_1
8010
0C
INR
8011
32, 03, 85
STA
8503H
8014
79
MOV
A,C
8015
32, 04, 85
STA
2504 H
8018
76
HLT
LEVEL_1
Experimental Results
Input DATA
Memory
8501
8502
Data
F2H
2FH
RESULT
Memory
8503
8504
Data
82H LSBs of sum
01H MSBs of sum
Conclusion:
The addition of two 8-bit numbers is performed using 8085 microprocessor
where sum is 16-bit. Precautions:
Properly connect the 8085 microprocessor kit with power
supply terminals. Switch on the power supply after checking
connections
Handle the Trainer kit
carefully. Viva-Voice
Questions:
1. What is the function of JNC instruction?
2. What is the difference between conditional and unconditional
jump instruction? 3.
instruction?
4. What is multi byte?
4. Addition of 1
nd
number
Mnemonics
Operands Comments
2A, 01, 85
LHLD
8501 H
8000
EB
XCHG`
8000
2A, 03, 85
LHLD
8503 H
8000
19
DAD
8000
22, 05, 85
SHLD
8505 H
8000
76
HLT
Experimental Results
Memory
location
Input DATA
Data
Memor
y
RESULT
Data
8501
8502
8503
8504
05H
01H
02H
03H
Conclusion:
The addition of two 16-bit numbers is performed using 8085 microprocessor
where sum is 16-bit. Precautions:
1. Properly connect the 8085 microprocessor kit with power
supply terminals. 2.
checking connections
3. Handle the Trainer kit
carefully. Viva-Voice Questions:
instruction? 5.
What is difference
Machine
Codes
21, 50, 80
8103
Labels
H,8050
7E
MOV
A,M
8104
23
INX
8105
86
ADD
8106
8107
810A
27
32, 02, 80
76
DAA
STA
HLT
8002
Experimental Results
Input DATA
Memory
8000
8001
Data
22H
67H
RESULT
Memory location
8002
Data
89H
Conclusion:
The decimal addition of two 8-bit numbers is performed using 8085 microprocessor where sum
is 8-bit.
Precautions:
1. Properly connect the 8085 microprocessor kit with power
supply terminals. 2.
checking connections
3. Handle the Trainer kit
carefully. Viva-Voice Questions:
1. What is the function of DAA instruction?
Machine
Codes
Labels
8000
21, 50, 80
LXI
H,8050H
8003
7E
MOV
A,M
8004
8005
8008
3F
32, 51, 80
76
CMA
STA
HLT
8051H
In the above program, the first two instructions LXI H,8050H and MOV A,M can be
replaced by directly loading the content of location 8050H in accumulator. For this
LDA 8050H can be used.
Experimental Results
DATA
Memory
8050
Data
F0H
RESULT
Memory location
8051
Data
0FH
Conclusion:
The ones complement of an 8-bit numbers is performed using 8085 microprocessor.
Precautions:
1. Properly connect the 8085 microprocessor kit with power
supply terminals. 2.
checking connections
8501H
PROGRAM
Memor
y
Machin
e
Labels
8510
3A, 00, 85
LDA
8500H
8513
8514
2F
C6, 01
CMA
ADI
01H
8516
32, 01, 85
STA
8501H
8519
76
HLT
Experimental Results
DATA
Memory
8500
RESULT
Memory location
Data
8501
10H
Data
F0H
Conclusion:
The twos complement of an 8-bit numbers is performed using 8085
microprocessor. Precautions:
1. Properly connect the 8085 microprocessor kit with power
supply terminals. 2.
checking connections
3. Handle the Trainer kit
CMA instruction?
3. Why ADI 01H is used in
Algorithm
1. Store the number in accumulator from memory location 9000H
2. Move the content of Accumulator in L register and store 85H in H register
3.
When the number is 16, the content of H and L register are 85 and 16H
respectively. Then the H-L register pair represents 8516H memory location.
Memor
y
9100
Machin
e
3A, 00, 90
9103
Labels
9000H
6F
MOV
L, A
9104
9106
26, 85
7E
MVI
MOV
H, 85
A, M
9107
32, 01, 90
STA
9001H
910A
76
HLT
Look up Table
ADDRESS
8500
8501
8504
8509
8516
8525
8536
8549
8564
8581
SUUARE ROOT
00
01
02
03
04
05
06
07
08
09
Experimental Results
ADDRESS
9000 H
SQUARE
16
ADDRESS
9001 H
Result
04
Conclusion:
The square root of 0, 1, 4, 9, 16, 25, 36, 49 , 64 and 81 are determined
using look up table in 8085 microprocessor.
Precautions:
1. Properly connect the 8085 microprocessor kit with power
supply terminals. 2.
checking connections
3. Handle the Trainer kit
carefully. Viva-Voice Questions:
1. How look up table is used to determine the square
of a number? 2. Write some applications of look up
table.
Machin
Labels
e
31, FF, 8C
0E, 0F
Mnemonic Operands
s
LXI
SP,8CFF
MVI
C,0F
8005
21, 50, 8C
LXI
H,8C50
8008
800A
800C
800D
800E
800F
3E, 01
06, 00
E5
LOOP_I
C5
F5
CD, 47, 03
MVI
MVI
PUSH
PUSH
PUSH
CALL
A,01
B,00
H
B
PSW
CLEAR
8012
8015
8018
801B
801E
8021
8022
8023
8024
11, 00, 00
CD, BC, 03
CD, D0, 05
CD, 47, 03
11, 00, 00
F1
C1
E1
23
LXI
CALL
CALL
LXI
CALL
POP
POP
POP
INX
D,0000H
DELAY
OUTPUT
D,0000H
DELAY
PSW
B
H
H
8025
0D
DCR
Comments
Initialize the stack pointer
Load the counter, C
register with 0FH
Starting address where the
display data is stored
A is 01 and B is 00 to
display character in the
Move the content of HL, BC,
PSW and A registers into
stack
Clear the display by using a
subroutine whose address is
Generate 500 ms delay
Display character in data field
To display the number for 500
ms
POP the content of PSW, A,
BC and HL from stack
Increment HL register
pair to display next
Decrement C register
8026
C2, 0C, 80
JNZ
LOOP_I
Input
ADDRESS
8C50
8C51
8C52
8C53
8C54
8C55
8C56
8C57
DATA
00 H
01 H
02 H
03 H
04 H
05 H
06 H
07 H
ADDRESS
8C58
8C59
8C5A
8C5B
8C5C
8C5D
8C5E
8C5F
DATA
08 H
09H
0AH
0B H
0C H
0D H
0E H
0F H
Conclusion:
Display 0 1 2 3 4 5 B C D E F on the data filed of 8085 microprocessor.
Precautions:
1. Properly connect the 8085 microprocessor kit with power
supply terminals. 2.
checking connections
3. Handle the Trainer kit
carefully. Viva-Voice Questions:
1. How we can display any number on the data field of 8085
microprocessor. 3.
display.
PROGRAM
Memor
y
9000
9003
Machin
Labels
e
31, FF, 9C
CD, 47, 03
Mnemonic Operands
s
LXI
SP,9CFF
CALL
CLEAR
9006
9008
9009
900A
0E, 0A
START
AF
47
21, 50, 9C
MVI
XRA
MOV
LXI
C, 06
A
B, A
H, 9C50
900D
900E
900F
9010
E5
LOOP_ I
C5
F5
CD, D0, 05
PUSH
PUSH
PUSH
CALL
H
B
PSW
OUTPUT
9013
9015
9017
3E, 01
06, 00
CD, D0, 05
MVI
MVI
CALL
A, 01
B, 00
OUTPUT
901A
901D
9020
9021
9022
9023
21, 00, 00
CD, BC, 03
F1
C1
E1
23
LXI
CALL
POP
POP
POP
INX
D,0000H
DELAY
PSW
B
H
H
9024
9025
0D
C2, 0D, 90
DCR
JNZ
C
LOOP_ I
C3, 06, 90
JMP
START
Input
ADDRESS
9C50
9C51
9C52
9C53
9C54
DATA
16 H
16 H
16 H
16 H
16 H
ADDRESS
9C55
9C56
9C57
9C58
9C59
9C5A
DATA
10H
0E H
11H
12H
08 H
05 H
Comments
Initialize the stack pointer
Clear the display by using a
subroutine whose address is
Load the counter, C register
A is 00 to display character
in the address field
Starting address where the
display is to be started
Move the content of HL, BC,
PSW and A registers into
stack
Call OUTPUT subroutine to
display characters in address
Initialize A, B for data
to be displayed in data
Call OUTPUT subroutine to
display characters in data
Generate 500 ms delay
POP the content of PSW, A,
BC and HL from stack
Increment HL register
pair to display next
Decrement C register
Jump to LOOP_I if the content
of C is not equal to zero.
Jump to START
(H)
(E)
(L)
(P)
(8)
(5)
Conclusion:
Rolling Display HELP 85 up in the address and data filed of 8085 microprocessor is
performed.
Precautions:
1. Properly connect the 8085 microprocessor kit with power
supply terminals. 2.
checking connections
Add the
;Load FFH in AL
register ;Load 22H in
AL register ;Add
content of BL to AL
17DA:1004 00 D8 17DA:1006 F4
-G 1006
M
O
V
AL,FF MOV
BL,22 ADD
AL,BL HLT
Conclusion:
Initially the program is loaded in the memory location 17DA:1000 to 17DA:1006.
Then the object codes of program the program will be visualized after execution of U
1000 1006 command. If the above program is executed by G1006 command, result
will be displayed on the screen. As result is more that 8 bit, the content of AL is 21
which is LSB and the CY fag is set to detect the MSB.
Precautions:
Properly connect the 8086 microprocessor kit with power supply terminals and
Personal computer. Switch on the power supply after checking connections
Handle the Trainer kit
carefully. Viva-Voice
Questions:
What are the registers are used to
store data? At what condition the
carry fag is set?.
What are the different fags available in 8086?
nd
number.
PROGRAM
C:\>DEBU
G -A 1000
17DA:1000 MOV AX, 4622 ; 16 bit data
in AX. 17DA:1003 MOV BX, 3244 ; 16
bit data in BX.
17DA:1000
command is used to display the object codes of program. When the above program
is executed by G1008 command, result will be displayed on the screen. The content of
AX is 7866H which is the addition of 4622H and 3244H. As sum is 16 bit, no carry
is generated.
Precautions:
1. Properly connect the 8086 microprocessor kit with power supply terminals and
Personal computer. 2.
PROGRAM
C:\>DEBU
G -A 0100
17DA:0100 MOV SI,0300 ; Source address in SI.
17DA:0103 MOV CX,0005 ; Count value is
loaded in CX.
17DA:0106 MOV AX,[SI] ; Load AX with data which is
located by SI 17DA:0108 ADD AX,BX
; Contents of BX
in AX.
17DA:010A INC SI
; Increment SI
17DA:010B INC SI
; Increment SI
17DA:010C MOV BX,AX ; Contents of BX in
AX. 17DA:010E DEC CX
; Decrement
CX 17DA:010F JNZ 0106
; Jump to
0106 if CX0 17DA:0111 HLT
17DA:0112
-U 0100 0111
17DA:0100 BE 00 03 MOV SI,0300
17DA:0103 B9 05 00
MOV
CX,0005 17DA:0106 8B 04
MOV
AX,[SI] 17DA:0108 01 D8
ADD
AX,BX 17DA:010A 46
INC
SI 17DA:010B 46
INC
SI 17DA:010C 89 C3
MOV
BX,AX 17DA:010E 49
DEC
CX 17DA:010F 75 F5
JNZ
0106 17DA:0111 F4
HLT
-ECS:0300
17DA:0300 00.01 00.01 00.02 00.02 00.03 00.03
00.04 00.04 17DA:0308 00.05 00.05
-G 0111
AX=0F0F
BX=0F0F
CX=0000
DX=0000 SP=FFEE
SI=030A
DI=0000 DS=17DA
ES=17DA
SS=17DA
IP=0111 NV UP EI PL ZR NA PE NC 17DA:0111 F4HLT
-
BP=0000
CS=17DA
Conclusion:
The above program is entered in the memory location 17DA:0100 to 17DA:0111.
The U 0100 0111 command is used to display the object codes of program. Five 16-bit
data 0101, 0202, 0303, 0404 and 0505 are entered by the command -ECS:0300
17DA:0300 00.01 00.01 00.02 00.02 00.03 00.03 00.04 00.04 17DA:0308
00.05 00.05.
After addition 0101, 0202, 0303, 0404, and 0505 we get 0F0F.
Therefore, when the program is executed by G0111 command and result will be
displayed on the screen as the content of BX and AX registers, 0F0F.
Precautions:
1. Properly connect the 8086 microprocessor kit with power supply terminals and
Personal computer. 2.
Viva-Voice Questions:
1. What is a string of words?
2. What are the registers are used to
store words? 3.
8086?
6. Which register is used as pointer?
7. What is the command to execute the above program?
register. 2.
Determine 2s
complement of AX .
3.
PROGRAM
C:\>DEBU
G -A 1000
17DA:1000 MOV AX, 2244 ; 16 bit data in AX
17DA:1003 NEG AX
; 2s complement of 16
bit data 17DA:1005 MOV BX, AX ; Result is
stored in BX 17DA:1007 HLT
17DA:1008
-U 1000 1007
17DA:1000 B8 44 22 MOV
AX,2244
17DA:1003 F7 D8
NEG
AX
17DA:1005 89 C3
MOV BX,AX
17DA:1007 F4
HLT
-G 1007
AX=DDBC BX=DDBC CX=0000 DX=0000 SP=0004 BP=20CD
SI=0000 DI=0000 DS=17DA ES=17DA SS=9FFF CS=17DA IP=1007
NV UP EI NG NZ AC PO CY 17DA:1007 F4 HLT
-
Conclusion:
The program for 2s complement of a 16-bit number is stored in the memory location
17DA:1000 to
17DA:1007. The U 1000 1006 command is used to display the object codes of
program. When this program is executed by G1007 command and result will be
available in AX. Therefore the content of AX is copied into BX.
Precautions:
1. Properly connect the 8086 microprocessor kit with power supply terminals and
Personal computer. 2.
What is 1s
complement? 2.
What
is 2s complement?
3. What is the difference between 1s complement and 2s
complement? 4. What is the application of 2s complement
of a number?
Multiply
contents of AL by BL
PROGRAM
C:\>DEBU
;8 bit multiplicand in
G -A 1000
17DA:1000 MOV AL ;8 bit multiplier in
AL,11 17DA:1002 BL
MOV BL,22
17DA:1004 MUL
BL 17DA:1006
HLT 17DA:1007
-U 1000 1006
17DA:1000
B011
17DA:1002
B322
17DA:1004
F6E3
17DA:1006 F4
;Multiply contents of AL by BL
MOV
MOV
MUL
HLT
AL,11
BL,22
BL
-G 1006
AX=0242 BX=0022 CX=0000 DX=0000 SP=0004 BP=20CD
SI=0000 DI=0000 DS=17DA ES=17DA SS=9FFF CS=17DA IP=1006
OV UP EI NG NZ NA PO CY 17DA:1006 F4 HLT
Conclusion:
The program for multiplication of two 8 bit numbers is edited in the memory
location 17DA:1000 to 17DA:1006. The U 1000 1006command is used to display the
object codes of program. This program is executed by G1006 command and result
will be stored in AX register. Hence the result is content of AX=0242H.
Precautions:
1. Properly connect the 8086 microprocessor kit with power supply terminals and
Personal computer. 2.
in AX register.
Algorithm
1. Load first number in AL register.
Write 8086 assembly language program for addition of two string decimal numbers.
Microprocessor Kit 2.
+5V Power supply
3. Personal Computer
4. UPS
Theory : The first string decimal numbers 11 22 33 44 55 are stored in memory locations
17B3:0100 to
17B3:0104. The second string decimal numbers 22 33 55 66 77 are stored in memory
locations 17B3:0400 to 17B3:0404. After addition of two string decimal numbers, the
result will be stored in memory locations 17B3:0500 to 17B3:0504.
Algorithm
1.
2.
Initialize SI and BX as offset address of first and second string decimal numbers.
Initialize DI as offset address of result and number of decimal numbers in a
string is loaded in CX
3.
4.
Add first decimal number from second string decimal numbers with AL
5.
6.
7.
8.
Next decimal number from second string decimal numbers is added with AL and carry
9.
10.
PROGRAM
C:\>DEBU
G -A0100
17B3:0100 MOV
SI,0300 17B3:0103
MOV BX,0400
17B3:0106 MOV
DI,0500 17B3:0109
MOV CX,0005
17B3:010C MOV AL,
[SI] 17B3:010E ADD
AL,[BX] 17B3:0110
DAA 17B3:0111 MOV
[DI],AL 17B3:0113
DEC CX 17B3:0114
INC SI 17B3:0115 INC
BX 17B3:0116 INC DI
17B3:0117 MOV AL,
[SI] 17B3:0119 ADC
AL,[BX] 17B3:011B
DAA 17B3:011C MOV
[DI],AL 17B3:011E
DEC CX 17B3:011F
JNZ 0114 17B3:0121
HLT 17B3:0122
;
L
o
a
d
0
3
0
0
H
i
n
S
I
a
s
-U 0100 0121
17B3:0100 BE 00 03 MOV SI,0300
17B3:0103 BB 00 04
MOV
BX,0400 17B3:0106 BF 00 05
MOV
DI,0500 17B3:0109 B9 05 00
MOV
CX,0005 17B3:010C 8A 04
MOV
AL,[SI] 17B3:010E 02 07
ADD
AL,[BX] 17B3:0110 27
DAA
17B3:0111 88 05
MOV [DI],AL
17B3:0113 49
DEC
CX 17B3:0114 46
INC
SI 17B3:0115 43
INC
BX 17B3:0116 47
INC
DI 17B3:0117 8A 04
MOV
AL,[SI] 17B3:0119 12 07
ADC
AL,[BX] 17B3:011B 27
DAA 17B3:011C 88 05
MOV
[DI],AL 17B3:011E 49
DEC
CX 17B3:011F 75 F3
JNZ
0114 17B3:0121 F4
HLT
-ECS:0300
17B3:0300 00.11 00.22 00.33
00.44 00.55 -ECS:0400
17B3:0400 00.22 00.33 00.55
00.66 00.77 -G0121
AX=0033 BX=0404 CX=0000 DX=0000 SP=FFEE BP=0000
SI=0304 DI=0504 DS=17B3 ES=17B3 SS=17B3 CS=17B3
IP=0121 NV UP EI PL ZR NA PE CY 17B3:0121 F4 HLT
-ECS:0500
17B3:0500 33.
55. 88. 10. 33.
Conclusion:
The above program can be used for addition of two string decimal numbers. The U
0100 0121 command is used to display the object codes of program. The ECS:0300
and ECS:0400 command are used to enter first string 11 22 33 44 55 and second
string 22 33 55 66 77 respectively. The program is executed by G0121 command and
after addition result 33 55 88 10 33 will be stored in memory location 17B3:0500
to 17B3:0404.
Precautions:
1. Properly connect the 8086 microprocessor kit with power supply terminals and
Personal computer. 2.
in CX register. 2.
3. Compare the word from memory with content of accumulator AX. If the word is
above and equal to AX, jump to step-5
4. Move word from memory
to AL 5. Increment SI by 2
6. Decrement CX. If CX0, jump to step- 3
7. Store result in memory location 17B3:0400.
PROGRAM
C:\>DEBU
G -A0100
17B3:0100 MOV SI,0300 ; Initialize SI with 0300H as source offset
address of word 17B3:0103 MOV CX,0005 ; Count value of words in
CX
17B3:0106 MOV AX,0000 ; Initialize AX with 0000H
17B3:0109 CMP AX,[SI] ; compare word from memory
with AX 17B3:010B JAE 010F
; Jump to 010F if
above and equal 17B3:010D MOV AX,[SI] ; Load word
from memory
17B3:010F INC SI
;
Increment
SI
17B3:0110 INC SI
; Increment SI
17B3:0111 LOOPNZ 0109
; If CX0,
jump to0109
17B3:0113 MOV [0400],AX ; Store the content of AX at
destination address 17B3:0116 HLT
-U 0100 0116
17B3:0100 BE 00 03 MOV SI,0300
17B3:0103 B9 05 00
MOV
CX,0005 17B3:0106 B8 00 00
MOV
AX,0000 17B3:0109 3B 04
CMP
AX,[SI] 17B3:010B 73 02
JNB
010F 17B3:010D 8B 04
MOV
AX,[SI] 17B3:010F 46
INC
SI 17B3:0110 46
INC
SI 17B3:0111 E0 F6
LOOPNZ 0109
17B3:0113 A3 00 04 MOV
[0400],AX
17B3:0116 F4
HLT
-ECS:0300
17B3:0300 00.11 00.11 00.22 00.22 00.33 00.33
00.FF 00.FF 17B3:0308 00.99 00.99
-G0116
AX=FFFF BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000
SI=030A DI=0000 DS=17B3 ES=17B3 SS=17B3 CS=17B3 IP=0116
NV UP EI PL NZ NA PE NC 17B3:0116 F4 HLT
-ECS:0400
17B3:0400 FF. FF.
Conclusion:
The five 16-bit data or word 1111, 2222, 3333, FFFF, and 9999 are stored in the
memory location starting from 17B3:0300 to 17B3:0309.
number is FFFFH. After execution of above program, the largest number is stored in
memory location 17B3:0400 and it can be displayed by ECS:0400 command as given
above.
Precautions:
1. Properly connect the 8086 microprocessor kit with power supply terminals and
Personal computer. 2.
Write 8086 assembly language program to arrange a string of words in descending order.
Algorithm
1. Store 0005H, number of words to be arranged in DX register from memory
and store number of comparisons in CX register
st
DEC
INC
INC
MOV
INC
INC
CMP
CX 17B3:0108 46
SI 17B3:0109 46
SI 17B3:010A 8B 04
AX,[SI] 17B3:010C 46
SI 17B3:010D 46
SI 17B3:010E 3B 04
AX,[SI]
17B3:0110 73 06
JNB 0118
17B3:0112 87 04
XCHG AX,[SI]
17B3:0114 4E
DEC
SI
17B3:0115 4E
DEC
SI 17B3:0116 89 04 MOV
[SI],AX
17B3:0118 E2 F0
LOOP
010A 17B3:011A 4A
DEC
DX 17B3:011B BE 00 03
MOV
SI,0300 17B3:011E 75 E5 JNZ
0105 17B3:0120 F4
HLT
-ECS:0300
17B3:0300 00.05 00.00 00.11 00.11 00.55 00.55
00.33 00.33 17B3:0308 00.22 00.22 00.44 00.44
-G0120
AX=3333 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000
SI=0300 DI=0000 DS=17B3 ES=17B3 SS=17B3 CS=17B3
IP=0120 NV UP EI PL ZR NA PE NC 17B3:0120 F4 HLT
-ECS:0300
17B3:0300 05.
00. 55. 55. 44. 44.
33. 33. 17B3:0308 22. 22.
11. 11.
Conclusion:
The above program is used to arrange a string of words in descending order and this
program is stored into memory 17B3:0100 to 17B3:0120. The U 0100 0120 command
is used to display the object codes of the above program. The 5 words (1111H,
5555H,
Thereafter G0120 is used to execute the program and words will be stored in
descending order (5555H, 4444H 3333H, 2222H, and 1111H) as given above.
Precautions:
1. Properly connect the 8086 microprocessor kit with power supply terminals and
Personal computer. 2.
AX,[SI]
4. UPS
Theory :
a11
a12
The transpose of a matrix A
=
a 21
a 22 a
31
a32
a13
a11 a 21 a31
a 23
a 22
is A = a12
T
a
a32
33
a13
a 23 a33
The matrix A is stored in the memory location 17B3:0200 to17B3:0209. After transpose, A
matrix will be
stored in the memory location 17B3:0300 to17B3:0309.
Algorithm
1. Store source address of matrix A in SI and store destination
T
address of A in DI 2.
register
3. Load element of matrix A from
memory to AL 4. Store element into
destination address
5. Increment SI by three and DI by one
6. Load element of matrix A from memory to AL and store into
destination address 7.
Subtract 05 from SI
17B3:0103 BF 00 03 MOV
DI,0300
17B3:0106 B1 03
MOV
CL,03 17B3:0108 8A 04
MOV
AL,[SI]
17B3:010A 88 05
MOV [DI],AL
17B3:010C 83 C6 03
ADD
SI,
+03 17B3:010F 47
INC
DI 17B3:0110 8A 04 MOV AL,[SI]
17B3:0112 88 05
MOV
[DI],AL 17B3:0114 83 C6 03
ADD
SI,+03 17B3:0117 47
INC
DI
17B3:0118 8A 04
MOV AL,[SI]
17B3:011A 88 05
MOV
[DI],AL 17B3:011C 83 EE 05
SUB
SI,+05 17B3:011F 47
INC
DI 17B3:0120 FE C9
DEC
CL 17B3:0122 75 E4
JNZ
0108 17B3:0124 F4
HLT
-ECS:200
17B3:0200 11.
22. 33. 44. 55. 66.
77. 88. 17B3:0208 99. 00.
-G124
AX=0099 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000
SI=0203 DI=0309 DS=17B3 ES=17B3 SS=17B3 CS=17B3
IP=0124 NV UP EI PL ZR NA PE NC 17B3:0124 F4 HLT
-ECS:0300
17B3:0300 11.
44. 77. 22. 55. 88.
33. 66. 17B3:0308 99.
Conclusion:
This program can be used to find transpose of a 3x3 matrix. The ECS : 200 command
is used to enter the matrix elements of A such as 11, 22, 33, 44, 55, 66, 77, 88 and
T
99. When we execute the program using G0124 command, A of matrix A will be
T
stored in the destination address. To display the result, ECS : 0300 will be used and A
will displayed on screen as 11, 44, 77, 22, 55, 88, 33, 66 and 99
Precautions:
1. Properly connect the 8086 microprocessor kit with power supply terminals and
Personal computer. 2.
transpose of a matrix?
AIM:
Write 8086 assembly language program to find the factorial of BCD number.
Precautions:
1. Properly connect the 8086 microprocessor kit with power supply terminals and
Personal computer. 2.
connections