2.Microprocessor Microcontroller Lab 1 2013 Regulation

Please download to get full document.

View again

of 72
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information Report
Category:

Documents

Published:

Views: 3 | Pages: 72

Extension: PDF | Download: 0

Share
Related documents
Description
.Microprocessor
Transcript
  CS6412  –   MICROPROCESSOR AND MICROCONTROLLER LAB DEPT OF CSE 2 EXPT.NO   NAME OF THE EXPERIMENT   PAGE NO 1 Basic arithmetic and Logical operations  3 2 Move a Data Block Without Overlap 10 3 Code conversion, decimal arithmetic and Matrix operations.  11 4 Floating point operations, string manipulations, sorting and searching  17 5 Password Checking, Print Ram Size And System Date  31 6 Counters and Time Delay 36 7 Traffic light control  38 8 Stepper motor control  40 9 Digital clock   42 10 Key board and Display  45 11 Printer status  48 12 Serial interface and Parallel interface  49 13 A/D and D/A interface and Waveform Generation  53 14 Basic arithmetic and Logical operations  59 15 Square and Cube program, Find 2’s complement of a number   70 16 Unpacked BCD to ASCII 72 INDEX www.studentsfocus.com  CS6412  –   MICROPROCESSOR AND MICROCONTROLLER LAB DEPT OF CSE 3 EXPT NO: 01 DATE: AIM: To write an Assembly Language Program (ALP) for performing the Arithmetic operation of two byte numbers. APPARATUS REQUIRED: SL.NO ITEM SPECIFICATION QUANTITY 1. Microprocessor kit 8086 kit 1 2. Power Supply +5 V dc 1 PROBLEM STATEMENT: Write an ALP in 8086 to add and subtract two byte numbers stored in the memory location 1000H to 1003H and store the result in the memory location 1004H to 1005H.Also provide an instruction in the above program to consider the carry also and store the carry in the memory location 1006H.  ALGORITHM: (i) 16-bit addition      Initialize the MSBs of sum to 0    Get the first number.    Add the second number to the first number.    If there is any carry, increment MSBs of sum by 1.    Store LSBs of sum.    Store MSBs of sum. (ii) 16 -bit subtraction      Initialize the MSBs of difference to 0    Get the first number    Subtract the second number from the first number.    If there is any borrow, increment MSBs of difference by 1.    Store LSBs of difference    Store MSBs of difference. (iii)   Multiplication of 16-bit numbers :    Get the multiplier.    Get the multiplicand    Initialize the product to 0.    Product = product + multiplicand    Decrement the multiplier by 1    If multiplicand is not equal to 0,repeat from step (d) otherwise store the product. (iv)   Division of 16-bit numbers.    Get the dividend    Get the divisor    Initialize the quotient to 0.    Dividend = dividend  –   divisor    If the divisor is greater, store the quotient. Go to step g.    If dividend is greater, quotient = quotient + 1. Repeat from step (d)Store the dividend value as remainder.     BASIC ARITHMETIC AND LOGICAL OPERATIONS USING 8086 PROGRAMMING www.studentsfocus.com  CS6412  –   MICROPROCESSOR AND MICROCONTROLLER LAB DEPT OF CSE 4 FLOWCHART ADDITION SUBTRACTION START SET UP COUNTER (CY) GET SECOND OPERAND TO A A = A + B STORE THE SUM START GET FIRST OPERAND TO A SUBTRACT SECOND OPERAND FROM MEMORY STORE THE DIFFERENCE STOP IS THERE ANY CARRY GET FIRST OPERAND   COUNTER = COUNTER + 1 STORE THE CARRY STOP SET UP COUNTER (CARRY) IS THERE ANY CY COUNTER = COUNTER + 1   STORE THE CARRY  NO YES YES  NO www.studentsfocus.com  CS6412  –   MICROPROCESSOR AND MICROCONTROLLER LAB DEPT OF CSE 5 ADDITION ADDRESS Opcodes PROGRAM COMMENTS MOV CX, 0000H Initialize counter CX MOV AX,[1200] Get the first data in AX reg MOV BX, [1202] Get the second data in BX reg ADD AX,BX Add the contents of both the regs AX & BX JNC L1 Check for carry INC CX If carry exists, increment the CX L1 : MOV [1206],CX Store the carry MOV [1204], AX Store the sum HLT Stop the program SUBTRACTION ADDRESS OPCODES PROGRAM COMMENTS MOV CX, 0000H Initialize counter CX MOV AX,[1200] Get the first data in AX reg MOV BX, [1202] Get the second data in BX reg SUB AX,BX Subtract the contents of BX from AX JNC L1 Check for borrow INC CX If borrow exists, increment the CX L1 : MOV [1206],CX Store the borrow MOV [1204], AX Store the difference HLT Stop the program www.studentsfocus.com
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks