Microprocessor Interfacing Laboratory Bachelor Degree in Engineering

Microprocessor Interfacing Laboratory Bachelor Degree in Engineering

A Laboratory Manual for Microprocessor Interfacing Laboratory (210254) Semester – IV (Computer Engineering) Bachelor Degree in Engineering UNIVERSITY OF PUNE, GANESHKHIND SNJB’s KBJ College Of Engineering, Chandwad DEPARTMENT OF COMPUTER ENGINEERING LABORATORY MANUAL DEVELOPMENT PROJECT Designations Team for design Project Institution Shri Neminath Jain Bramhacharyashram’s SNJB’s KBJ College of Engineering, Neminagar, Chandwad -423101. Project Commencement Dec 2012 Head Of Institution Prof. J. J. Chopade SNJB’s KBJ College of Engineering, Neminagar, Chandwad -423101. Chief Project Coordinator Mr. M .R Sanghavi Head,DepartmentOfComputerEngineering, SNJB’s KBJ College of Engineering, Neminagar, Chandwad -423101. Project Coordinator Ms. K. S. Kotecha AssociateProfessor,DepartmentOfComputer Engineering,KBJ College of Engineering, Neminagar, Chandwad -423101. Subject Experts 1. Mr.V.V Agrawal SNJB’s KBJ College of Engineering, Neminagar, Chandwad -423101 2. Mr.R.R.Bhandari SNJB’s KBJ College of Engineering, Neminagar, Chandwad -423101 JB’s KBJ College Of Engineering, Chandwad DEPARTMENT OF COMPUTER ENGINEERING Certificate This is Certify that Mr/Ms. Com__________________puter Roll No _of Fourth Semester of BacMicroprocessorhelor Engineer Interfacinging in Laboratoryhas completed the term work satisfactorily in in the Academic Year 20_ to 20_ as prescribed in the curriculum. Place Date: Exam Seat No. Subject Teacher Head of Department Principal Stamp of Institution List of Experiment and Record of Progressive Assessment Sr. Name of Experiment Pag Date of Date of Assessment Sign of e No Performance Submission Marks Teacher Write X86 Assembly language N program (ALP) to add array of o 1 N hexadecimal numbers stored in the memory. Accept input from the user. Write 8086 ALP to perform non-overlapped and overlapped 2 block transfer (with and without string specific instructions). Block containing data can be defined in the data segment. Write X86 ALP to convert 4- digit Hex number into its 3 equivalent BCD number and 5- digit BCD number into its equivalent HEX number. Make your program user friendly to accept the choice from user for: (a)HEX to BCD b) BCD to HEX (c) EXIT. Display proper strings to prompt the user while accepting the input and displaying the result. Write 8086 ALP for the following operations on the string 4 entered by the user. a) Calculate Length of the string b) Reverse the string c) Check whether the string is palindrome OR Make your program user friendly by providing MENU like: (a) Enter the string b) Calculate length of string c) Reverse string d) Check palindrome e) Exit Display appropriate messages to prompt the user while accepting the input and displaying the result. Write 8086 ALP to perform string manipulation. The strings 5 to be accepted from the user is to be stored in data segment of program_l and write FAR PROCEDURES in code segment program_2 for following operations on the string: (a) Concatenation of two strings (b) Number of occurrences of a sub-string in the given string Use PUBLIC and EXTERN directive. Create .OBJ files of both the modules and link them to create an EXE file. Write X86 ALP to perform multiplication of two 8-bit 6 hexadecimal numbers. Use successive addition and add and shift method. Accept input from the user. Write 8087ALP to obtain: i) Mean ii) Variance iii) Standard 7 Deviation For a given set of data elements defined in data segment. Also display result. Write 8086 ALP to convert an analog signal in the range of 0V 8 to 5V to its corresponding digital signal using successive approximation ADC and dual slope ADC. Find resolution used in both the ADC's and compare the results. Write 8086 ALP to interface DAC and generate following 9 waveforms on oscilloscope, (i) Square wave - Variable Duty Cycle and Frequency. (ii) Ramp wave - Variable direction, (iii) Trapezoidal wave (iv) Stair case wave Write 8086 ALP to program 8253 in Mode 0, modify the program for hardware retriggerable 10.Monoshot mode. Generate a square wave with a pulse of 1 ms. Comment on the difference between Hardware Triggered and software triggered strobe mode. Observe the waveform at GATE & out pin of 1C 8254 on CRO 11 Perform an experiment to establish communication between two 8251 systems A and B. Program 8251 system A in asynchronous transmitter mode and 8251 system B in asynchronous receiver mode. Write an ALP to transmit the data from system A and receive the data at system B. The requirements are as follows: Transmission: • message is stored as ASCII characters in the memory. • message specifies the number of characters to be transmitted as the first byte. Reception: • Message is retrieved and stored in the memory. • Successful reception should be indicated. 12 Write a TSR program in 8086 ALP to implement Real Time Clock (RTC). Read the Real Time from CMOS chip by suitable INT and FUNCTION and display the RTC at the bottom right corner on the screen. Access the video RAM directly in your routine. 13 Study Assignment Microprocessor and Interfacing Laboratory Second Year Computer Engineering Att (2) Perm(5) Oral(3) Total(10) Sign with Date Assignment 1 Problem Definition: Write X86/64 Assembly language program (ALP) to add array of N hexadecimal numbers stored 1.1 Prerequisites: Concepts of in the memory. Accept input from the user. Program Algorithm Registers Assembly language Assembler Array & its scope 1.2 Learning Objectives: Understand the implementation Understand the implementation of the arithmetic instruction of 80386. 1.3 New concepts:- 1.3.1 What is ALP? Assembly language Program is mnemonic representation of machine code. 1.3.2 Which assembler used in execution of ALP? Three assemblers available for assembling the programs for IBM-PC are: 1. Microsoft Micro Assembler(MASM) 2. Borland Turbo Assembler (TASM) 3. Net wide Assembler (NASM) 1.4 Theory 1.4.1 Assemblydata Basic Syntax An assemblybss program can be divided into three sections: 1. The text section 2. The section 3. The section SNJB’s Late Sau. KBJ COLLEGE OF ENGINEERING Page 7 Microprocessor and Interfacing Laboratory Second Year Computer Engineering The data Section data The section is used for declaring initialized data or constants. This data does not change at runtime.section Youcan.data declare various constant values, file names or buffer size etc. in this section. The syntax for declaring data section is: The bss Section section .bss The bss section is used for declaring variables. The syntax for declaring bss section is: The text section The text section is used for keeping the actual code. This section must begin with the declarationglobal main, sectionwhich tells .text the kernel where the program execution begins. Theglobal syntax main for declaring text section is: main: Assembly Language Statements Assembly language programs consist of three types of statements: 1. Executable instructions or instructions 2. Assembler directives or pseudo-ops 3. Macros executable instructions instructions operation code The or simply tell the processor what to do. Each instructionassembler consists directives of an pseudo-ops(opcode). Each executable instruction generates one machine language instruction. The or tell the assembler about the various aspects of the Macrosassembly process. These are non-executable and do not generate machine language instructions. Assemblyare System basically Calls a text substitution mechanism. System calls are APIs for the interface between user space and kernel space. We are using the system calls sys_write and sys_exit for writing into the screen and exiting from the program Linuxrespectively. System Calls You can make use of Linux system calls in your assembly programs. You need to take the following steps for using Linux system calls in your program: Put the system call number in the EAX register. SNJBStore’s Late theSau. arguments KBJ COLL toEGE the systemOF ENG callINE inE RtheING registers EBX, ECX, etc. Page 8 Microprocessor and Interfacing Laboratory Second Year Computer Engineering Call the relevant interrupt (80h) The result is usually returned in the EAX register There are six registers that stores the arguments of the system call used. These are the EBX, ECX, EDX, ESI, EDI, and EBP. These registers take the consecutive arguments, starting with the EBX Theregister. following If there code are snippetmore than shows six arguments the use of thenthe system the memory call sys_exit: location of the first argument is stored in the EBX register. The followingMOV EAX code, 1 snippet; system shows call numberthe use (sys_exit)of the system call sys_write: INT 0x80 ; call kernel MOV EDX, 4 ; message length MOV ECX, MSG ; message to write MOV EBX,1 ; file descriptor (stdout) MOV EAX,4 ; system call number (sys_write) INT 0x80 ; call kernel The following table shows some of the system calls: Assembly Variables define directives NASM provides various for reserving storage space for variables. The define Assembler directive is used for allocation of storage space. It can be used to reserve as well as initialize one or more bytes. SNJB’s Late Sau. KBJ COLLEGE OF ENGINEERING Page 9 Microprocessor and Interfacing Laboratory Second Year Computer Engineering Allocating Storage Space for Initialized Data There are five basic forms of the define directive: Allocating Storage Space for Uninitialized Data The reserve directives are used for reserving space for uninitialized data. The reserve directives take a single operand that specifies the number of units of space to be reserved. Each define directive has a related reserve directive. There are five basic forms of the reserve directive: 1.6 Instructions needed: 1. MOV-Copies byte or word from specified source to specified destination 2. ROR-Rotates bits of byte or word right, LSB to MSB and to CF 3. AND-AND each bit in a byte or word with corresponding bit in another byte or word 4. INC-Increments specified byte/word by 1 5. DEC-Decrements specified byte/word by 1 6.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    80 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us