MPMC Lab Manual
MPMC Lab Manual
1. Programs for 16 bit arithmetic operations for 8086 (using various Addressing Modes)
a) 16 bit addition:
AIM: - To write an assembly language program for Addition of two 16-bit numbers.
OUTPUT:
Input Output
AX 4343 AX 5454
BX 1111
b) Subtraction:
AIM: - To write an assembly language program for subtraction of two 16-bit numbers.
APPARATUS: 1. 8086 microprocessor kit/MASM ----1
2. RPS (+5V) ----1
PROGRAM:
k) By using MASM:
Assume cs: code
Code segment
Start: MOV AX, 4343
MOV BX, 1111
SUB AX, BX
INT 3
Code ends
End start
iii) By using 8086 kit:
OUTPUT:
Input output
AX 4343 AX 3232
BX 1111
c) Multiplication:
AIM: - To write an assembly language program for multiplication of two 16-bit numbers.
OUTPUT:
Input Output
AX 0004 AX 0008
BX 0003
d. Division
AIM: - To write an assembly language program for divison of two 16-bit numbers.
OUTPUT:
Input Output
AX 0003 AX 0004
BX 0006
RESULT:
Aim:
To write an assembly program to move a piece of data from one memory location to another
Apparatus required:
2. RPS (+5V)
Program
(i) By Using MASM
MOV BX,3000
MOV DX,3200
MOV AX,3500
MOV SI,BX
MOV DI,AX
MOV CX,05
CLD
REP
MOVSB
MOV SI,DX
MOV DI,BX
MOV CX,05
CLD
REP
MOVSB
MOV SI,AX
MOV DI,DX
MOV CX,05
CLD
REP
MOVSB
INT 03
(ii) By Using 8086 Kit
OUTPUT:
Memory Location Input Data Memory Location Output Data
Aim:
To write an assembly program to convert ASCII hexadecimal characters
Apparatus required:
1. 8086 microprocessor kit/MASM
2. RPS (+5V)
Program
If the input is valid HEX value (31-39/41-46), the program output that equivalent character as a HEX
value and repeat the sequence.
Apparatus required:
1. 8086 microprocessor kit/MASM
2. RPS (+5V)
Program
If the input is valid ASCII character(1-9/A-F), , the program output that equivalent character as a
ASCII value and repeat the sequence.
Apparatus required:
1. 8086 microprocessor kit/MASM
2. RPS (+5V)
Program
(i) By using MASM
MOV AX,0000
MOV CA,AX
MOV SI,2100
MOV BH,03
MOV AL,[SI]
NXT: INC SI
DEC BH
JZ 201B
MOV BL,[SI]
CMP AL,BL
JNBE NXT
MOV AL,BL
JMP NXT
OVR: INT 03
(ii) By using 8086 kit
OUTPUT:
Result:
Thus the program to find the largest value in an array is executed & output is verified
Sorting value of a String array
6. Find the Sorting value of a String array in ascending order
Aim: To write an assembly language program to sorting the array in ascending order.
Apparatus required:
1. 8086 microprocessor kit/MASM
2. RPS (+5V)
Program
(i) By using MASM
MOV AX,0000H
MOV DS,AX
MOV CS,AX
MOV SI,2600H
MOV CL,[SI]
DEC CL
REPT: MOV SI,2600H
MOV CH,[SI]
DEC CH
INC SI
REPCOM:MOV AL,[SI]
INC SI
CMP AL,[SI]
XCHG AL,[SI]
MOV [SI],AL
INC SI
AHEAD: DEC CH
JNZ REPCOM
DEC CL
JNZ REPT
INT 03H
MEMORY
LOCATION OP-CODE LABEL MNEMONIC
0000: MOV AX,0000H ;NUMBER OF
2000 MOV DS,AX BYTES TO BE
MOV CS,AX
MOV SI,2600H SORTED IS
MOVED TO SI
MOV CL,[SI]
DEC CL
REPT: MOV
SI,2600H ;COUNTER VALUE
FOR INNER LOOP
MOV CH,[SI]
DEC CH
INC SI
REPCOM:MOV
; GET THE FIRST
VALUE TO BE
SORTED
AL,[SI]
INC SI
CMP AL,[SI]
; COMPARE THE
FIRST AND
SECOND VALUE
XCHG AL,[SI]
;EXCHANGE THE
VALUES
ACCORDING TO
THE COMPARISON
MOV [SI],AL \
INC SI
AHEAD: DEC CH
JNZ REPCOM
DEC CL
JNZ REPT
INT 03H ;CONTINUE THE
LOOP UNTILL THE
COMPARISON IS
DONE \
Result:
Thus the program to sorting the value is executed & output is verified
KEYBOARD DISLAY INTERFACE EXERIMENT
Apparatus required:
1. 8086 trainer kit
2. Key Board
3. 7 Segment Display interface unit
Program
Output: This program module display ‘ELECTRO SYSTEMS’ on the interface LEDs with a
present delay
Result:
Thus the program to execute display the ‘ELECTRO SYSTEMS’ on the interface LEDs is
executed & ouput is verified
HEX KEYPAD DISLAY INTERFACE EXERIMENT
Apparatus required:
1. 8086 trainer kit
2. Key Board and display interface unit
3. HEX keypad interface unit
\
Output: This program module display the ‘KEY PRESSED’ on the monitor display using
MASM
Result:
Thus the program to execute display the ‘KEY PRESSED’ on the monitor display is executed &
ouput is verified
9. ARITHMETIC OPERATIONS USING 8051
Apparatus required:
1. 8051 trainer kit
2. RPS +5v
OUTPUT:
Input Output
Memory
Memory address Data address Data
8102 04 8500 06
8103 02
OUTPUT:
Input Output
Memory
Memory address Data address Data
8102 04 8500 02
8103 02
OUTPUT:
Input Output
Memory
Memory address Data address Data
8102 04 8500 08
8103 02
8501 00
OUTPUT:
Input Output
Memory
Memory address Data address Data
8102 08 8500 04
8103 02
8501 00
Result:
Thus the program to execute arithmetic operations using 8086 is executed & output is verified
10. Interface of Stepper motor control using 8086
Aim: To write an assembly program to execute Stepper Motor Control using 8086
Appartus Required:
Ouput:
Result:
Thus the program to interfacing of stepper motor controller using 8086 is executed & output is
verified
11. Analog to digital conversion
Aim: To write an assembly program to using Analog to digital conversion 8086
Appartus Required:
Display 1100
Voltage
00110001 31
maximum
00100101 25
2v
68
3v 01101000
21
4v 00100001
Result: Thus the ALP for interfacing of ADC using 8086 is executed & output is verified