;*********************************************************** ;* This is the skeleton file for Lab 3 of ECE 375 ;* ;* Author: Enter your name ;* Date: Enter date ;* ;*********************************************************** .include "m32U4def.inc" ; Include definition file ;*********************************************************** ;* Internal Register Definitions and Constants ;*********************************************************** .def mpr = r16 ; Multipurpose register is required for LCD Driver ;*********************************************************** ;* Start of Code Segment ;*********************************************************** .cseg ; Beginning of code segment ;*********************************************************** ;* Interrupt Vectors ;*********************************************************** .org $0000 ; Beginning of IVs rjmp INIT ; Reset interrupt .org $0056 ; End of Interrupt Vectors ;*********************************************************** ;* Program Initialization ;*********************************************************** INIT: ; The initialization routine ; Initialize Stack Pointer ; Initialize LCD Display ; NOTE that there is no RET or RJMP from INIT, ; this is because the next instruction executed is the ; first instruction of the main program ;*********************************************************** ;* Main Program ;*********************************************************** MAIN: ; The Main program ; Main function design is up to you. Below is an example to brainstorm. ; Move strings from Program Memory to Data Memory ; Display the strings on the LCD Display rjmp MAIN ; jump back to main and create an infinite ; while loop. Generally, every main program is an ; infinite while loop, never let the main program ; just run off ;*********************************************************** ;* Functions and Subroutines ;*********************************************************** ;----------------------------------------------------------- ; Func: Template function header ; Desc: Cut and paste this and fill in the info at the ; beginning of your functions ;----------------------------------------------------------- FUNC: ; Begin a function with a label ; Save variables by pushing them to the stack ; Execute the function here ; Restore variables by popping them from the stack, ; in reverse order ret ; End a function with RET ;*********************************************************** ;* Stored Program Data ;*********************************************************** ;----------------------------------------------------------- ; An example of storing a string. Note the labels before and ; after the .DB directive; these can help to access the data ;----------------------------------------------------------- STRING_BEG: .DB "My Test String" ; Declaring data in ProgMem STRING_END: ;*********************************************************** ;* Additional Program Includes ;*********************************************************** .include "LCDDriver.asm" ; Include the LCD Driver