;***************************************************************+ ;* This stationery serves as the framework for a * ;* user application (single file, absolute assembly application * ;* for 18-348) * ;***************************************************************+ ; export symbols XDEF Entry ; export 'Entry' symbol ABSENTRY Entry ; for absolute assembly: mark this as application entry point ; include derivative specific macros INCLUDE 'mc9s12c128.inc' ; variable/data section INCLUDE 'RAMLocation.inc' ;**************************************************** ; ADD GLOBAL VARIABLES HERE ;**************************************************** ;declare a memory word in RAM here ROMStart EQU $4000 ; absolute address to place my code/constant data ; code section ORG ROMStart Entry: INCLUDE 'StackInfo.inc' CLI ; enable interrupts ;***************************************************** ; ADD CODE HERE ;***************************************************** ;configure port T for output ;configure port P as input ;configure port A for output ;initilize loop register and sum register and memory countLoop: ;counter loop label ;increment loop ;add counter to running sum ;branch if counter limit reached buttonLoop: ;button monitor loop label ;get the button values and process value ;branch to write upper or lower sum byte based on button state ;code to write lower byte ;code to write upper byte ;unconditional branch to buttonLoop ;***************************************************** ; DO NOT MODIFY OR ADD ANYTHING AFTER THIS POINT ;***************************************************** ;************************************************************** ;* Interrupt Vector * ;************************************************************** ORG $FFFE DC.W Entry ; Reset Vector