You are on page 1of 84

Jyothy Institute of Technology
(Affiliated to V.T.U., Belagavi)
Off Kanakpura Road, Tataguni, Bengaluru – 560082

MP & MC Laboratory
15CSL48

Department of Information Science and Engineering
2016-2017

FOREWORD

It gives me a great amount of pleasure and pride to present this manual for µP and µC
Laboratory. I would like to appreciate the efforts put in by the faculty of both the departments
of CSE and ISE in this endeavour. The presentation of the laboratory manual is very aesthetic
and I believe it will be greatly useful for all students and faculty fraternity. I congratulate our
departments on the successful completion of this work and thank all the people responsible
for this directly or indirectly.

Dr. Mahendra K V
Principal
Jyothy Institute of Technology

ACKNOWLEDGEMENTS

Any work is done only with enough support from people around us. The same is true for this
as well. We have been genuinely supported by our friends, colleagues and families in what
appeared initially to be a herculean task making it look like cake walk on completion.

We would like to extend our heart felt gratitude to the Management of JIT, for presenting us
with the challenges that made us better.

We would also like to thank M/S ALS, Bangalore for providing support related to ARM kits
and Programs.

We thank our beloved Principal Dr. Mahendra K V, for supporting us throughout the process
of writing this manual and for being kind enough to write a befitting foreword to it.

We thank Prof. Nagaraj A, HOD-ISE for being a source of constant appreciation and support
without whom this endeavour would have been near impossible.

Finally we would like to thank our students and colleagues who have directly or indirectly
helped us in making this thought real.

Team
Department of CSE & ISE
Jyothy Institute of Technology

Nagaraj A 2. Harish K Hardware and Software Solutions: 1. Vadiraja A 5. Prof. Pruthvi Kumar K R 4. Prof. Prof. Ravi. Team Editors: 1. Mr. Prof. Vadiraja A . Marketing Manager. Prof. Prof. Advanced Electronics Systems Front Page Design: 1. Abhishek K 3.

The board layout and the circuit diagram of the interface are to be provided to the student Dept. Any suitable assembler like MASM/TASM/8086 kit or any equivalent software may be used. Keyboards. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 SCHEME and SYLLABUS MICROPROCESSOR AND MICROCONTROLLER LABORATORY [As per Choice Based Credit System (CBCS) scheme] (Effective from the academic year 2016 -2017) SEMESTER – IV Subject Code 15CSL48 IA Marks 20 Number of Lecture Hours/Week 01 I + 02 P Exam Marks 80 Total Number of Lecture Hours 40 Exam Hours 03 CREDITS – 02 Course objectives: This course will enable students to: To provide practical exposure to the students on microprocessors. Note: These TWO Laboratory sessions are used to fill the gap between theory classes and practical sessions. The same information is also taught in theory class. this helps the students to understand better. Description Demonstration and Explanation hardware components and Faculty in-charge should explain 8086 architecture. etc. Both sessions are evaluated as lab experiments for 20 marks. this helps the students to understand better. Program should have suitable comments. Timing diagrams. pin diagram in one slot. To give the knowledge and practical exposure on connectivity and execute of interfacing devices with 8086/ARM kit like LED displays. Laboratory Session-2: Write-up on Instruction group. Pin diagram and description. of CSE/ISE Jyothy Institute of Technology Page 1 . the Faculty in-charge should explain instruction set types/category etc. The second slot. Laboratory Session-1: Write-up on Microprocessors. Experiments Develop and execute the following programs using 8086 Assembly Language. The same information is also taught in theory class. and various other devices. design and coding Knowledge on 80x86 family/ARM. DAC/ADC. Students have to prepare a write-up on the same and include it in the Lab record and to be evaluated. 8086 Functional block diagram.

Dept. 4 Develop an assembly language program to compute nCr using recursive procedure. Adopt Bubble Sort algorithm to sort given elements. of CSE/ISE Jyothy Institute of Technology Page 2 . b) Design and develop an assembly program to read the status of two 8-bit inputs (X & Y) from the Logic Controller Interface and display X*Y. KEIL IDE and Proteus for simulation 1 Sign and develop an assembly language program to search a key element “X” in a list of „n‟ 16-bit numbers. Introduce suitable delay between successive steps. Software Required: Open source ARM Development platform. Ensure a flashing rate that makes it easy to read both the messages (Examiner does not 45specify these delay values nor is it necessary for the student to compute these values). 7 To write and simulate C Programs for ARM microprocessor using KEIL (Demonstrate with the help of a suitable program) 8 a) Design and develop an assembly program to demonstrate BCD Up-Down Counter (00-99) on the Logic Controller Interface. Assume that „n‟ and „r‟ are non-negative integers. 10 Design and develop an assembly program to drive a Stepper Motor interface and rotate the moto56r in specified direction (clockwise or counter-clockwise) by N steps (Direction and N are specified by the examiner). 3 Develop an assembly language program to reverse a given string and verify whether it is a palindrome or not. Adopt Binary search algorithm in your program for searching. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 during the examination. 9 Design and develop an assembly program to display messages “FIRE” and “HELP” alternately with flickering effects on a 7-segment display interface for a suitable period of time. 5 Design and develop an assembly language program to read the current time and Date from the system and display it in the standard format on the screen 6 To write and simulate ARM assembly language programs for data transfer. 2 Design and develop an assembly program to sort a given set of „n‟ 16-bit numbers in ascending order. Display the appropriate message. arithmetic and logical operations (Demonstrate with the help of a suitable program). (Any arbitrary value for the delay may be assumed by the student).

b. Generate the Sine Wave using DAC interface (The output of the DAC is to be displayed on the CRO). (The output of the DAC is to be displayed on the CRO).ARM7TDMI/LPC2148.ARM7TDMI/LPC2148. Write a program to rotate stepper motor. 12 To interface LCD with ARM processor-. Dept. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 11 Design and develop an assembly language program to a. Generate a Half Rectified Sine waveform using the DAC interface. Write and execute programs in C language for displaying text messages and numbers on LCD 13 To interface Stepper motor with ARM processor-. of CSE/ISE Jyothy Institute of Technology Page 3 .

MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 INDEX Serial Content Page No Number 1 5 MASM Commands 2 Introduction 9 3 Lab Programs 19 4 Additional Programs 63 5 Viva Questions and applications 67 6 Appendix 73 Dept. of CSE/ISE Jyothy Institute of Technology Page 4 .

model tiny/small/medium/large . Initialize data . Which is used in program .asm After this command executed in command prompt an editor window will open. Program should be typed in this window and saved. of CSE/ISE Jyothy Institute of Technology Page 5 .code .asm After this command is executed in command prompt if there are no errors in program regarding to syntax the assembler will generates an object module as discuss above.data . end To run the program. The program structure is given below.obj Dept. C:/foldername>link filename. the following steps have to be followed: C:/foldername>masm filename. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 MASM COMMANDS: C :/>cd foldername C:/foldername>edit filename. Structure of Program: .Stack <some number> . Program logic goes here .

Dept. TASM etc. All the programs to be executed using an assembler like MASM. Used to execute interrupt or procedure during stepwise execution of program __ q .exe After generating EXE file by the assembler it‟s the time to check the output. Note:  Develop and execute the following programs using an 8086 Assembly Language. For this the above link command should be executed and it will give an EXE file if the model directive is small as discuss above. complete execution of program in single step. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 After verifying the program for correct syntax and the generated object files should be linked together. __d ds: starting address or ending address .  Program should have suitable comments. To see data in memory locations __p . For this the above command is used and the execution of the program can be done in different ways. __ t . Stepwise execution. To quit the execution.  The board layout and the circuit diagram of the interface are to be provided to the student during the examination. C:/foldername>debug filename. It is as shown below: __ g . of CSE/ISE Jyothy Institute of Technology Page 6 .

21 3 Develop an assembly language program to reverse a given string and verify whether it is a palindrome or not. 30 7 To write and simulate C Programs for ARM microprocessor using KEIL (Demonstrate with the help of a suitable program) 37 8 c) Design and develop an assembly program to demonstrate BCD Up-Down Counter (00- 99) on the Logic Controller Interface. Display the appropriate message. 24 4 Develop an assembly language program to compute nCr using recursive procedure. 16 2 Design and develop an assembly program to sort a given set of „n‟ 16-bit numbers in ascending order. 26 5 Design and develop an assembly language program to read the current time and Date from the system and display it in the standard format on the screen 28 6 To write and simulate ARM assembly language programs for data transfer. d) Design and develop an assembly program to read the status of two 8-bit inputs (X & 37 Y) from the Logic Controller Interface and display X*Y. Adopt Binary search algorithm in your program for searching. arithmetic and logical operations (Demonstrate with the help of a suitable program). of CSE/ISE Jyothy Institute of Technology Page 7 . Description no No 1 Sign and develop an assembly language program to search a key element “X” in a list of „n‟ 16-bit numbers. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 LAB PROGRAMS SOFTWARE & HARDWARE PROGRAMS: Sl P. Adopt Bubble Sort algorithm to sort given elements. Assume that „n‟ and „r‟ are non-negative integers. 9 Design and develop an assembly program to display messages “FIRE” and “HELP” alternately with flickering effects on a 7-segment display interface for a suitable period of 43 Dept.

(Any 45 arbitrary value for the delay may be assumed by the student). Introduce suitable delay between successive steps. Ensure a flashing rate that makes it easy to read both the messages (Examiner does not 45specify these delay values nor is it necessary for the student to compute these values). Write and execute programs in C language for displaying text messages and numbers on LCD 52 13 To interface Stepper motor with ARM processor-. 11 Design and develop an assembly language program to a.ARM7TDMI/LPC2148. (The output of the DAC is to be displayed on the CRO). 10 De52sign and develop an assembly program to drive a Stepper Motor interface and rotate the moto56r in specified direction (clockwise or counter-clockwise) by N steps (Direction and N are specified by the examiner). Generate the Sine Wave using DAC interface (The output of the DAC is to be displayed on the CRO). Generate a Half Rectified Sine waveform using the DAC interface. 12 To interface LCD with ARM processor-. 56 Dept. 38 b.ARM7TDMI/LPC2148. of CSE/ISE Jyothy Institute of Technology Page 8 . Write a program to rotate stepper motor. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 time.

of CSE/ISE Jyothy Institute of Technology Page 9 .  Any microprocessor has minimum three basic functional blocks: Arithmetic Logic Unit (ALU). the Bus Interface Unit (BIU) and Execution Unit (EU). MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 MICROPROCESSOR  A Microprocessor is a programmable.Assembler. The block diagram of 8086 is as shown. Figure: Internal block diagram Dept. Figure: 8086 IC 8086 Internal Block diagram 8086 is a 16-bit processor having 16-bit data bus and 20-bit address bus. This can be subdivided into two parts. Timing & Control unit. digital logic device fabricated on a single VLSI chip which can perform a set of arithmetic and logic operations as per the instructions given by the user. Register array  The user writes his/her programs using English-like words (called mnemonics) and is known as assembly language program (ALP). The processor internally decodes this binary code and performs the operation. converts the user ALP into HEX/binary form (called machine language) which is fed to the processor.  A software called .

the Flag register. CX and DX.. Figure: Architecture of 8086 Dept. BH. DX =>DL. EXECUTION UNIT: The execution unit consists of: General purpose (scratch pad) registers AX. index registers source index (SI) & destination index (DI) registers. CX => CL. Once this address is sent OUT of BIU. of CSE/ISE Jyothy Institute of Technology Page 10 . BX. DH. Pointer registers SP (Stack Pointer) and BP (Base Pointer). It is responsible for all the external bus operations like opcode fetch. I/O read/write etc. AX => AL. CH. an adder to generate 20 bit address and instruction pre-fetch queue. the instruction and data bytes are fetched from memory and they fill a 6-byte First In First Out (FIFO) queue. memory read. memory write. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 BUS INTERFACE UNIT: The BIU consists of segment registers. the ALU to perform operations and a control unit with associated internal bus. AH. The 16-bit scratch pad registers can be split into two 8-bit registers. BX =>BL.

Decimal Arithmetic AH Byte Multiply. Word I/O operations Operations AL As accumulator in Byte Multiply. Indirect I/O Dept. as counter in Loops CL As counter in Variable Shift and Rotate operations DX Word Multiply. Byte I/O. translate. Byte Divide BX As Base register to hold the address of memory CX String Operations. Different registers and their operations are listed below: Register Uses/Operations AX As accumulator in Word multiply & Word divide operations. of CSE/ISE Jyothy Institute of Technology Page 11 . word Divide. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 Note: All registers are of size 16-bits. Byte Divide.

MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 Dept. of CSE/ISE Jyothy Institute of Technology Page 12 .

After the execution of the instruction. 8086 Flag Register format Programming Models: Depending on the size of the memory the user program occupies. the results may go back to memory or to the output peripheral devices as the case may be. The instructions are decoded and further data (if necessary) are fetched from memory. different types of assembly language models are defined. Subsequent addresses are sent OUT and the queue is filled up to 6 bytes. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 The Execution of Instructions in 8086: The microprocessor sends OUT a 20-bit physical address to the memory and fetches the first instruction of a program from the memory. of CSE/ISE Jyothy Institute of Technology Page 13 .  TINY : All data and code in one segment  SMALL : one data segment and one code segment  MEDIUM : one data segment and two or more code segments  COMPACT : one code segment and two or more data segments  LARGE : any number of data and code segments Dept.

The second file is called “list file” with an extension “. the binary codes for each instruction. Norton Editor Using the editor. This file is called . the first file. The assembler generates two files from the source file. Note: The assembler generates only offsets (i. Unless all the errors are corrected. When you typed all your program. and puts this information in a symbol table. file. the program cannot be executed in the next step... The assembler checks for the correct syntax in the assembly instructions and provides appropriate warning and error messages.lst”.obj” which contains the binary codes for instructions and information about the addresses of the instructions. you can also edit/delete/modify already existing files. having a “. Ex: WordStar. the offset of labels etc. Dept. that is calculated during the first pass. you must give the file extension as “.source. The next step is to convert this source file into a machine 2.asm” extension. it determines the displacement of named data items. On the second pass. not absolute physical Addresses. Any statement beginning with semicolon is treated as comment.asm”.e. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 Assembly Language Development Tools: 1.s a system software (program) which allows users to create a file containing assembly Instructions and statements. etc. called the object file having an extension “. This file contains the assembly language statements.. the assembler produces the binary code for each instruction and inserts the offsets. ASSEMBLER: An “assembler” is a system software (program) used to translate the assembly language mnemonics for instructions to the corresponding binary codes. DOS Editor. On the first pass. You have to open your file again using the editor to correct the errors and reassemble it using assembler. of CSE/ISE Jyothy Institute of Technology Page 14 . and the offset for each inst. Follow the AL syntax while typing the programs Editor stores the ASCII codes for the letters and numbers keyed in. effective addresses). you have to save the file on the disk. While saving. EDITOR: It. An assembler makes two passes thro your source code. It also indicates any syntax errors or typing errors in the source program.

A debugger is a program which allows you to load your object code program into system memory.obj” file. The LINK program must be run on “. in the memory. 4. For large programs.exe” file. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 3. DEBUGGER: If your program requires no external hardware. The “.exe” file is converted into “.). IBM PC DOS environment comes with EXE2BIN loader program. this file is called relocatable.bin” file The physical addresses are assigned at run time by the loader. 5. LINKER: It’s a program used to join several object files into one large object file. or .exe” file. When all the modules work. execute the program and troubleshoot or debug it. usually several modules are written and each module is tested and debugged. so that this can be put anywhere in physical primary memory later (by another program called .loader. The linker produces a link file which contains the binary codes for all the combined modules. The linker produces link files with “. factorial etc) can be kept in a library and linked to other programs when needed. assembler does not know about the segment starting addresses at the time program being assembled. Dept. Therefore. LOADER:  It is a program used to assign absolute physical addresses to the segments in the “. The linker also produces a link map file which contains the address information about the linked files. The linker assigns only relative addresses starting from zero. The debugger also allows you to look at the contents of registers and memory locations after you run your program. So. of CSE/ISE Jyothy Institute of Technology Page 15 . Object modules of useful programs (like square root. you can use a program called debugger to load and run the “.exe” extension. their object modules can be linked together to form a complete functioning program.locator.

LEDs.mode2 1 . direction Direction 0 – mode 0 Direction Direction 01 – mode 1. if facilitates to set up breakpoints in your program. Also. If you are using a prototype SDK 86 board. 8255 Programmable Peripheral Interface: 8255 is a programmable peripheral IC which can be used to interface computer (CPU) to various types of external peripherals such as: ADC. Switches etc.input 1 . and other easy- to-use features. Control Word format D7 D6 D5 D4 D3 D2 D1 D0 1 for I/O PA mode: PA PCU(upper) PB mode PB PCU(upper) 00 – mode 0. B and C and a Control word register. single step feature.input Dept.input 1 . 0 – output 0 – output 1 – mode 1 0 – output 0 – output 10/11. User can program the operation of ports by writing appropriate 8-bit “control word” into the control word register. of CSE/ISE Jyothy Institute of Technology Page 16 . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 The debugger allows you to change the contents of registers & memory locations and rerun the program. DAC..monitor program. Motor.input 1 . the debugger is usually called . It has 3 ports A. Keyboard. 7-segment displays.

Also.obj” and not as “. The assembler checks the syntax of your program and creates “. You have to correct the errors by opening your file with EDIT command and changing your instructions. If there are no linker errors. memory locations assigned. Exit the Editor using File menu or pressing ALT + F + X. register contents etc.asm” extension. your program using the menu options.asm). Press Enter key 2 or 3 times. command to enter data into memory and .obj” file.asm”). At the prompt. 5. (say test. Try to correct them also. it indicates the error with line numbers. In many ways. machine codes. then you can type the name of the file at the prompt and press Enter key. command to display memory contents. test. 4. Otherwise. 3. . Come back to DOS prompt and again assemble your program using MASM command.0 Severe Errors. CV (Code View) is like Turbo C environment.asm (say. a. In the workspace. of CSE/ISE Jyothy Institute of Technology Page 17 .obj) and press Enter key. (Note that you have to give the extension now as “.. Now. your program is ready to run. At the prompt.. Here you can use . type your program according to the assembly language syntax and save the file with a “. type the command MASM followed by filename.obj” (say. flags. Once you get the “. you also get a prompt > sign within CV window. Dept. then type CV test (file name) at the prompt.exe” file. There may still be . Appropriate messages will be displayed.asm) 2.E. b. you have to create the “.obj” file from step 3. Type EDIT at the command prompt (C:\>\MASM\).Warning Errors. if there are no errors.. type the command LINK followed by “filename. If your program accepts user inputs through keyboard and displays the result on the screen.g. A window will be opened with all the options like File.. test. There are two ways to run your program. opcodes etc. Edit etc. command to execute your program. linker will create “. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 How to write and execute your ALP using MASM? Steps to be followed: 1. This has to continue until MASM displays . If your program works with memory data and if you really want to know the contents of registers. Now. you can single step thro.d.exe” file of your program. Another window will be opened with your program..

Connect the board to the computer using the FRC available. Execute the programs as per the steps discussed earlier and note the results in your observation book. The programs with comments are listed for your reference. labels. The assembler is not case sensitive.) symbol. input-output is through computer keyboard and monitor or through memory. Make changes to the original program according to the questions given at the END of each program and observe the outputs. 3. Edit (type) the programs with program number and place them in your subdirectory.EXE and LINK. you need an external interface board. Write the programs in observation book. You can write comments for your instructions using Semicolon (. of CSE/ISE Jyothy Institute of Technology Page 18 . Instructions for Laboratory Exercises: 1. Create your own subdirectory in the computer. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 Once you are familiar with the architecture and basics of assembly language tools. For part A programs. For part B programs. CV. Some boards may require external power supply also. segment names. you can start typing and executing your program. Dept. Consult the Lab In-charge/Instructor before executing part B experiments. 7. 5. However. 2. we have used the following notation: uppercase letters to indicate register names. lowercase letters to indicate variable names. 6.EXE files in your subdirectory. mnemonics and assembler directives. and models. Have a copy of MASM. 8. 4.EXE.

A1 [SI] . if low > high condition fails MOV AX. KEY . length of array KEY DW 40H . assigning value later M3 DB „ POSITION $' M2 DB 'KEY NOT FOUND $' .AX = low + high SHR AX. Search a key element in a list of n numbers using the Binary Search algorithm. 040H.to adjust the pointer position ADD SI.AX(mid) = (low + high)/2 MOV SI.MODEL SMALL . 020H.BX = low MOV DX.if key is greater or equal to A1[mid] jump MOV DX. 01 . 030H. BX should be less than DX JA FAIL . CX = key L2: CMP BX. if key = A1[mid] JAE L1 . AX MOV BX. AX . Initialization of data segment MOV DS. DX .SI points to the mid element CMP CX.SI = mid DEC SI . of CSE/ISE Jyothy Institute of Technology Page 19 . LEN .DATA .if key is lesser than A1[mid]. . BX . key element to be searched M1 DB 'KEY FOUND AT‟ RES DB ? .CODE MOV AX. DX . AX = low ADD AX. high = mid Dept. SI . AX .low <= high .DX = high MOV CX. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 1 . data segment area.Array holding 5 elements LEN DW (LEN-A1)/2 . Define all variables and messages here A1 DW 010H. 50H . 01 . @DATA .

M2 . M1 . 30H . of CSE/ISE Jyothy Institute of Technology Page 20 .if key = A1[mid] jump to success MOV BX.continue search between mid+1 and high FAIL: LEA DX.e mid contains position MOV RES.continue search between low and mid-1 L1: JE SUCCESS . store msg address in D JMP L3 SUCCESS: ADD AX.DOS interrupt to terminate the program INT 21H END Dept. number 09H has to be in AH for display INT 21H .AL contains position of element in array LEA DX.if found AX i. store success msg address in DX L3: MOV AH. 04CH .Displaying fail message. AX . AL . 09H .if key is greater than A1[mid] low = mid INC BX . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 DEC DX .high = mid -1 JMP L2 .low = mid + 1 JMP L2 . call interrupt 21 MOV AH.

of CSE/ISE Jyothy Institute of Technology Page 21 .1: Pictorial representation of memory segment with starting address 4000H Dept. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 OUTPUT: KEY FOUND AT 3 POSITION 400BH 400AH LEN 4009H 50H 4008H 4007H 40H 4006H 4005H 30H 4004H 4003H 20H 4002H 4001H 10H 4000H Figure 1.

MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 Figure 1. of CSE/ISE Jyothy Institute of Technology Page 22 .2: Example for binary search Dept.

13. Move the array member pointed by SI to AL. "UNSORTED ARRAY IS". 02. end of macro . SI works as array pointer INLOOP: MOV AL. BX = LEN DEC BX . 09 . AL = A[SI] Dept. 10. Adopt Bubble Sort algorithm to sort given elements. 13. for displaying message its address should be in DX MOV AH. 13. interrupt displays message ENDM . 04. BX . of CSE/ISE Jyothy Institute of Technology Page 23 .1 OUTLOOP: MOV CX. 13. calling PRINT procedure for printing unsorted array MOV BX. LEN .CODE MOV AX. M stores the address the of message LEA DX. Design and develop an assembly program to sort a given set of „n‟ 16-bit numbers in ascending order. SI = 0. $ indicates last used byte(LEN here) M1 DB 10. DISPLAY MACRO M . 0 . 03 LEN DW $-A . @DATA . Initialization of data segment MOV DS.1 MOV SI. Calling DISPLAY macro CALL PRINT . M .MODEL SMALL . '$' M2 DB 10. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 2. AX DISPLAY M1 . '$' . CX = LEN .DATA A DB 01. 10. "SORTED ARRAY IS". A[SI] . print a string pointed by DX INT 21H . 08. BX = LEN .

1 JNZ OUTLOOP . start of the procedure PRINT MOV BX. DOS interrupt to print number MOV DL. adjusting the number ex. store AL to previous location in array NEXT: LOOP INLOOP . calling DISPLAY macro with M2 CALL PRINT . AL = 0205H MOV CX. use JB (jump if below) instead of JA XCHG AL. taking array element to AL AAM . CX = 3235H MOV AH. AX . repeat the comparison and exchanging. for ascending order . BX = LEN LEA SI. for each run it decrements CX by 1) DEC BX . of CSE/ISE Jyothy Institute of Technology Page 24 . A[SI] . SI = Address of array A REPEAT: MOV AL. Comparing AL with array member pointed by SI JA NEXT . If AL = 25H after AAM . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 INC SI . A . BX = BX . ' ' . CL . DOS interrupt to terminate the procedure INT 21H PRINT PROC NEAR . printing one space between each number Dept. DL = CH (in ex.To display a number AH must contain control value 02H MOV DL. if BX is not 0 repeat the loop DISPLAY M2 . [SI] . the number should be in DL. CX = AX ADD CX. A[SI] . Exchange the contents of AL with array member pointed by SI MOV A[SI-1]. converting number to ASCII equivalent. 02 . JA (jump if above) for descending order. 3030H . calling PRINT procedure MOV AH. (LOOP executes until . 05H) INT 21H MOV DL. AL . CH . LEN . take CL into DL for display (in ex. SI points to next member CMP AL. 4CH . 02H) INT 21H . CX becomes 0.

incrementing pointer to address next number in array DEC BX . (counter) JNZ REPEAT . end of procedure END . BX = BX – 1. of CSE/ISE Jyothy Institute of Technology Page 25 . if BX is not zero repeat RET . end of main program OUTPUT UNSORTED ARRAY IS 01 08 04 02 03 SORTED ARRAY IS 01 02 03 04 08 Dept. if BX is zero return to main program PRINT ENDP . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 INT 21H INC SI .

display M1 message Dept. SI = DI ADD SI. SI pointing last byte in string REPEAT: MOV AL. AL = string byte indexed by DI CMP [SI]. Develop an assembly language program to reverse a given string and verify whether it is a palindrome or not. Display the appropriate message DISPLAY MACRO M MOV AH. of CSE/ISE Jyothy Institute of Technology Page 26 . @DATA MOV DS. if counter is not zero repeats DISPLAY M1 . DI . [DI] . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 3.CODE MOV AX. comparing two bytes JNZ FAIL . AL . decrement counter value JNZ REPEAT . increment the DI pointer DEC SI .DATA STR DB 'MADAM' LEN DW LEN-STR M1 DB 'PALINDROME$' M2 DB 'NOT PALINDROME$' . M INT 21H ENDM . MOV SI. decrement SI pointer DEC LEN . 09 LEA DX. fails if both characters are different INC DI . AX LEA DI. STR . SI = SI + LEN DEC SI . LEN . load address of STR to DI.MODEL SMALL .

terminate the program INT 21H END OUTPUT: PALINDROME Note: Change the string and check the output. of CSE/ISE Jyothy Institute of Technology Page 27 . 4CH . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 JMP FINISH . display M2 message FINISH: MOV AH. unconditional jump FAIL: DISPLAY M2 . M A D A M LEN 2000H 2001H 2002H 2003H 2004H 2005H 2006H 2007H 2008H DI SI Dept.

MODEL SMALL .e. Calling a procedure NCR MOV AH. 0 . 4CH . CX = R CALL NCR . 13 The nCr of the number is: $” . N . DOS interrupt to terminate the program INT 21H NCR PROC NEAR . 09 LEA AX. start of the procedure CMP CX. of CSE/ISE Jyothy Institute of Technology Page 28 . @DATA MOV DS. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 4. BX = N MOV CX. AX MOV BX. if CX = = 0 i. Compute nCr using recursive procedure. DISPLAY MACRO M MOV AH. jump to specified location. R . if R = = 0 JE EXIT . RES = 1 Dept. Assume that „n‟ and „r‟ are non negative integers.DATA N DW 5 R DW 3 RES DW ? M1 DB “10. M INT 21H ENDM .CODE MOV AX.

Procedure to display result MOV AX. RES = AX RET . return from the procedure after computing result EXIT: MOV RES. print a character in DL MOV DL. CH . the contents have to be in DL for display INT 21H MOV DL.CX MOV DX. write to std output device. CX = CX . 02 . returning RES = 1when CX = 0 NCR ENDP . 1 RET . on monitor. AX = AX .1 CALL NCR . AX = AX * RES DIV CX . storing CX(R) in stack DEC CX . end of procedure END . AX . calling NCR procedure (recursive call until CX . CX . AX ADD CX. 3030H MOV AH. end of procedure DIPLAY PROC NEAR . becomes 0 POP CX . end of main program Dept. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 PUSH CX . AX = AX / CX MOV RES. RES AAM MOV CX. of CSE/ISE Jyothy Institute of Technology Page 29 . 00 MUL RES . BX INC AX SUB AX. popping value from stack to CX MOV AX. CL INT 21H RET DISPLAY ENDP .

MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 OUTPUT: The nCr of the number is: 10 1 2 3 STACK Dept. of CSE/ISE Jyothy Institute of Technology Page 30 .

MODEL SMALL . M AAM MOV BX. AX DISPLAY STR Dept. Macro for displaying message MOV AH. 02 INT 21H MOV DL. @DATA MOV DS. 3030H MOV DL. BL INT 21H ENDM . AX ADD BX. Macro for displaying a single character MOV AL. M1 INT 21H ENDM DIS MACRO M .CODE MOV AX.DATA STR DB ' CURRENT SYSTEM TIME IS $' . Read the current time from the system and display it in the standard format on the screen. DISPLAY MACRO M1 . 09 LEA DX. BH MOV AH. of CSE/ISE Jyothy Institute of Technology Page 31 . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 5.

CL holding minutes MOV DL. hours in CH. DH holding seconds MOV AH. ': ' INT 21H DIS CL . ': ' INT 21H DIS DH . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 MOV AH. DOS interrupt to terminate the program INT 21H END Dept. of CSE/ISE Jyothy Institute of Technology Page 32 . DOS interrupt which returns the system time. 02CH . minutes in CL and seconds in DH DIS CH . 4CH . CH holding hours MOV DL. INT 21H .

MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 6. READONLY ADD64 LDR R0.R2 NOP NOP BX LR END b) Data transfer program . HAVE MEMORY1 WINDOW OPENED AND SET ADDRESS AT 0X40000000 AND AFTER EXECUTION CHECK 0X44444444 APPEAR AT MEMORY1 WINDOW Dept.=0X12348900 LDR R3. R0.R3 ADC R5.=0X43210010 LDR R2. a) To add two words .=0X12348900 = R5 = 0x24696f40 EXPORT ADD64 AREA ADDITION .=0X1234E640 + R2. PRESS F5 TO RUN THE PROGRAM . of CSE/ISE Jyothy Institute of Technology Page 33 . To write and simulate ARM assembly language programs for data transfer.R1.=0X43210010 + R3. program to add two words .=0X43212102 ADDS R4.PROGRAM TO TRANSFER DATA FROM CODE AREA TO DATA AREA . R1. arithmetic and logical operations (Demonstrate with the help of a suitable program). SET BREAKPOINT AT NOP INSTRUCTION .R0.=0X43212102 = R4 = 0x8642212 . CODE . COMPILE AND DEBUG PROGRAM .=0X1234E640 LDR R1.

DATA. WORD ALIGN T0 ARRAY ELEMENT LDR R4./* RESULT CAN BE VIEWED IN REGISTERS R5 (REMINDER) & R6 (QUOTIENT) */ ./* PROGRAM TO Divide TWO NUMBERS */ . LOADS THE ADDRESSOF FIRST VALUE LDR R2./* PROGRAM WRITTEN BY ALS R&D TEAM BENGALURU DATE:25/12 /2013 */ EXPORT divide AREA DIVISION ./* TAKE TWO NUMBERS 0X00000002. CODE.=VALUE1 ./* SET A BREAKPOINT AT NOP INSTRUCTION.RUN THE PROGRAM & CHECK THE RESULT */ .#4 .[R1]. STORES THE RESULT IN R2 NOP NOP NOP VALUE1 DCD 0X44444444 .Mark first instrution to execute START LDR R1.=RESULT . READONLY ENTRY . AREA DATA2. READONLY ENTRY Dept.READWRITE . TO STORE RESULT IN GIVEN AD DRESS RESULT DCD 0X0 END c) To divide two numbers . LOADS THE ADDRESSOF RESULT STR R2. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 AREA LARGEST . CODE. of CSE/ISE Jyothy Institute of Technology Page 34 . 0X00000008 */ .[R4] .

divider (ALWAYS SMALLER) DCD 0X00000008 . CHECK QUOTIENT INR6 ERROR NOP NOP MOV PC. of CSE/ISE Jyothy Institute of Technology Page 35 . COMPARE NUMBERS IN R4 & R2 BGE LOOP1 . Mark end of file Dept.R2 . CHECK REMINDER IN R5 MOV R6. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 START Divide MOV R0.#4 . SUBTRACT R2 IN R4& STORE IN R4 ADD R0.#4 . WORD ALIGN T0 ARRAY ELEMENT (Second element) CMP R2. IF THE NUMBER in R4 > R2 THEN GOTO LOOP1 LOOP2 MOV R5.R0 .[R1].R4 BHI ERROR LOOP1 SUB R4.R0. INTIALISE R0 TO ZERO LDR R1. WORD ALIGN T0 ARRAY ELEMENT (First element) LDR R4.R4.[R1].R4 .LR BX LR VALUE DCD 0X00000002 . INCREMENT THE R0 EVERYTIME BY 1 CMP R4. LOADS THE ADDRESS OF FIRST VALUE LDR R2. dividend (ALWAYS GREATER) END .R2 .#1 .#0 .=VALUE .

R0 NOP NOP MOV PC.R2 NOP NOP Dept.=0X706F LDR R1. r2 = r0 * r1 = 0X009B090F . check the result in r2 register EXPORT MULTIPLY AREA MULTI .LR END e) Subtraction EXPORT SUB64 AREA SUNTRACT . READONLY MULTIPLY LDR R0.=0X0161 MULS R2. READONLY SUB64 LDR R0.R1.=0X43212102 SUB R4.R1. r1 = 0X0161 . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 d) Multiplication . program to multiply two 32 bit numbers .=0X1234E640 LDR R1. of CSE/ISE Jyothy Institute of Technology Page 36 . CODE . r0 = 0x706F .R0 SBC R5.=0X43210010 LDR R2.R3.=0X12348900 LDR R3. CODE .

Mark first instruction to execute START LDR R1.STEP THROUGH THE PROGRAM AND FIND . LOADS THE ADDRESSOF FIRST VALUE LDR R3.[R1] . CODE. of CSE/ISE Jyothy Institute of Technology Page 37 .PROGRAM TO DEMONSTRATE LOGICAL AND INSTRUCTION .[R4] . AND AT 0X40000000 FFFFFFFF AT MEMORY 1 WINDOW1 AREA LARGEST .R3 LDR R4.=VALUE1 . STORES THE RESULT IN R2 AND ATT MEMORY 0X40000000 NOP NOP NOP VALUE1 DCD 0X55AAAA55 . WORD ALIGN T0 ARRAY ELEMENT LDR R1.[R1] AND R2. Dept. LOADS THE ADDRESSOF RESULT STR R2.=VALUE2 . LOADS THE ADDRESSOF FIRST VALUE LDR R2. READONLY ENTRY .SECOND OPERNAD AT R3= AA5555AA .FIRST OPERNAD AT R2= 55AAAA55 . PRESS F5 TO RUN THE PROGRAM .=RESULT . SET BREAKPOINT AT NOP INSTRUCTION . COMPILE AND DEBUG PROGRAM . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 BX LR END LOGICAL OPERATIONS a) AND . AND AFTER EXECUTION CHECK REGISTER R2 = FFFFFFFF .

TO STORE RESULT IN GIVEN ADDRESS RESULT DCD 0X0 END Dept.Mark first instruction to execute START LDR R1. of CSE/ISE Jyothy Institute of Technology Page 38 .R2 LDR R4. LOADS THE ADDRESSOF FIRST VALUE LDR R2.=VALUE1 . LOADS THE ADDRESSOF RESULT STR R2. SET BREAKPOINT AT NOP INSTRUCTION . AREA DATA2.DATA. READONLY ENTRY .[R1]. PRESS F5 TO RUN THE PROGRAM .READWRITE . AREA DATA2. COMPILE AND DEBUG PROGRAM .=RESULT . STORES THE RESULT IN R2 NOP NOP NOP VALUE1 DCD 0XC123 . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 VALUE2 DCD 0X5555AA55 . AND AFTER EXECUTION CHECK REGISTER R1 = FFFF2EDC AREA LARGEST . TO STORE RESULT IN GIVEN ADDRESS RESULT DCD 0X0 END b) NOT .#4 . CODE.[R4] .READWRITE . WORD ALIGN T0 ARRAY ELEMENT MVN R2.PROGRAM TO DEMONSTRATE LOGICAL NOT INSTRUCTION .DATA.

R3 LDR R4.READWRITE . READONLY ENTRY . AND AFTER EXECUTION CHECK REGISTER R1 = FFFF3EDC AREA LARGEST . VALUE2 DCD 0XAA5555AA .DATA. SET BREAKPOINT AT NOP INSTRUCTION . of CSE/ISE Jyothy Institute of Technology Page 39 .Mark first instruction to execute START LDR R1.=RESULT . CODE. WORD ALIGN T0 ARRAY ELEMENT LDR R1.=VALUE2 .=VALUE1 .[R1] ORR R2.[R4] . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 c) OR . COMPILE AND DEBUG PROGRAM .[R1] . LOADS THE ADDRESSOF FIRST VALUE LDR R3. AREA DATA2. TO STORE RESULT IN GIVEN ADDRESS RESULT DCD 0X0 END Dept. LOADS THE ADDRESSOF FIRST VALUE LDR R2. STORES THE RESULT IN R2 NOP NOP NOP VALUE1 DCD 0X55AAAA55 . PRESS F5 TO RUN THE PROGRAM . LOADS THE ADDRESSOF RESULT STR R2.PROGRAM TO DEMONSTRATE LOGICAL OR INSTRUCTION .

c=a+b.h> Void main(void) { int a. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 7.b. To write and simulate C Programs for ARM microprocessor using KEIL (Demonstrate with the help of a suitable program) #include <lpc214x. b=5. } Dept. a=5. of CSE/ISE Jyothy Institute of Technology Page 40 . a=4.c.

00H JNE L2 . of CSE/ISE Jyothy Institute of Technology Page 41 . if AL != 0.MODEL SMALL . PB is input port IN AL. PB .CODE MOV AX. AX MOV DX. BCD UP – DOWN counter L1: CALL UP JMP L1 L2: CALL UP CALL DOWN JMP L2 STOP: MOV AH. 82H OUT DX. Design and develop an assembly program to demonstrate BCD Up-Down Counter (00-99) on the Logic Controller Interface. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 HARDWARE PROGRAMS: PART B 8. CT MOV AL. AL MOV DX. DX CMP AL.DATA PA EQU 0D0A0H PB EQU 0D0A2H CT EQU 0D0A3H . 04CH INT 21H Dept. . a. @DATA MOV DS.

MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48

UP PROC NEAR ; procedure to display BCD numbers from 0 to 9
MOV AL, 00H

L3: MOV DX, PA ; PA is output port
OUT DX, AL
INC AX
PUSH AX ; save count value in stack
MOV AH, 0BH ; checks whether a character is available from the keyboard
INT 21H ; AL = 00, not available, AL = FFH available, if available
OR AL, AL ; i.e AL = FF stop displaying and exit if AL = 00 continue
JNZ STOP ; displaying number
POP AX ; get back count value from stack
MOV AH, 86H ; AH =86 and INT 15H : wait
MOV CX, 020H ; this suspends execution of the caller for the specified interval
MOV DX, 0CH ;
INT 15H
CMP AL, 0AH ; if count value less than 10 (AL < 10) display the number
JNE L3 ; if the count value i.e AL = 10 return to the main program
RET
UP ENDP ; end of the procedure
DOWN PROC NEAR ; procedure to display numbers from 9 to 0
MOV AL, 09H

L4: MOV DX, PA ; PA is output port
OUT DX, AL ; Display the contents of AL i.e count value
DEC AX
PUSH AX ; store AX value in stack
MOV AH, 0BH ; check whether any character entered in key board
INT 21H
OR AL, AL
JNZ STOP
Dept. of CSE/ISE Jyothy Institute of Technology Page 42

MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48

POP AX
MOV AH, 086H ; delay
MOV CX, 020H
MOV DX, 0CH
INT 15H
CMP AL, 00H
JNE L4
RET
DOWN ENDP
END

Dept. of CSE/ISE Jyothy Institute of Technology Page 43

MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48

b. Design and develop an assembly program to read the status of two 8-bit inputs
(X & Y) from the Logic Controller Interface and display X*Y.

DISMSG MACRO M
LEA DX, M
MOV AH, 09
INT 21H
ENDM

WAIT1 MACRO
MOV AH, 01 ; CHARACTER I/P WITH ECHO
INT 21H
ENDM

.MODEL SMALL
.DATA
.STACK
MSG_X DB 10,13,"SET VALUE FOR X ON LOGIC CONTLR & PRESS ANY KEY...$"
MSG_Y DB 10,13,"SET VALUE FOR Y ON LOGIC CONTLR & PRESS ANY KEY...$"
M3 DB 'LOWER BYTE FORM PORTA AND ENTER FOR HIGHER BYTE$'
M4 DB 'HIGHER BYTE FROM PORTA$'
PORTA EQU 0D0A0H
PORTB EQU 0D0A2H
CTRL EQU 0D0A3H

.CODE
MOV AX, @DATA
MOV DS, AX

MOV DX, CTRL
MOV AL, 82H

Dept. of CSE/ISE Jyothy Institute of Technology Page 44

MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48

OUT DX, AL

DISMSG MSG_X
WAIT1

MOV DX, PORTB ; port B is input port
IN AL, DX
MOV BL, AL ; BL = X;

DISMSG MSG_Y
WAIT1

MOV DX, PORTB
IN AL, DX ; AL = Y

MOV AH, 00
MUL BL ; AX = AL * BL

PUSH AX ; STORING RESULT IN STACK

DISMSG M3

POP AX

MOV DX, PORTA
OUT DX, AL ; SENDING LOWER BYTE RESULT
MOV BL, AH

WAIT1

DISMSG M4
Dept. of CSE/ISE Jyothy Institute of Technology Page 45

SENDING HIGHR BYTE RESULT OUT DX. of CSE/ISE Jyothy Institute of Technology Page 46 . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 MOV DX. 4CH INT 21H END Dept. PORTA MOV AL. AL MOV AH. BL .

Design and develop an assembly program to display messages “FIRE” and “HELP” alternately with flickering effects on a 7-segment display interface for a suitable period of time. L. H) CR EQU 0D0A3H PA EQU 0D0A0H PB EQU 0D0A1H PC EQU 0D0A2H . AL GET_KEY: MOV BX. AX MOV AL.DATA DISPLAY DB 61H. I. 0E3H. 0F5H. 10H MOV DX. 00H Dept. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 9.( ASCII codes for E. 61H. 10H INT 15H ENDM .MODEL SMALL . Ensure a flashing rate that makes it easy to read both the messages (Examiner does not specify these delay values nor is it necessary for the student to compute these values).STACK . E. of CSE/ISE Jyothy Institute of Technology Page 47 . CR OUT DX.(ASCII code for P. 91H .CODE MOV AX. DELAY MACRO MOV AH. 80H MOV DX. 71H . R. 0F3H. 86H MOV CX. @DATA MOV DS. F) DB 31H.

08 MOV AL. means bit by bit SHR AL. 08H JNE NO_DELAY DELAY NO_DELAY: CMP BX. PC MOV AL. PB OUT DX. if any key is pressed Z flag sets to 1. 01 . 01 LOOP L1 INC BX CMP BL. 00 . of CSE/ISE Jyothy Institute of Technology Page 48 . checks whether any key is pressed in keyboard INT 16H . AL POP AX . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 L2: MOV CX. if no key is pressed JZ GET_KEY . sending high pulse to the SIPO register OUT DX. sending low pulse to the SIPO register OUT DX. Z = 0. end of the program INT 21H END Dept. 01 . DISPLAY [BX] . 4CH . continue display MOV AH. 08H JNZ L2 MOV AH. AL MOV AL. taking data from look-up table L1: MOV DX. AL PUSH AX MOV DX. the data will be sent serially.

rotating AL makes activation of the next DEC STEP . 88H . of CSE/ISE Jyothy Institute of Technology Page 49 . AX MOV DX. the stepper motor (you can use 80H also) OUT DX.STACK 20 . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 10. Introduce suitable delay between successive steps. AL = 10001000. 01 . PORTA . AL MOV AL. (Any arbitrary value for the delay may be assumed by the student). @DATA MOV DS. it activates one of the 4 coils of L1: MOV DX.DATA STEP DB 20 PORTA EQU 0D0A0H CTR EQU 0D0A3H . Design and develop an assembly program to drive a Stepper Motor interface and rotate the motor in specified direction (clockwise or counter-clockwise) by N steps (Direction and N are specified by the examiner). CTR MOV AL.MODEL SMALL . coils JNZ L1 L2: MOV DX.CODE MOV AX. AL CALL DELAY ROR AL. 80H OUT DX. PORTA Dept. .

of CSE/ISE Jyothy Institute of Technology Page 50 . 1000H OUTER: MOV BX. 4CH . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 OUT DX. REPEAT INNER LOOP FFFF TIMES LOOP OUTER . AL CALL DELAY ROL AL. end of the program INT 21H DELAY PROC PUSH CX PUSH BX MOV CX. 0FFFFH INNER: DEC BX JNZ INNER . REPEAT OUTER LOOP 1000H TIMES POP BX POP CX RET DELAY ENDP END Dept. 01 DEC STEP JNZ L2 MOV AH.

of CSE/ISE Jyothy Institute of Technology Page 51 . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 STEPPER MOTOR Dept.

CX = 37( number of elements in TABLE. AL CALL DELAY LOOP BACK . 190. 170. Table address in SI MOV DX. if key is not pressed continue the display MOV AH. Design and develop an assembly language program to: a. 29. 0 DB 1. 104 . . 224. TABLE . 17. 236. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 11. 29. 63.DATA CTR EQU 9403H PA EQU 9400H TABLE DB 127. 01H . 7. AX MOV DX. The above values are in decimal. 80H OUT DX. 104.CODE MOV AX. 252. 254 DB 252. 208. 224. 170. 45. 149. @DATA MOV DS. 1.MODEL SMALL . 7. 127 DB 104. 236. If any key if pressed. 246. Generate the Sine Wave using DAC interface (The output of the DAC is to be displayed on the CRO). 37 . 63. 190. 246. stop displaying wave in CRO INT 16H JZ AGAIN . 4CH INT 21H Dept. 208. 149. in decimal) BACK: LODSB OUT DX. CTR MOV AL. 83. 17. of CSE/ISE Jyothy Institute of Technology Page 52 . 45. LOOP EXCECUTES 37 TIMES MOV AH. 83. AL AGAIN: LEA SI. . PA MOV CX.

of CSE/ISE Jyothy Institute of Technology Page 53 . X = 127. 0FFFFH LOOP1: DEC BX JNZ LOOP1 RET DELAY ENDP END Formula for calculation of table value X. X = 149 so on Dept. θ = 100 . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 DELAY PROC MOV BX. X = 127 + 127 * SIN θ For ex. if θ = 00 ..

DATA CTR EQU 9403H PA EQU 9400H TABLE DB 127.MODEL SMALL . Generate a Half Rectified Sine waveform using the DAC interface. AX MOV DX. 127. 127. stop displaying wave in CRO INT 16H JZ AGAIN . of CSE/ISE Jyothy Institute of Technology Page 54 . 149. if key is not pressed continue the display MOV AH. 127 DB 127. 127. . 127. 127 . Table address in SI MOV DX. 246. CTR MOV AL. 127 DB 127. 208. 80H OUT DX. The above values are in decimal. AL AGAIN: LEA SI. 37 . 208. 170. 236. 246. 127.CODE MOV AX. 127. 149. 127. (The output of the DAC is to be displayed on the CRO). 224. 254 DB 252. 252. PA MOV CX. @DATA MOV DS. 01H . 190. 170. 127. AL CALL DELAY LOOP BACK . LOOP EXCECUTES 37 TIMES MOV AH. 4CH INT 21H Dept. 127. 190. 224. 127. TABLE . 127. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 b. 236. 127. 127. 127. . If any key if pressed. CX = 37( number of elements in TABLE. in decimal) BACK: LODSB OUT DX.

MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 DELAY PROC MOV BX. of CSE/ISE Jyothy Institute of Technology Page 55 . 0FFFFH LOOP1: DEC BX JNZ LOOP1 RET DELAY ENDP END Dept.

//configure o/p lines for lcd [P0. of CSE/ISE Jyothy Institute of Technology Page 56 . //clear display delay(3200). unsigned long int temp.h> //Function prototypes void lcd_init(void).ARM7TDMI/LPC2148. void delay(unsigned int). // delay 1. void wr_dn(void). // configure P0.0 TO P0. To interface LCD with ARM processor-. unsigned char temp1. Write and execute programs in C language for displaying text messages and numbers on LCD #include<lpc214x.disp[] = "ALS BENGALURU".15 as GPIO IO0DIR = 0x000000FC.06ms clr_disp(). void lcd_com(void). void lcd_data(void).7] lcd_init().r=0.disp1[] = "LCD INTERFACING". //lcd intialisation delay(3200).2-P0.06ms Dept.h> #include<stdio. int main() { PINSEL0 = 0X00000000. void wr_cn(void). unsigned char *ptr. // delay 1. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 12. void clr_disp(void).

// Display starting address of second line 1st pos lcd_com(). //function to send data to lcd ptr ++. //function to send command to lcd ptr = disp1. lcd_data(). } temp1 = 0xC0. // pointing data while(*ptr!='\0') { temp1 = *ptr. //send data to lcd ptr ++. lcd_data(). of CSE/ISE Jyothy Institute of Technology Page 57 . Dept. // pointing second data while(*ptr!='\0') { temp1 = *ptr. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 temp1 = 0x81. } //end of main() // lcd initialisation routine. void lcd_init(void) { temp = 0x30. //function to send command to lcd ptr = disp. } while(1). //command to test LCD voltage level wr_cn(). //Display starting address of first line 2nd pos lcd_com().

delay(3200). //command to test LCD voltage level wr_cn(). temp = 0x30. // load a command for display on. of CSE/ISE Jyothy Institute of Technology Page 58 . delay(800). delay(800). temp1 = 0x06. cursor on and blinking off lcd_com(). temp1 = 0x0C. } void lcd_com(void) Dept. // load command for lcd function setting with lcd in 4 bit mode. temp = 0x30. // command for cursor increment after data dump lcd_com(). MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 delay(3200). //command to test LCD voltage level wr_cn(). lcd_com(). // 2 line and 5x7 matrix display delay(3200). delay(3200). temp1 = 0x28. // set the cursor to beginning of line 1 lcd_com(). delay(3200). // change to 4 bit mode from default 8 bit mode wr_cn(). temp = 0x20. temp1 = 0x80. delay(800).

// Assign the value to the PORT lines IO0CLR = 0x00000004. // clear bit RS = 0 IO0SET = 0x00000008. // some delay } // command nibble o/p routine void wr_cn(void) //write command reg { IO0CLR = 0x000000FC. // Assign the value to the PORT lines IO0SET = 0x00000004. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 { temp = temp1 & 0xf0. // clear the port lines. temp = temp1 & 0x0f. //E=0 } // data nibble o/p routine void wr_dn(void) ////write data reg { IO0CLR = 0x000000FC. IO0CLR = 0x00000008. //masking higher nibble first wr_cn(). delay(500). //E=0 } // data o/p routine which also outputs high nibble first Dept. IO0SET = temp. // clear the port lines. // set bit RS = 1 IO0SET = 0x00000008. IO0SET = temp. of CSE/ISE Jyothy Institute of Technology Page 59 . //masking lower nibble temp = temp << 4. // E=1 delay(10). // E=1 delay(10). wr_cn(). IO0CLR = 0x00000008.

delay(100). delay(500). //shift 4bit to left wr_dn(). //masking higher nibble first temp = temp . lcd_com().r<r1. temp= temp1 & 0x0f. } Dept. //masking lower nibble temp= temp << 4. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 // and lower nibble next void lcd_data(void) { temp = temp1 & 0xf0. } void clr_disp(void) // function to clear the LCD screen { temp1 = 0x01. } void delay(unsigned int r1) // delay function using for loop { for(r=0.r++). of CSE/ISE Jyothy Institute of Technology Page 60 . wr_dn().

j < 50 . k++ ) . //P1. int main(void) { PINSEL2 = 0x00000000. j++ ) // 50 times in Anti Clock wise Rotation anti_clock_wise() .20 to P1. // Delay to show ANTI_clock Rotation } }// End of main Dept.ARM7TDMI/LPC2148. j = 0 . //P1. k++ ) . // rotate one round clockwise for( k = 0 . k = 0 . k < 65000 . k < 65000 .23 made as output while(1) { for( j = 0 . To interface Stepper motor with ARM processor-. unsigned int var1 . // rotate one round anticlockwise for( k = 0 . // Delay to show anti_clock Rotation for( j=0 .20 to P1. of CSE/ISE Jyothy Institute of Technology Page 61 .23 GPIO IO1DIR |= 0x00F00000 .h> void clock_wise(void) . unsigned long int i = 0 . void anti_clock_wise(void) . j < 50 . j++ ) // 50 times in Clock wise Rotation clock_wise() . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 13. Write a program to rotate stepper motor #include <LPC21xx.

k < 3000 . for( k = 0 . k < 3000 . //clearing all 4 bits IO1SET = var1 . i <= 3 . k++ ). i++ ) // for A B C D Stepping { var1 >>=1. IO1CLR =0x00F00000 . //For Anticlockwise IO1CLR =0x00F00000 . i++ ) // for A B C D Stepping { var1 <<= 1 . //rotating bits Dept. for( i = 0 . k++ ) . //for step speed variation } } void anti_clock_wise(void) { var1 = 0x00800000 . of CSE/ISE Jyothy Institute of Technology Page 62 . // setting perticular bit for( k = 0 . //For Clockwise for( i = 0 . //clearing all 4 bits IO1SET = var1 . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 void clock_wise(void) { var1 = 0x00080000. i < 3 .

k++ ) . // setting perticular bit for( k = 0 . k < 3000 . of CSE/ISE Jyothy Institute of Technology Page 63 . //for step speed variation } } Dept. // clar all bits before setting IO1SET = var1 . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 IO1CLR =0x00F00000 .

DI=1234 Dept.BL mov cx.cx mov si.al mov bh.data num1 db 50h num2 dw 1234h . ALP TO MOVE DATA BETWEEN THE REGISTERS.DATA SEGMENT INITIALIZATION mov al. SI=1234. of CSE/ISE Jyothy Institute of Technology Page 64 .ax .ax mov di.DATA SEGMENT STARTS FROM PAGE BOUNDARY end Run1: AX=5050. BX=5050.@data mov ds. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 ADDITIONAL PROGRAMS 1. DX=1234.ah mov bl. .code mov ax.TERMINATES THE PROGRAM EXECUTION align 16 .CX TO REG.model tiny .DX int 3 .si . CX=1234.AL TO REG.num2 mov dx.MOVES WORD LENGHT OF DATA FROM REG.MOVES BYTE LENGTH OF DATA FROM REG.al .num1 mov ah.

ALP TO MOVE IMMEDIATE DATA .MOVES IMMEDIATE VALUE TO 16 BIT REGISTER mov si. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 2.2000h int 3 .model tiny .4000h mov di. DI=2000 Dept. SI=4000. BX=1234.1234h mov dx.50h mov ch.TERMINATE THE PROGRAM EXECUTION end Run1: AX=1010.10h mov ah.50 . CX=5050.MOVES IMMEDIATE VALUE TO 8 BIT REGISTER mov bx.10 mov cl.code mov al. DX=1234. of CSE/ISE Jyothy Institute of Technology Page 65 .1234 .

STORES THE RESULT IN MEMORY mov cx. of CSE/ISE Jyothy Institute of Technology Page 66 .ADD THE 2 WORDS mov sum2.DS STARTS FROM PAGE BOUNDARY end Run1: AX=xx0B.ax .cx .ADD THE 2 BYTES mov sum.num1 mov bl. CX=1236 Dept.al . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 3.num2 add al.TERMINATE THE PROGRAM EXECUTION align 16 .num3 add cx.STORES THE RESULT IN MEMORY int 3 .code mov ax.data num1 db 05h num2 db 06h num3 dw 1234h num4 dw 0002h sum db ? sum2 dw ? .@data mov ds.model small .bl .INITIALIZES DATA SEGMENT mov al.num4 . ALP TO ADD TWO NUMBERS .

MULTIPLIES 2 16-BIT NUMBERS mov res.num1 mov dx.code mov ax. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 4. of CSE/ISE Jyothy Institute of Technology Page 67 .num2 mul dx .TERMINATE THE PROGRAM EXECUTION align 16 .dx .ax mov res+2.@data mov ds. ALP TO MULTIPLY TWO 16-BIT NUMBERS .data num1 dw 1234h num2 dw 0ffffh res dw 5 dup(0) .model small .INITIALIZATION OF DATA SEGMENT mov ax.DS STARTS FROM PAGE BOUNDARY end Dept.ax .STORES THE IN MEMORY int 3 .

Most Micro Processors are single. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 VIVA QUESTIONS AND ANSWERS 1. What is the difference between 8086 and 8088? ANS: The BIU in 8088 is 8-bit data bus & 16. Auxiliary carry flag. 5. What are the various segment registers in 8086? ANS: Code. Interrupt flag. Overflow flag. What are the functional units in 8086? ANS: 8086 has two independent functional units because of that the processor speed is more. Direction flag. 7. Parity flag. How 8086 is faster than 8085? Dept. 3. What is the Maximum clock frequency in 8086? ANS: 5 Mhz is the Maximum clock frequency in 8086. of CSE/ISE Jyothy Institute of Technology Page 68 . Stack. 2. What are the flags in 8086? ANS: In 8086 Carry flag. and Sign flag. 6.chip devices. Data. The Bus interface unit and Execution unit are the two functional units. What is a Microprocessor? ANS: Microprocessor is a program-controlled device. 8. Logic calculations are done in which type of registers? ANS: Accumulator is the register in which Arithmetic and Logic calculations are done.Instruction queue is 4 byte long in 8088and 6 byte in 8086. Extra Segment registers in 8086. 4. decodes and executes the instructions. which fetches the instructions from memory.bit in 8086. Trace flag. Zero flag.

Which Flags can be set or reset by the programmer and also used to control the operation of the processor? ANS: Trace Flag. What is flag? ANS: Flag is a flip-flop used to store the information about the status of a processor and the status of the instruction executed most recently. 11. of CSE/ISE Jyothy Institute of Technology Page 69 . What does EU do? ANS: Execution Unit receives program instruction codes and data from BIU. What is the size of data bus and address bus in 8086? ANS: 8086 has 16-bit data bus and 20. 8086 BIU fetches the next instruction when EU busy in executing the anoter instruction. 9. In how many modes 8086 can be opertaed and how? Dept. 10. 15.bit address bus. Which Segment is used to store interrupt and subroutine return address registers? ANS: Stack Segment in segment register is used to store interrupt and subroutine return address registers. 12. Direction Flag. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 ANS: Because of pipelining concept. 16. Interrupt Flag. 14. What is the maximun memory addressing capability of 8086? ANS: The maximum memory capability of 8086 is 1MB. What does microprocessor speed depend on? ANS: The processing speed depends on DATA BUS WIDTH. executes these instructions and store the result in general registers. 13.

of CSE/ISE Jyothy Institute of Technology Page 70 .In this type of Stack the first stored information is retrieved first. What is interrupt? Dept. 18. 22. They are Minimum mode if MN/MX pin is active high and Maximum mode if MN/MX pin is ground. What is stack? ANS: Stack is a portion of RAM used for saving the content of Program Counter and general purpose registers. Which Stack is used in 8086? ANS: FIFO (First In First Out) stack is used in 8086. What is the position of the Stack Pointer after the POP instruction? ANS: The address line is 02 greater than the earlier value. 20. 23. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 ANS: 8086 can be opertaed in 2 modes. What is the position of the Stack Pointer after the PUSH instruction? ANS: The address line is 02 less than the earlier value. 19. 21. What is the difference between min mode and max mode of 8086? ANS: Minimum mode operation is the least expensive way to operate the 8086 microprocessor because all the control signals for the memory and I/O are generated by the micro processor. It used only when the system contains external coprocessors such as 8087 arithmetic coprocessor. In Maximum mode some of the control signals must be externally generatred. 17. Which bus controller used in maximum mode of 8086? ANS: 8288 bus controller is used to provide the signals eliminated from the 8086 by the maximum mode operation. This requires the addition of an external bus controller.

What is meant by Maskable interrupts? ANS: An interrupt that can be turned off by the programmer is known as Maskable interrupt. 25. RST5.disabled) is known as Non-Maskable interrupt. When RST5.5 are Maskable interrupts. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 ANS: Interrupt is a signal send by external device to the processor so as to request the processor to perform a particular work. RST6. What is Non-Maskable interrupts? ANS: An interrupt which can be never be turned off (ie. 29. of CSE/ISE Jyothy Institute of Technology Page 71 . which is used in emergency condition. What is SIM and RIM instructions? Dept.5 interrupt is received the processor saves the contents of the PC register into stack and branches to 34h (hexadecimal) address.5. When RST7.5 interrupt is received the processor saves the contents of the PC register into stack and branches to 2Ch (hexadecimal) address. 26. Non-Maskable interrupts. Emergency.5. Give examples for Maskable interrupts? ANS: RST 7. Which interrupts are generally used for critical events? ANS: Non-Maskable interrupts are used in critical events. 24. 30. 28. Shut off etc.. When RST6. Give example for Non-Maskable interrupts? ANS: Trap is known as Non-Maskable interrupts. What are the various interrupts in 8086? ANS: Maskable interrupts. 27. Such as Power failure.5 interrupt is received the processor saves the contents of the PC register into stack and branches to 3Ch (hexadecimal) address.

to hold the data for display 34. 35. Most Microprocessor does not support floating-point operations. 36. of CSE/ISE Jyothy Institute of Technology Page 72 . Used to check whether the interrupt is Masked or not. What is a compiler? ANS: Compiler is used to translate the high-level language program into machine code at a time. Dept. it stores automatically. Used to mask the hardware interrupts. The primary function of a Latch is data storage. What is macro? ANS: Macro is a set of instructions that perform a task and all the isntructions defined in it is inserted in the program at the point of usage. What is the 82C55A device? ANS: The 8255A/82C55A interfaces peripheral I/O devices to the microcomputer system bus.t require special instruction to store in a memory. It is programmable by the system software. 32. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 ANS: SIM is Set Interrupt Mask. What is the disadvantage of microprocessor? ANS: It has limitations on the size of data. 33. 31. It doesn. What is the difference between Macro and Procedure? ANS: A procedure is accessed via a CALL instruction and a macro will inserted in the program at the point of execution. What is meant by LATCH? ANS: Latch is a D.type flip-flop used as a temporary storage device controlled by a timing signal. It has a 3-state bi-directional 8-bit buffer which interfaces the 8255A/82C55A to the system data bus. which can store 0 or 1. The Execution time is less compared to Interpreter. It is used in output devices such as LED. RIM is Read Interrupt Mask.

Port B can be used either in simple I/O mode or handshaking mode 1. port A and port C are configured as output ports and in mode 0. and strobed bidirectional input/outputs. In this mode. 39. mode 1. 40. B. MODE 1: Ports A and B can be used as input or output ports with handshaking capabilities. strobed inputs or outputs. What is the mode and I/O configuration for ports A. all the bits are out or in. Describes the mode 0. then the port B is configured as an input port. level-sensitive inputs. which includes features such as single-bit. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 37. Handshaking signals are provided by the bits of port C. and byte-wide input and output ports. of CSE/ISE Jyothy Institute of Technology Page 73 . any of the ports A. MODE 2: Port A can be used as a bidirectional I/O port with handshaking capabilities whose signals are provided by port C. and C can be programmed as input or output. B. In this mode. 38. What kind of input/output interface dose a PPI implement? ANS: It provides a parallel interface. and mode 2 operations of the 82C55A? ANS: MODE 0: Simple I/O mode. How many I/O lines are available on the 82C55A? ANS: 82C55A has a total of 24 I/O lines. and C of an 82C55A after its control register is loaded with 82H? ANS: If control register is loaded with 82H. Dept. latched outputs. 4-bit.

Invoked by: AH = 01h Returns: AL = character entered. result is stored in AL. then this function reads the console. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 APPENDIX A INTERRUPT INT 21H INT 21h calls DOS functions. Example: MOV AH. If DL = 0FFH on entry. 01h INT 21h Function 02h .Write a character to standard output. Invoked by: Parameters for O/P: DL = 0…255 Dept. then this function displays the ASCII character on the console video screen. of CSE/ISE Jyothy Institute of Technology Page 74 . the function waits until any key is pressed. INT 21h Function 06h – Direct console for input/output. ‟a‟ . Example: MOV AH.Read character from standard input. AH =02h After execution AL = DL. If DL = ASCII character. If there is no character in the keyboard buffer. Character to be displayed on screen must be stored in DL reg. Function 01h . 02h MOV DL. Invoked by: DL = character to write.

Invoked by: DS = string to write.Write a string to standard output at DS: DX. The string can be of any length and may contain control characters such as carriage return (0DH) and line feed (0AH). 09h MOV DX. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 Parameters for I/P: DL = 255. Example: MOV AH.offset str . String must be terminated by '$'. AH = 09h Example: MOV AH. Returns: for O/P: AL = DL.Get system time. DH = second. CL = minute.Address of the string to be displayed INT 21h Function 2Ch . of CSE/ISE Jyothy Institute of Technology Page 75 . Invoked by: AH =2Ch Return: CH = hour. 0ffh INT 21h Function 09h . Example: MOV AH. DL = 1/100 seconds. 2ch INT 21h Dept. For I/P: ZF set if no character available & AL = 0 ZF clear if character available & AL = character. 06h MOV DL.

Invoked by: CX = file attributes: MOV CX. 01 MOV DX. offset Filename INT 21h Function 41h . normal . Dept.Delete file (unlink). system MOV CX. 7 . system and read-only! MOV CX. 0BH . Subdirectory DS: DX -> filename. 0 . of CSE/ISE Jyothy Institute of Technology Page 76 . MOV CX. but see notes).Create or truncate file. 1 . Invoked by: DS: DX -> ASCIZ filename (no wildcards. read-only. Volume label MOV CX. 2 . MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 Function 3Ch . 10H . CF set on error AX = error code. archive MOV CX. AX = file handle. 16 . . 3ch MOV CX. AH =3Ch Returns: CF clear if successful. CF set on error AX = error code.no attributes. AH=41h Return: CF clear if successful. Example: MOV AH. MOV CX. 4 . AX destroyed. hidden. MOV CX. hidden.

Invoked by: BH = page number. 10 INT 10h Function 03h – Get cursor position.. offset Filename INT 21h Function 4Ch – Terminate a process. 00 MOV DH. DL = column. (In general 0) Dept. Function 02h . 06 MOV DL. Example: MOV AH.Set cursor position. of CSE/ISE Jyothy Institute of Technology Page 77 .7). 41h MOV DX. This interrupt often called the video services interrupt as it directly controls the video display in a system. AH=02h. 4Ch INT 21h Interrupt INT 10h: INT 10h calls the BIOS functions.. Example: MOV AH. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 Example: MOV AH. Invoked by: AH = 4ch Return: returns control to the operating system. Invoked by: DH = row. BH = page number (0. 02h MOV BH.

of CSE/ISE Jyothy Institute of Technology Page 78 . DH. CH. CH = cursor start line.) BH = attribute used to write blank lines at bottom of window. MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 AH = 03h Return: DH = row number. CL = row. 03h INT 10h Function 06h – Scroll up window Invoked by: AL = number of lines by which to scroll. DL = column number. (00h = clear the entire screen. DL = row. Example: MOV BH. column of window's upper left corner. 0 MOV AH. Dept. column of window's lower right corner. CL = cursor bottom line.

MICROPROCESSOR AND MICROCONTROLLER LABORATORY 15CSL48 APPENDIX B ASCII TABLE Dept. of CSE/ISE Jyothy Institute of Technology Page 79 .