MPMC Lab Manual
MPMC Lab Manual
MICRO PROCESSOR & INTERFACING LAB LIST OF ASSEMBLY LEVEL LANGUAGE PROGRAMS
Sl. No. Name of Program Page No.
8086 P Programs 1 a. Addition of 2-8bit numbers b. Addition of 2-16 bit numbers c. Addition of 5-8 bit numbers d. Addition of 5-16 bit numbers e. Subtraction of 2-8 bit numbers f. Subtraction of 2-16 bit numbers g. Multiplication of 2-8 bit numbers h. Multiplication of 2-16 bit numbers i. Division of 16/8 bit numbers j. Division of 16/16 bit numbers k. Division of 32/16 bit numbers 2 a. Packed BCD to Unpacked BCD b. Packed BCD to ASCII Code 3 a. Largest of Five numbers b. Smallest of Five numbers 4 a. Move Word b. Reverse String c. Ascending Order (Sorting) d. Descending Order (Sorting) Interfacing Programs 1 Elevator - UP 2 Elevator - Down 3 Square Wave 4 Triangular Wave 5 Sawtooth Wave
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 1(a)
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Mnemonic
MOV AX,0000 MOV BX,0000 MOV SI,5000 MOV DI,6000 MOV AL,[SI] INC SI MOV BL,[SI] ADD AX,BX MOV [DI],AX INT 03
Comment
Moving 0000 to AX Register/ Initializing AX Reg. Moving 0000 to BX Register/ Initializing BX Reg. Assigning address location 5000for SI Assigning address location 6000for DI Moving value from SI Location to AX Reg. Increment SI Moving value from SI Location to SX Reg. Addition of AX & BX Registers Moving data from AX reg. to DI location 6000 Interrupt
RESULT:
Performed Addition of two 8-bit numbers using assembly level language program and obtained result in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 1(b)
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonics
MOV AX,0000 MOV BX,0000 MOV CX,0000 MOV SI,6000 MOV DI,7000 MOV AX,[SI] INC SI INC SI MOV BX,[SI] ADD AX,BX JNC Location INC CX MOV [DI],AX INC DI INC DI MOV [DI],CX INT 03
Comments
Location
RESULT:
Performed Addition of two 16-bit numbers using assembly level language program and obtained result in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 1(c):
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc
Opcode
Mnemonic
MOV DX,04 MOV AH,00 MOV BH,00 MOV SI,8000 MOV DI,9000 MOV AL,[SI] INC SI MOV BL,[SI] ADD AX,BX DEC DX JNZ Location MOV [DI],AX INT 03
Comment
Location
RESULT:
Performed Addition of five 8-bit numbers using assembly level language program and obtained values in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 1(d):
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonic
MOV DX,04 MOV CX,0000 MOV SI,5000 MOV DI,6000 MOV AX,[SI] INC SI INC SI MOV BX,[SI] ADD AX,BX JNC Location1 INC CX DEC DX JNZ Location2 MOV [DI],AX INC DI INC DI MOV [DI],CX INT 03
Comment
Location2
Location1
RESULT:
Performed Addition of five 16-bit numbers using assembly level language program and obtained values in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 1(e):
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
AIM: To perform subtraction of two 8-bit numbers using assembly level language in 8086P kit.
Add. Loc.
Opcode
Mnemonic
MOV AX,0000 MOV BX,0000 MOV SI,5000 MOV DI,6000 MOV AL,[SI] INC SI MOV BL,[SI] SUB AL,BL MOV [DI],AX INT 03
Comment
RESULT:
Performed Subtraction of two 8-bit numbers using assembly level language program and obtained values in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 1(f)
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonics
MOV AX,0000 MOV BX,0000 MOV CX,0000 MOV SI,6000 MOV DI,7000 MOV AX,[SI] INC SI INC SI MOV BX,[SI] SUB AX,BX JNC Location INC CX MOV [DI],AX INC DI INC DI MOV [DI],CX INT 03
Comments
Location
RESULT:
Performed Subtraction of two 16-bit numbers using assembly level language program and obtained values in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 1(g)
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonic
MOV AX,0000 MOV BX,0000 MOV SI,5000 MOV DI,6000 MOV AL,[SI] INC SI MOV BL,[SI] MUL BL MOV [DI],AX INT 03
Comment
RESULT:
Performed Multiplication of two 8-bit numbers using assembly level language program and obtained values in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 1(h)
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonics
MOV AX,0000 MOV BX,0000 MOV DX,0000 MOV SI,6000 MOV DI,7000 MOV AX,[SI] INC SI INC SI MOV BX,[SI] MUL BX MOV [DI],AX INC DI INC DI MOV [DI],DX INT 03
Comments
RESULT:
Performed Multiplication of two 16-bit numbers using assembly level language program and obtained values in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 1(i)
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonic
MOV AX,0000 MOV BX,0000 MOV SI,5000 MOV DI,6000 MOV AL,[SI] INC SI INC SI MOV BL,[SI] DIV BL MOV [DI],AX INT 03
Comment
RESULT:
Performed Division of 16-bit by 8-bit number using assembly level language program and obtained values in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 1(j)
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonic
MOV AX,0000 MOV BX,0000 MOV DX,0000 MOV DI,6000 MOV SI,5000 MOV AX,[SI] INC SI INC SI MOV BX,[SI] DIV BX MOV [DX],AX INC DI INC DI MOV [DI],DX INT 03
Comment
RESULT:
Performed Division of 16-bit by 16-bit number using assembly level language program and obtained values in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 1(j)
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonic
MOV AX,0000 MOV BX,0000 MOV DX,0000 MOV DI,6000 MOV SI,5000 MOV AX,[SI] INC SI INC SI MOV DX,[SI] INC SI INC SI MOV BX,[SI] DIV BX MOV [DX],AX INC DI INC DI MOV [DI],DX INT 03
Comment
RESULT:
Performed Division of 32-bit by 16-bit number using assembly level language program and obtained values in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 2(a)
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonic
MOV DI,8000 MOV SI,9000 MOV AX,[SI] AND AX,000F MOV [DI],AL INC DI MOV AX,[SI] AND AX,00F0 MOV CL,04 ROR AX,CL MOV [DI],AL INC DI MOV AX,[SI] AND AX,0F00 MOV CL,08 ROR AX,CL MOV [DI],AL INC DI MOV AX,[SI] AND AX,F000 MOV CL,0C ROR AX,CL MOV [DI],AL INT 03
Comment
RESULT:
Performed logical operations and converted packed BCD to unpacked BCD using assembly level language program and obtained values in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 2(b)
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonic
MOV DI,8000 MOV SI,9000 MOV AX,[SI] AND AX,000F OR AL,30 MOV [DI],AL INC DI MOV AX,[SI] AND AX,00F0 MOV CL,04 ROR AX,CL OR AL,30 MOV [DI],AL INC DI MOV AX,[SI] AND AX,0F00 MOV CL,08 ROR AX,CL OR AL,30 MOV [DI],AL INC DI MOV AX,[SI] AND AX,F000 MOV CL,0C ROR AX,CL OR AL,30 MOV [DI],AL INT 03
Comment
RESULT:
Performed logical operations and converted packed BCD to ASCII code using assembly level language program and obtained values in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 3(a)
8005 8004
8003 8002
8001 8000
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonic
MOV AX,0000 MOV BX,0000 MOV SI,8000 MOV DI,7000 MOV CX,04 MOV AX,[SI] INC SI INC SI MOV BX,[SI] CMP AX,BX DEC CX JNC Loc1 MOV AX,BX MOV [DI],AX JNZ Loc2 INT 03
Comment
Loc2
Loc1
RESULT:
Obtained largest number from given five numbers using assembly level language program and stored in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 3(b)
8005 8004
8003 8002
8001 8000
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonic
MOV AX,0000 MOV BX,0000 MOV SI,8000 MOV DI,7000 MOV CX,04 MOV AX,[SI] INC SI INC SI MOV BX,[SI] CMP AX,BX DEC CX JC Loc1 MOV AX,BX MOV [DI],AX JNZ Loc2 INT 03
Comment
Loc2
Loc1
RESULT:
Obtained smallest number from given five numbers using assembly level language program and stored in specified memory location.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 4(a)
9007 9006 9005 9004 9003 9002 9001 9000 6007 6006 6005 6004 6003 6002
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonic
MOV SI,9000 MOV DI,6000 MOV CX,04 CLD REPE MOVSW INT 03
Comment
RESULT:
Using string operations moved word from one memory location to another using assembly level language program.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 4(b)
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Opcode
Mnemonic
MOV AX,0000 MOV SI,6000 MOV DI,6004 MOV CX,02 MOV AL,[SI] XCHG AL,[DI] MOV [SI],AL INC SI DEC DI DEC CX JNZ Location INT 03
Comment
Location
RESULT:
Using string operations reversed the input string values using assembly level language program.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 4(c)
9007 9006 9005 9004 9003 9002 9001 9000 9007 9006 9005 9004 9003 9002
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Loc3 Loc2
Opcode
Mnemonic
MOV DX,03 MOV SI,9000 MOV CX,DX MOV AX,[SI] INC SI INC SI CMP AX,[SI] JC Loc1 XCHG AX,[SI] DEC SI DEC SI MOV [SI],AX INC SI INC SI DEC CX JNZ Loc2 DEC DX JNZ Loc3 INT 03
Comment
Loc1
RESULT:
Using string operations sorted the input values in ascending order using assembly level language program.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
OUTPUT: 4(c)
9007 9006 9005 9004 9003 9002 9001 9000 9007 9006 9005 9004 9003 9002
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
Add. Loc.
Loc3 Loc2
Opcode
Mnemonic
MOV DX,03 MOV SI,9000 MOV CX,DX MOV AX,[SI] INC SI INC SI CMP AX,[SI] JNC Loc1 XCHG AX,[SI] DEC SI DEC SI MOV [SI],AX INC SI INC SI DEC CX JNZ Loc2 DEC DX JNZ Loc3 INT 03
Comment
Loc1
RESULT:
Using string operations sorted given input values in descending order using assembly level language program.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
EXPERIMENT NO. 1
ELEVATOR INTERFACE (UP)
AIM: To perform Elevator operation to move UP using Assembly level language in 8086P kit.
Add. Loc.
Opcode
Mnemonic
MOV AL,82 MOV DX,0FFC6 OUT DX,AL MOV AL,00 MOV DX,0FFC0 CALL Delay INC AL CMP AL,09 OUT DX,AL JNZ Label INT 03 MOV CX,0F800 LOOP Label1 RET
Comment
Label
Delay Label1
RESULT:
Performed operation of moving elevator from down to up using assembly level language program.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
EXPERIMENT NO. 2
ELEVATOR INTERFACE (DOWN)
AIM: To perform Elevator operation to move DOWN using Assembly level language in 8086P kit.
Add. Loc.
Opcode
Mnemonic
MOV AL,82 MOV DX,0FFC6 OUT DX,AL MOV AL,09 MOV DX,0FFC0 CALL Delay DEC AL CMP AL,00 OUT DX,AL JNZ Label INT 03 MOV CX,0F800 LOOP Label1 RET
Comment
Label
Delay Label1
RESULT:
Performed operation of moving elevator from up to down using assembly level language program.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
EXPERIMENT NO. 3
SQUARE WAVE
AIM: To obtain Square wave form by DAC interface using Assembly level language in 8086P kit.
Add. Loc.
Opcode
Mnemonic
MOV AL,80 MOV DX,0FFC6 OUT DX,AL MOV AL,00 MOV DX,0FFC0 OUT DX,AL MOV DX,0FFC2 OUT DX,AL MOV CX,00FF LOOP Label2 MOV AL,0FF MOV DX,0FFC0 OUT DX,AL MOV DX,0FFC2 MOV CX,0FF LOOP Label3 JMP Label1 INT 03
Comment
Label1
Label2
Label3
RESULT:
Obtained Square waveform using DAC interface using assembly level language program with 8086P.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
EXPERIMENT NO. 4
TRIANGULAR WAVE
AIM: To obtain Triangular waveform by DAC interface using Assembly level language in 8086P kit.
Add. Loc.
Opcode
Mnemonic
MOV AL,80 MOV DX,0FFC6 OUT DX,AL MOV AL,00 MOV DX,0FFC0 OUT DX,AL MOV DX,0FFC2 OUT DX,AL INC AL CMP AL,0FF JNZ Label1 DEC AL MOV DX,0FFC0 OUT DX,AL MOV DX,0FFC2 OUT DX,AL CMP AL,00 JNZ Label2 JMP Label3 INT 03
Comment
Label3 Label1
Label2
RESULT:
Obtained Triangular waveform using DAC interface using assembly level language program with 8086P kit.
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
PUJYA SHRI MADHAVANJI COLLEGE OF ENGINEERING& TECHNOLOGY Department of ECE Microprocessor & Interfacing Laboratory
EXPERIMENT NO. 5
SAWTOOTH WAVE
AIM: To obtain Sawtooth waveform by DAC interface using Assembly level language in 8086P kit.
Add. Loc.
Opcode
Mnemonic
MOV AL,80 MOV DX,0FFC6 OUT DX,AL MOV AL,00 MOV DX,0FFC0 OUT DX,AL MOV DX,0FFC2 OUT DX,AL INC AL CMP AL,0FF JNZ Label1 JMP Label2 INT 03
Comment
Label2 Label1
RESULT:
Obtained Sawtooth waveform using DAC interface using assembly level language program with 8086P kit.