×
Keep asking yourself. "How bad do you want it? how bad?"
--Your friends at LectureNotes
Close

Microprocessor and Microcontroller

by Upesh PatelUpesh Patel
Type: PracticalInstitute: Rashtra Santh Tukduji Maharaj Nagpur University Course: B.Tech Specialization: Electronics and Communication EngineeringOffline Downloads: 2Views: 64Uploaded: 2 months ago

Share it with your friends

Suggested Materials

Leave your Comments

Contributors

Upesh Patel
Upesh Patel
Microprocessor 8086 Programs for Academic Practical Purpose EXPERIMENT NO:- 1 Aim:- To study the architecture of 8086 Microprocessor. EXPERIMENT NO:-2a Aim:- Write a program to perform addition of two 16-bit numbers using 8086. Program:Address Instruction Comments 1000 1001 1002 1003 1004 1005 1006 1007 Opcodes 8B 06 01 11 03 06 03 11 MOV AX,[1101] Move the content of mem. Location 1101H in Reg.AX ADD AX ,[1103] Add the content of mem. Location 1103H in Reg. AX 1008 89 MOV [1105],AX Move the content of reg. AX inMove the content of reg. AX in mem. Location 1105H 1009 100A 100B 100C 100D 100E 100F 1010 1011 1012 1013 1014 1015 06 05 11 C6 C1 00 10 C9 88 0E 07 11 F4 MOV CL, 00H Move 00H in reg. CL ADC CL, CL Add reg. CL with CL with carry MOV [1107], CL Move content of reg. CL into mem. Location 1107H HLT Stop the program EXPERIMENT NO:-2b Aim:- Write a program to perform subtraction of two 32-bit numbers using 8086. Address 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 100A 100B 100C 100D Opcodes 8B 06 40 10 2B 06 04 10 89 26 84 06 50 10 Instruction Comments MOV AX, [1040] Move data of 1040 to reg. AX MOV DX , [1044] Move data of M.L. 1044 to reg. DX SUB AX , DX Sub AX & DX data MOV [1050], AX Move result of AX at M. L. 1050
100E 100F 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 101A 101B 101C 8B 06 42 10 2B 06 46 10 1B 26 88 26 52 10 F4 MOV AX ,[1042] Move 1042 data in reg. AX MOV DX,[ 1046] Move 1046 data in reg. DX SBB AX,DX Subtract with borrow data of AX &DX MOV [1052], AX Move data of AX ie result to mem. Location 1052 HLT Stop EXPERIMENT NO:-3 Aim:- Write a program to multiply 16-bit data present in the memory location 1050H & 1052H. Store the result in the location 1054H. Address 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 100A 100B 100C 100D 100E 100F 1010 1011 1012 Opcodes 8B 06 50 10 8B 1E 52 10 F7 E3 89 16 54 10 89 16 56 10 F4 Instruction Comments MOV AX,[1050]H; Move the contents of memory locations 1050 to 16 bit reg. AX MOV BX,[1052]H Move the contents of memory locations 1052 to 16 bit reg. DX MUL BX Multiply the contents of reg. AX with reg. BX MOV [1054],DX; Move content of 16 bit reg. DX to memory location 1054 H MOV [1056],AX Move content of 16 bit reg. AX into memory location 1056 H HLT Stop
EXPERIMENT NO:-4 Aim:- Write a program to divide 32-bit data present in the memory location 1050H with 16 bit data present on location 1054H.Store the result in the location 1056H. Address 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 100A 100B 100C 100D 100E 100F 1010 1011 1012 1013 1014 1015 1016 Opcodes 8B 06 50 10 8B 16 52 10 8B 1E 54 10 F7 F3 89 06 50 10 89 16 58 10 F4 Instruction Comments MOV AX,[1040]H; Move the contents of memory locations 1040 to 16 bit reg. AX MOV DX,[1042]H Move the contents of memory locations 1042 to 16 bit reg. DX MOV BX , [1044]H; Move content of memory location 1042 to 16bit reg. BX Div BX Divide 32 bit data present in DX-AX pair content of reg. BX MOV [1050],AX; Move content of 16 bit reg. AX to memory location 1050 H MOV [1052],DX Move content of 16 bit reg. DX into memory location 1052 H HLT Stop EXPERIMENT NO:-5 Aim:- A block of 5 byte of data is present from memory location 1040H.Write a program to transfer the block of data from memory location 1050H using 8086. Address 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 100A 100B Opcodes Instruction Comments C6 C1 00 0A C7 C6 40 10 C7 C7 50 10 MOV CX ,000AH Move 000A into 16 bit counter CX MOV SI , 1040 Move 1040 into SI MOV DI ,1050 Move 1050 into DI
100C 100D 100E 100F 1010 1011 1012 1013 1014 8A 04 88 05 46 47 FE 75F6 F4 MOV AX, [SI] Move contain of SI into AX MOV [DI] ,AX Move contain AX into DI INC SI INC DI DEC CX JNZ L1 HLT Increment SI Increment DI Decrease contain by 1 Jump if not zero to L1 Stop EXPERIMENT NO:-6 Aim:- Write a program to exchange two blocks of data present from memory location 1040H & 1050H using 8086. Address Instruction Comments 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 100A 100B 100C 100D 100E 100F 1010 1011 1012 1013 1014 1015 Opcodes C7 C6 40 10 C7 C7 50 10 C7 C1 0A 00 8A 04 88 05 88 14 88 05 46 47 MOV CX, 0009 H Move 0009 H in counter reg. CX MOV SI , 1040 Move address 1040H SI MOV DI ,1050 H Move address 1050 h in DI L1: MOV AL ,[SI] Move the data of SI in reg. AL MOV BL: [DI] Move the data of DI in reg. BL MOV [SI],BL Move data in reg. BL into mem. Location 1040H MOV [DI] ,AL Move the data in reg. AL into mem. Location 1050 H INC SI INC DI 1016 E2 Loop 100CH Increment the content of SI Increment the content of DI Decrement CX by 1 if CX = 0 then jump to mem. Location 100CH 1017 1018 F0 F4 HTL Stop EXPERIMENT NO:-7a Aim:- Write a program to arrange the given series of 8 bit numbers in ascending order. Address 1000 1001 1002 1003 Opcodes C7 C1 0A 00 Instruction Comments MOV CX,000AH Move the immediate data 000A into reg.CX

Lecture Notes