Starting from:

$35

CSE 379 Lab #5

CSE 379
Lab #5

Objective
In this lab, you will learn how to service interrupts on the ARM board.
Description
Write an ARM assembly language subroutine, called lab5, which is an interrupt driven program that
displays in real-time (in PuTTy) the number of times each of the four switches is pressed and the number
of times a key is pressed in PuTTy. In other words, five tallies should be displayed on the screen: one for
switch #2, one for switch #3, one for switch #4, one for switch #5, and one of the number of keystrokes.
All counts should be displayed in decimal and should be updated on every press of a switch or a key. The
program should end when the user hits q on the keyboard. You may assume that the user will only press
one switch at a time. Polling may NOT be used to obtain data from the keyboard or the switches. The
data must be obtained through the use of interrupts.
Startup Code
Use the startup code on the labs page of the course website, NOT the startup assembly file that you’ve
been including in your project when you create a project in past labs.
Skeleton Code
The following skeleton code shown below can be used for lab_5.s.
 .text
 .global UART0_Handler
 .global Switches_Handler
 .global interrupt_init
 .global lab5

interrupt_init:
 STMFD SP!,{r0-r12,lr} ; Store register lr on stack

 ; Your code is placed here
 LDMFD sp!, {r0-r12,lr}
 MOV pc, lr
UART0_Handler:
 STMFD SP!,{r0-r12,lr} ; Store register lr on stack

 ; Your code is placed here
 LDMFD sp!, {r0-r12,lr}
 BX lr
Switches_Handler:
 STMFD SP!,{lr} ; Store register lr on stack

 ; Your code is placed here
 LDMFD sp!, {lr}
 BX lr
 .end
Partners
You will work with a partner in this lab. Your partner MUST be the same partner you worked with on lab
#4.
Documentation
Your program must be clearly commented, and documentation must also be provided. The
documentation must follow the guidelines covered in lecture (found on the Lectures webpage of the
course website). Your comments should describe what each section of your program does. To receive
full credit on your documentation, you must submit a draft of your flowchart before you start working on
the lab in your regularly scheduled lab time on Wednesday, March 4 or Thursday, March 5.
Submissions
Your source code (C and assembly) must be submitted online using the submit command (submit_cse379
Your source code (C and assembly) and your documentation (as a PDF) must be submitted online using
the submit command (submit_cse379 lab_5_wrapper.c lab_5.s lab_5_library.s lab_5_documentation.pdf)
on timberlake.cse.buffalo.edu before 11:59 PM on Tuesday, March 10, 2020. A hardcopy of your
documentation is due at the beginning of class on Wednesday, March 11, 2020. Your documentation
will be used along with the code you submitted when you perform the debug exercise for Lab #5. 

More products