summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2025-03-17 13:28:07 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2025-03-17 13:28:07 -0400
commite746f8732def7e970eb832ac22e1ad0787f365ac (patch)
tree8469b5781cbce4d7d08ac30623a1afadc617e5e9
parentc391536a0a499291726e37d341ee923fe2d07944 (diff)
HW 8: RTI ISR increments and prints time, bad timing
-rw-r--r--cmpen472_hw8McDonnell/ASM_layout.hwl21
-rw-r--r--cmpen472_hw8McDonnell/Default.membin0 -> 285 bytes
-rw-r--r--cmpen472_hw8McDonnell/Full_Chip_Simulation.hwc1
-rw-r--r--cmpen472_hw8McDonnell/Full_Chip_Simulation.ini42
-rw-r--r--cmpen472_hw8McDonnell/Sources/derivative.inc10
-rw-r--r--cmpen472_hw8McDonnell/Sources/main.asm577
-rw-r--r--cmpen472_hw8McDonnell/bin/Project.absbin0 -> 7328 bytes
-rw-r--r--cmpen472_hw8McDonnell/bin/Project.abs.phy3
-rw-r--r--cmpen472_hw8McDonnell/bin/Project.abs.s1947
-rw-r--r--cmpen472_hw8McDonnell/bin/main.dbg576
-rw-r--r--cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Postload.cmd1
-rw-r--r--cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Preload.cmd1
-rw-r--r--cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Reset.cmd1
-rw-r--r--cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_SetCPU.cmd1
-rw-r--r--cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Startup.cmd1
-rw-r--r--cmpen472_hw8McDonnell/cmpen472_hw8McDonnell.mcpbin0 -> 57065 bytes
-rw-r--r--cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/CWSettingsWindows.stgbin0 -> 2088 bytes
-rw-r--r--cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.obin0 -> 7328 bytes
-rw-r--r--cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.sx47
-rw-r--r--cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/TargetDataWindows.tdtbin0 -> 64523 bytes
-rw-r--r--cmpen472_hw8McDonnell/prm/burner.bbl157
-rw-r--r--cmpen472hw7_McDonnell/Full_Chip_Simulation.ini2
-rw-r--r--cmpen472hw7_McDonnell/bin/Project.absbin7358 -> 7358 bytes
-rw-r--r--cmpen472hw7_McDonnell/cmpen472hw7_McDonnell.mcpbin57065 -> 57065 bytes
-rw-r--r--cmpen472hw7_McDonnell/cmpen472hw7_McDonnell_Data/Standard/ObjectCode/main.asm.obin7358 -> 7358 bytes
-rw-r--r--cmpen472hw7_McDonnell/cmpen472hw7_McDonnell_Data/Standard/TargetDataWindows.tdtbin64449 -> 64449 bytes
26 files changed, 1487 insertions, 1 deletions
diff --git a/cmpen472_hw8McDonnell/ASM_layout.hwl b/cmpen472_hw8McDonnell/ASM_layout.hwl
new file mode 100644
index 0000000..0eb91ba
--- /dev/null
+++ b/cmpen472_hw8McDonnell/ASM_layout.hwl
@@ -0,0 +1,21 @@
+OPEN source 0 0 60 42
+Source < attributes TOOLTIP on,TOOLTIP_FORMAT signed,TOOLTIP_MODE details,FREEZE off,MARKS off
+OPEN assembly 60 0 40 30
+Assembly < attributes ADR on,CODE off,ABSADR on,SYMB off,FORMAT Auto,FREEZE off,TOPPC 0x3100
+OPEN procedure 60 60 40 17
+Procedure < attributes VALUES on,TYPES off
+OPEN register 60 30 40 30
+Register < attributes FORMAT AUTO,COMPLEMENT None
+OPEN memory 60 77 40 23
+Memory < attributes FORMAT hex,COMPLEMENT None,WORD 1,ASC on,ADR on,MODE automatic,UPDATERATE 10,ADDRESS 0x80
+OPEN data 0 42 60 28
+Data < attributes SCOPE global,COMPLEMENT None,FORMAT Symb,MODE automatic,SORT NotSort,UPDATERATE 10,NAMEWIDTH 16
+OPEN command 0 70 60 30
+Command < attributes CACHESIZE 1000
+OPEN Terminal 10 20 85 69
+Terminal < attributes CACHESIZE 1000
+Terminal < attributes SCI_DEFAULT_TEXT "Virtual SCI",SCI_CONNECTION 0,1,SCI_CONNECTION 1,0,SCI_CONNECTION 1,3,SCI_CONNECTION 3,1,SCI_PORT COM1,SCI_BAUD 9600,SCI_SHOW_PROTOCOL OFF,SCI_VIRTUAL_IN "Sci:2.SerialOutput",SCI_VIRTUAL_OUT "Sci:2.SerialInput",SCI_FILENAME_IN "",SCI_FILENAME_OUT ""
+bckcolor 50331647
+font 'Courier New' 9 BLACK
+AUTOSIZE on
+ACTIVATE "Assembly" "Memory" "Register" "Command" "Data" "Source" "Procedure" "Terminal"
diff --git a/cmpen472_hw8McDonnell/Default.mem b/cmpen472_hw8McDonnell/Default.mem
new file mode 100644
index 0000000..bf49148
--- /dev/null
+++ b/cmpen472_hw8McDonnell/Default.mem
Binary files differ
diff --git a/cmpen472_hw8McDonnell/Full_Chip_Simulation.hwc b/cmpen472_hw8McDonnell/Full_Chip_Simulation.hwc
new file mode 100644
index 0000000..f3ce7c9
--- /dev/null
+++ b/cmpen472_hw8McDonnell/Full_Chip_Simulation.hwc
@@ -0,0 +1 @@
+LOADMEM default.mem
diff --git a/cmpen472_hw8McDonnell/Full_Chip_Simulation.ini b/cmpen472_hw8McDonnell/Full_Chip_Simulation.ini
new file mode 100644
index 0000000..e4aeeaf
--- /dev/null
+++ b/cmpen472_hw8McDonnell/Full_Chip_Simulation.ini
@@ -0,0 +1,42 @@
+[Environment Variables]
+GENPATH={Project}Sources;{Compiler}lib\hc12c\src;{Compiler}lib\hc12c\include;{Compiler}lib\hc12c\lib;{Compiler}lib\xgatec\src;{Compiler}lib\xgatec\include;{Compiler}lib\xgatec\lib
+LIBPATH={Compiler}lib\hc12c\include;{Compiler}lib\xgatec\include
+OBJPATH={Project}bin
+TEXTPATH={Project}bin
+ABSPATH={Project}bin
+
+[HI-WAVE]
+Target=sim
+Layout=ASM_layout.hwl
+LoadDialogOptions=AUTOERASEANDFLASH NORUNAFTERLOAD
+CPU=HC12
+MainFrame=0,1,-1,-1,-1,-1,312,312,2232,1335
+Configuration=Full_Chip_Simulation.hwc
+Statusbar=1
+ShowToolbar=1
+Smallborder=0
+Hideheadline=0
+Hidetitle=0
+TOOLBAR=57600 57601 32795 0 57635 57634 57637 0 57671 57669 0 32777 32776 32782 32780 32781 32778 0 32806
+
+
+
+
+
+
+
+
+
+[Simulator]
+CMDFILE0=CMDFILE STARTUP ON ".\cmd\Full_Chip_Simulation_startup.cmd"
+
+[Simulator HC12]
+CMDFILE0=CMDFILE RESET ON ".\cmd\Full_Chip_Simulation_reset.cmd"
+CMDFILE1=CMDFILE PRELOAD ON ".\cmd\Full_Chip_Simulation_preload.cmd"
+CMDFILE2=CMDFILE POSTLOAD ON ".\cmd\Full_Chip_Simulation_postload.cmd"
+CMDFILE3=CMDFILE SETCPU ON ".\cmd\Full_Chip_Simulation_setcpu.cmd"
+HCS12_SUPPORT=1
+FCS=MC9S12C32
+ZEROTIMEATRESET=1
+OSCFREQUENCY=48000000
+DISPLAYTIME=0
diff --git a/cmpen472_hw8McDonnell/Sources/derivative.inc b/cmpen472_hw8McDonnell/Sources/derivative.inc
new file mode 100644
index 0000000..988343b
--- /dev/null
+++ b/cmpen472_hw8McDonnell/Sources/derivative.inc
@@ -0,0 +1,10 @@
+
+ ; Note: This file is recreated by the project wizard whenever the MCU is
+ ; changed and should not be edited by hand
+ ;
+
+ ; include derivative specific macros
+ INCLUDE 'mc9s12c32.inc'
+
+
+
diff --git a/cmpen472_hw8McDonnell/Sources/main.asm b/cmpen472_hw8McDonnell/Sources/main.asm
new file mode 100644
index 0000000..2f83517
--- /dev/null
+++ b/cmpen472_hw8McDonnell/Sources/main.asm
@@ -0,0 +1,577 @@
+**************************************************************************
+*
+* Title: Calculator
+*
+* Objective: CMPEN 472 Homework 7
+*
+* Revision: V1.0
+*
+* Date: Mar. 7, 2025
+*
+* Programmer: Jacob McDonnell
+*
+* Company: The Pennsylvania State University
+* Department of Computer Science and Engineering
+*
+* Algorithm: Simple Serial I/O, address poking and modifying
+*
+* Register Use: A & B to current byte, etc,
+* X & Y holds address of strings and length of string,
+* D to hold data and address of the memory location to work on.
+*
+* Memory Use: RAM Locations from $3000 for data,
+* RAM Locations from $3100 for program
+*
+* Input: Serial Port for User Input
+*
+* Output: Serial Port for String Output
+* Memory locations changed if modified by user
+*
+* Observation: This program is a simple 16-bit calculator. The input can be
+* any 4 digit positive decimal integer, the output can be negative.
+* The +, -, *, and / operators are supported. Only two numbers at
+* a time.
+*
+* Note: ON CSM-12C128 board,
+*
+* Comments: This program is developed and simulated using CodeWarrior
+* development software and targeted for Axion
+* Manufacturing's CSM-12C128 board running at 24MHz.
+*
+**************************************************************************
+* Parameter Declearation Section
+*
+* Export Symbols
+ xdef pgstart ; export 'pgstart' symbol
+ absentry pgstart ; for assembly entry point
+
+* Symbols and Macros
+PORTA equ $0000 ; i/o port A addresses
+DDRA equ $0002 ; data direction register for PORTA
+PORTB equ $0001 ; i/o port B addresses
+DDRB equ $0003 ; data direction register for PORTB
+
+SCIBDH equ $00C8 ; Serial port (SCI) Baud Register H
+SCIBDL equ $00C9 ; Serial port (SCI) Baud Register L
+SCICR2 equ $00CB ; Serial port (SCI) Control Register 2
+SCISR1 equ $00CC ; Serial port (SCI) Status Register 1
+SCIDRL equ $00CF ; Serial port (SCI) Data Register
+
+CRGFLG EQU $0037 ; Clock and Reset Generator Flags
+CRGINT EQU $0038 ; Clock and Reset Generator Interrupts
+RTICTL EQU $003B ; Real Time Interrupt Control
+
+CR equ $0d ; carriage return, ASCII 'Return' key
+LF equ $0a ; line feed, ASCII 'next line' character
+NULL equ $00 ; NULL Terminator character
+
+**************************************************************************
+* Data Section: address used [ $3000 to $30FF ] RAM Memory
+*
+ org $3000 ; Reserved RAM memory starting address
+ ; for Data for CMPEN 472 class
+buffer ds.b $0010 ; Array of 16 bytes to read a string
+ dc.b NULL ; NULL terminated
+lenBuf dc.w $0010 ; Length of buffer array
+
+buffer2 ds.b $0010 ; Array of 16 bytes for reading and reversal
+ dc.b NULL ; NULL terminated
+lenBuf2 dc.w $0010 ; length of buffer2
+
+hours dc.w $0000 ; Buffer to hold the hours of the time
+
+minutes dc.w $0000 ; Buffer to hold the minutes of the time
+
+seconds dc.w $0000 ; Buffer to hold the seconds of the time
+
+operator dc.b $0
+
+numBuf dc.b $0
+
+*
+* There is a section Data Section at the end of the file
+**************************************************************************
+* Interrupt Vector Section: address used [ $FFF0 to $FFFF ] RAM Memory
+*
+ org $FFF0 ; Memory location for Interrupt vector section for simulator
+ dc.w rtiisr ; Real Time Interrupt vector
+*
+**************************************************************************
+* Program Section: address used [ $3100 to $3FFF ] RAM Memory
+*
+ org $3100 ; Program start address, in RAM
+pgstart lds #$3100 ; initialize the stack pointer
+
+ ldaa #%11110001 ; LED 1,2,3,4 at PORTB bit 4,5,6,7
+ staa DDRB ; set PORTB bit 4,5,6,7 as output
+
+ ldaa #$0C ; Enable SCI port Tx and Rx units
+ staa SCICR2 ; disable SCI interrupts
+
+ ldd #$0001 ; Set SCI Baud Register = $0001 => 1.5M baud at 24MHz (for simulation)
+ std SCIBDH ; SCI port baud rate change
+
+ ldx #msg ; Load the address of the welcome message into X
+ jsr WriteString ; Write the string to the serial console
+
+ bset RTICTL,%00011001; set RTI: dev=10*(2**10)=2.555msec for C128 board
+ ; 4MHz quartz oscillator clock
+ bset CRGINT,%10000000; enable RTI interrupt
+ bset CRGFLG,%10000000; clear RTI IF (Interrupt Flag)
+
+ cli ; Enable interrupts
+mainLoop
+ bra mainLoop ; Loop back to mainLoop always
+
+**************************************************************************
+* Subroutine Section: address used [ $3100 to $3FFF ] RAM Memory
+*
+
+rtiisr bset CRGFLG,%10000000; Clear RTI Interrupt Flag
+ pshx ; Save X to the stack
+ pshd ; Save D to the stack
+ ldx seconds ; Load the seconds into X
+ inx ; Increment the seconds by 1
+ stx seconds ; Save the new seconds to the location
+ cpx #60 ; Compare X to 60
+ bne rtidone ; If X != 60, exit isr
+ ldx #0 ; Reset the seconds
+ stx seconds ; Save the new seconds to the location
+ ldx minutes ; load the minutes into X
+ inx ; Increment the minutes by 1
+ stx minutes ; Save the updated minutes
+ cpx #60 ; Compare the minutes to 60
+ bne rtidone ; If X != 60, exit isr
+ ldx #0 ; Reset the minutes
+ stx minutes ; Save the updated minutes
+ ldx hours ; Load the hours into X
+ inx ; Increment the hours by 1
+ stx hours ; Save the updated hours
+ cpx #24 ; Compare the hours to 24
+ bne rtidone ; If X != 24, exit the isr
+ ldx #0 ; Reset the hours
+ stx hours ; Save the updated hours
+rtidone ldd hours ; Load the hours into D
+ ldy #buffer ; Load the address of buffer into Y
+ jsr PrintDecimalWord; Print the number to the serial
+ ldaa #':' ; Load the character ':' into A
+ jsr putchar ; Write the character to the serial
+ ldd minutes ; Load the minutes into D
+ ldy #buffer ; Load the address of buffer into Y
+ jsr PrintDecimalWord; Print the number to the serial
+ ldaa #':' ; Load the character ':' into A
+ jsr putchar ; Write the character to the serial
+ ldd seconds ; Load the seconds into D
+ ldy #buffer ; Load the address of buffer into Y
+ jsr PrintDecimalWord; Print the number to the serial
+ ldaa #CR ; Load the character CR into A
+ jsr putchar ; Write the character to the serial
+ ldaa #LF ; Load the character LF into A
+ jsr putchar ; Write the character to the serial
+ puld ; Restore D from the stack
+ pulx ; Restore X from the stack
+ RTI
+
+;*************************************************************************
+; VerifyInput subroutine
+;
+; This subroutine will verify the user input is valid.
+;
+; Input: An address of a Null terminated string in register X.
+; Output: If valid Zero bit = 0 in CCR, if invalid, Zero bit = 1
+; and the string is outputed up to the error on the serial
+; console with an error message.
+; Registers in use: X for the address of the string, A for reading characters.
+; Y to count the number of digits in a number, & B to count the number of numbers
+; Memory locations in use: Memory Address for serial line, address of the string, 1 byte for operator
+;
+; Comments: This subroutine will modify the user string if invalid.
+;
+
+VerifyInput
+ pshy ; Save Y to the stack
+ pshd ; Save D to the stack
+ pshx ; Save X to the stack
+ clrb ; Set B to Zero
+ stab operator ; Clear operator
+ ldy #0 ; Load Zero into Y
+vNumLoop ldaa 1,x+ ; Load character from X into A
+ cmpa #'9' ; Compare A to '9'
+ bhi vInvalid ; If A > '9', not valid string
+ cmpa #'0' ; Compare A to '0'
+ blt vIsOp ; If A < '0', check if operator
+ iny ; Increment Y by 1 to count numbers
+ cpy #4 ; Compare Y to 4
+ bhi vInvalid ; If greater than 4, invalid
+ bra vNumLoop ; Loop back to check for more digits
+vIsOp cmpa #'+' ; Compare A to '+'
+ beq vOp ; This is an operator
+ cmpa #'-' ; Compare A to '-'
+ beq vOp ; This is an operator
+ cmpa #'*' ; Compare A to '*'
+ beq vOp ; This is an operator
+ cmpa #'/' ; Compare A to '/'
+ beq vOp ; This is an operator
+ cmpa #NULL ; Compare A to NULL character
+ beq vEndOfLine ; Check if end of line
+vInvalid clra ; Set A to zero
+ staa 0,X ; Write Null terminator to X
+ pulx ; Restore X from the stack
+ pshx ; Save X to the stack
+ jsr WriteString ; Write invalid string to serial console
+ ldaa #CR ; Load CR into A
+ jsr putchar ; Jump to putchar to write the character
+ ldaa #LF ; Load LF into A
+ jsr putchar ; Jump to putchar to write the character
+ ldx #invalidStr ; Load address of invalid string into X
+ jsr WriteString ; Write invalid string to serial console
+ ldaa #4 ; Load 4 into A to set zero bit
+ tap ; Transfer A to CCR
+ pulx ; Restore X from the stack
+ puld ; Restore D from the stack
+ puly ; Restore Y from the stack
+ rts ; Return to caller
+vOp staa operator ; Store operator in operator buffer
+ ldaa -2,x ; Load previous character into A
+ cmpa #'0' ; Compare A to '0'
+ blt vInvalid ; Invalid string since previous is not number
+ cmpa #'9' ; Compare A to '9'
+ bhi vInvalid ; Invalid string since previous is not number
+ addb #1 ; Increment B by 1
+ cmpb #1 ; Compare B to 1
+ bhi vInvalid ; Invalid string since B > 1 and we have another operator
+ ldy #0 ; Set Y to 0
+ bra vNumLoop ; Check for next number
+vEndOfLine ldaa -2,x ; Load previous character into A
+ cmpa #'0' ; Compare A to '0'
+ blt vInvalid ; Invalid string since previous is not number
+ cmpa #'9' ; Compare A to '9'
+ bhi vInvalid ; Invalid string since previous is not number
+ ldaa operator ; Load operator character from buffer
+ beq vInvalid ; If operator buffer is zero, invalid
+ clra ; Set A to zero
+ tap ; Transfer A to CCR
+ pulx ; Restore X from the stack
+ puld ; Restore D from the stack
+ puly ; Restore Y from the stack
+ rts ; Return to caller
+
+;*************************************************************************
+; ReadDecimal subroutine
+;
+; This subroutine will read an ASCII string of a number in decimal and convert it to
+; its value.
+;
+; Input: A memory address in register X.
+; Output: The value of the number in the Y register, and any errors printed
+; to the serial line. Zero bit is set if error occurs.
+; Registers in use: X for the address of the contents and for a buffer while printing,
+; D for multiplication, B for the character, Y for output value.
+; Memory locations in use: Memory Address for serial line, address of the string
+;
+; Comments: This subroutine will return the value in the Y register, and if an error occurs,
+; the Zero bit in the CCR will be set.
+;
+
+ReadDecimal
+ pshd ; Save D to the stack
+ ldy #0 ; Clear Y register
+dHLoop ldab 1,x+ ; Read Next character from X
+ beq dHDone ; If B == 0, exit loop
+ cmpb #'+' ; Compare B to '+'
+ beq dHDone ; If B == '+', end of number
+ cmpb #'-' ; Compare B to '-'
+ beq dHDone ; If B == '-', end of number
+ cmpb #'*' ; Compare B to '*'
+ beq dHDone ; If B == '+', end of number
+ cmpb #'/' ; Compare B to '/'
+ beq dHDone ; If B == '-', end of number
+ cmpb #' ' ; Compare B to space character
+ beq dHDone ; If B == ' ', exit loop
+ cmpb #'0' ; Compare B to '0' character
+ blt dHError ; If B < '0', bad address, exit loop
+ cmpb #'9' ; Compare B to '9' character
+ bhi dHError ; If B > '9', check if 'A'-'F' characters
+ subb #'0' ; Subtract '0' from B to get true value
+ pshb ; Save B to the stack
+ ldd #10 ; load 10 into D
+ emul ; Multiply Y and D
+ exg d,y ; Transfer data from D to Y
+ pulb ; Restore b from the stack
+ aby ; Add B to Y
+ bra dHLoop ; Branch always to rHLoop
+dHDone clra ; clear A accumulator
+ tap ; Transfer A into CCR to clear zero bit
+ puld ; Restore D from the stack
+ rts ; Return to caller
+dHError ldaa #4 ; Load 4 into A to set zero bit in CCR
+ tap ; Transfer A into CCR to set zero bit and warn error
+ puld ; Restore D from the stack
+ rts ; Return to caller
+
+;*************************************************************************
+; strrev subroutine
+;
+; This subroutine will reverse a string from one buffer into another.
+;
+; Input: Address of null terminated string in X, address of a large enough
+; buffer in Y.
+; Output: The string in X reversed in Y.
+; Registers in use: X for the address of the string, Y for the address of the buffer,
+; A to read characters from the string.
+; Memory locations in use: Memory Address for serial line, address of the string & buffer
+;
+; Comments: This subroutine will not check that the output buffer is large enough, that
+; is the job of the caller.
+;
+
+strrev
+ pshx ; Save X to the stack
+ pshy ; Save Y to the stack
+ psha ; Save A to the stack
+revLoop ldaa 1,y- ; Load Character from Y into A, decrement Y
+ beq revDone ; If Character is 0, exit loop
+ staa 1,x+ ; Save character in address in X, increment X
+ bra revLoop ; Loop back always
+ clra ; Set A to Zero
+revDone staa 1,x+ ; Copy Null terminator into new string
+ pula ; Restore A from the stack
+ puly ; Restore Y from the stack
+ pulx ; Restore X from the stack
+ rts ; Return to caller
+
+;*************************************************************************
+; PrintDecimalWord subroutine
+;
+; This subroutine will print a given word of data to the serial in binary.
+;
+; Input: 1 word of data in register D, Buffer Address in Y
+; Output: Decimal representation of the data on the serial console
+; Registers in use: Y for the address of the buffer, X to count the number of bits
+; written and for division, D for the input, A for characters.
+; Memory locations in use: Memory addresses for serial, and operator to hold sign
+;
+; Comments: This subroutine requires serial to be setup and putchar subroutine.
+;
+
+PrintDecimalWord
+ pshx ; Save X to the stack
+ pshy ; Save Y to the stack
+ pshd ; Save D (A:B) to the stack
+ cpd #0 ; Compare D to zero
+ beq dIsZero ; Branch to hIsZero
+ blt dIsNegative ; If D < 0, Jump to dIsNegative
+dAfterNeg psha ; Save A to the stack
+ pshy ; Save Y to the stack
+ pshx ; Save x to the stack
+ ldaa #'0' ; Load the '0' character into A
+ ldx #buffer2 ; Load the address of buffer2 into X
+ ldy #5 ; Load 5 into Y
+ jsr memset ; Write '0' to the first 5 bytes in buffer2
+ pulx ; Restore X from the stack
+ puly ; Restore Y from the stack
+ clra ; Set A to zero
+ staa 0,y ; Load Zero into Y for Null Terminator
+ pula ; Restore A from the stack
+dPrintLoop ldx #10 ; Load 10 in X for division
+ idiv ; Divide D / 10 to get Hex Digit
+ cpx #0 ; Compare X to 0
+ beq dCheck ; If X == 0, branch to check D is zero
+dDNotZero addb #'0' ; Add '0' to B to get ASCII Character
+ stab 1,+y ; Save character from B to Y
+ exg X,D ; Swap values in X and D
+ bra dPrintLoop ; Loop to hPrintLoop
+dCheck cpd #0 ; Compare D to 0
+ bne dDNotZero ; If D != 0, branch back to hDNotZero
+dPrintDone puld ; Restore D from the stack
+ pshd ; Save D to the stack
+ cpd #10 ; Compare D to 10
+ bge dNoZero ; If D >= 10, jump to dNoZero
+ ldaa #'0' ; Load '0' character into A
+ staa 1,+y ; Load the '0' character in A to Y and increment Y
+dNoZero ldaa operator ; Load operator into A to see if negative
+ cmpa #'-' ; Compare A to '-'
+ bne dNotNeg ; If A != '-', jump to dNotNeg
+ staa 1,+y ; Save '-' into buffer
+dNotNeg ldx #buffer2 ; Load the address of buffer2 in X
+ jsr strrev ; Reverse string in Y in buffer in X
+ jsr WriteString ; Jump to write string to write the number
+ ldy lenBuf2 ; Load the length of buffer2 into Y
+ ldx #buffer2 ; Load the address of buffer2 into X
+ jsr Zeros ; Fill buffer2 with zeros
+ puld ; Restore D (A:B) from the stack
+ puly ; Restore Y from the stack
+ pulx ; Restore X from the stack
+ rts ; Return to caller
+dIsZero ldaa #'0' ; Load '0' character into A
+ jsr putchar ; Print character to the screen
+ ldaa #'0' ; Load '0' character into A
+ jsr putchar ; Print character to the screen
+ puld ; Restore D (A:B) from the stack
+ puly ; Restore Y from the stack
+ pulx ; Restore X from the stack
+ rts ; Return to caller
+dIsNegative psha ; Save A to the stack
+ ldaa #'-' ; Load '-' into A
+ staa operator ; Save '-' to operator buffer
+ pula ; Restore A from the stack
+ nega ; Two's complement of A
+ suba #1 ; Subtract 1 from A
+ negb ; Two'complement of B
+ subb #1 ; Subtract 1 from B
+ addd #1 ; Add 1 to D
+ bra dAfterNeg ; Jump back to dAfterNeg
+
+;*************************************************************************
+; Zeros subroutine
+;
+; This subroutine will write zeros to every byte in a given array.
+;
+; Input: Address of an array in X and its length in Y
+; Output: Zeros in every byte of an array.
+; Registers in use: X for the address of the array, Y for the length, and A for 0
+; Memory locations in use: Memory Address of the array
+;
+; Comments: This subroutine requires serial to be setup and putchar subroutine.
+;
+
+Zeros
+ psha ; Save A to the Stack
+ clra ; Clear A
+zerosLoop staa 1,x+ ; Load A into byte at X
+ dbne y,zerosLoop ; Decrement Y and loop if Y != 0
+ pula ; Restore A from the stack
+ rts ; Return to caller
+
+;*************************************************************************
+; memset subroutine
+;
+; This subroutine will write a given byte to every byte in a given array.
+;
+; Input: Address of an array in X and its length in Y, the byte in A
+; Output: The given byte in every byte of an array.
+; Registers in use: X for the address of the array, Y for the length, and A for the given byte
+; Memory locations in use: Memory Address of the array
+;
+; Comments: This subroutine requires serial to be setup and putchar subroutine.
+;
+
+memset
+ staa 1,x+ ; Load A into byte at X
+ dbne y,memset ; Decrement Y and loop if Y != 0
+ rts ; Return to caller
+
+;*************************************************************************
+; WriteString subroutine
+;
+; This subroutine will write a given null terminated string to the serial.
+;
+; Input: Address of null terminated string in X
+; Output: Null terminated string written to serial
+; Registers in use: X for the address of the string and A for the current byte
+; Memory locations in use: Memory Address for serial line, address of the string
+;
+; Comments: This subroutine requires serial to be setup and putchar subroutine.
+;
+
+WriteString
+ psha ; Save A to the stack
+writeLoop ldaa 1,x+ ; Load the byte at addr in X, then add 1
+ beq doneWrite ; if A == 0, branch to doneWrite
+ jsr putchar ; Jump to putchar to write byte to serial
+ bra writeLoop ; branch always to writeLoop
+doneWrite pula ; restore A from the stack
+ rts ; return to caller
+
+;*************************************************************************
+; ReadString subroutine
+;
+; This subroutine will read a string from the serial line to a given address.
+;
+; Input: Address of an array in X
+; Output: Null terminated string in the given array
+; Registers in use: X for the address of the string Y for the length of the string,
+; and A for the current byte
+; Memory locations in use: Memory Address for serial line, address of the string
+;
+; Comments: This subroutine requires serial to be setup and getchar subroutine.
+;
+
+ReadString
+ psha ; Save accumulator A to the stack
+ pshy ; Save Y to the stack
+ pshx ; Save X to the stack
+readLoop jsr getchar ; Jump to putchar to write byte to serial
+ beq readLoop ; While A == 0, loop
+ cmpa #CR ; If A == CR, exit loop
+ beq doneRead ; Branch to doneRead if A == CR
+ staa 1,x+ ; Save the byte to the addr in X, then add 1
+ jsr putchar ; Write Character back to the terminal
+ dey ; Decrement Y by 1
+ beq doneRead ; If Y == 0, no more room, stop reading
+ bra readLoop ; branch always to readLoop
+doneRead ldaa #LF ; Load Line Feed into A
+ jsr putchar ; Write LF to terminal
+ pulx ; Restore X from the stack
+ pulY ; Restore Y from the stack
+ pula ; restore A from the stack
+ rts ; return to caller
+
+;*************************************************************************
+; putchar subroutine
+;
+; This subroutine writes a single byte to a serial line
+;
+; Input: A single ASCII byte in accumulator A
+; Output: Sends one character to SCI port
+; Registers in use: Accumulator A with input byte
+; Memory locations in use: SCISR1 and SCIDRL status and data registers
+;
+
+putchar brclr SCISR1,#%10000000,putchar ; wait for transmit buffer empty
+ staa SCIDRL ; send a character
+ rts ; Return to caller
+
+;*************************************************************************
+; putchar subroutine
+;
+; This subroutine reads one byte from the SCI port
+;
+; Input: One byte from the SCI port
+; Output: One byte in accumulator A
+; Registers in use: Accumulator A for output byte
+; Memory locations in use: SCISR1 and SCIDRL status and data registers
+;
+
+getchar brclr SCISR1,#%00100000,getchar7 ; If no input on SCI port, return 0
+ ldaa SCIDRL ; Read one byte from SCI port into A
+ rts ; Return to caller
+getchar7 clra ; Set A to 0
+ rts ; Return to caller
+
+*
+**************************************************************************
+* Data Section 2: address used [ $3100 to $3FFF ] RAM Memory
+*
+
+invalidStr dc.b 'Invalid input format',CR,LF,NULL ; Invalid input error message
+
+prompt dc.b 'Ecalc> ',NULL ; Prompt string for calculator
+
+overflow dc.b 'Overflow Error',CR,LF,NULL ; Overflow error message
+
+; msg: this is the main option menu string
+msg dc.b 'Rules for Calculator:',CR,LF
+ dc.b '1) Input positive decimal integer numbers only',CR,LF
+ dc.b '2) Input and output maximum four digit numbers only',CR,LF
+ dc.b '3) Valid operators are: +, -, *, and /',CR,LF
+ dc.b '4) Input number with leading zero is OK',CR,LF
+ dc.b '5) Input only two numbers and one operator in between, no spaces',CR,LF
+ dc.b '6) Show Ecalc> prompt and echo print user keystrokes unltil Return key',CR,LF
+ dc.b '7) Repeat print user input and print answer after the = sign',CR,LF
+ dc.b '8) In case of an invalid input format, repeat print the user input until the error character',CR,LF
+ dc.b '9) In case of an invalid input format, print error message on the next line: Invalid input format',CR,LF
+ dc.b '10) Keep 16bit internal binary number format, detect and flag overflow error',CR,LF
+ dc.b '11) Use integer division and truncate any fraction',CR,LF,NULL
+
+ end ; last line of the file
diff --git a/cmpen472_hw8McDonnell/bin/Project.abs b/cmpen472_hw8McDonnell/bin/Project.abs
new file mode 100644
index 0000000..af94fce
--- /dev/null
+++ b/cmpen472_hw8McDonnell/bin/Project.abs
Binary files differ
diff --git a/cmpen472_hw8McDonnell/bin/Project.abs.phy b/cmpen472_hw8McDonnell/bin/Project.abs.phy
new file mode 100644
index 0000000..4fd2ee7
--- /dev/null
+++ b/cmpen472_hw8McDonnell/bin/Project.abs.phy
@@ -0,0 +1,3 @@
+S0580000433A5C55736572735C4A61636F62204D63446F6E6E656C6C5C446F63756D656E74735C434D50454E2D3437322D48575C636D70656E3437325F6877384D63446F6E6E656C6C5C62696E5C50726F6A6563742E61627348
+S2060FFFF03123A7
+S9030000FC
diff --git a/cmpen472_hw8McDonnell/bin/Project.abs.s19 b/cmpen472_hw8McDonnell/bin/Project.abs.s19
new file mode 100644
index 0000000..d2070bd
--- /dev/null
+++ b/cmpen472_hw8McDonnell/bin/Project.abs.s19
@@ -0,0 +1,47 @@
+S0580000433A5C55736572735C4A61636F62204D63446F6E6E656C6C5C446F63756D656E74735C434D50454E2D3437322D48575C636D70656E3437325F6877384D63446F6E6E656C6C5C62696E5C50726F6A6563742E61627348
+S123300000000000000000000000000000000000000010000000000000000000000000009C
+S111302000000000001000000000000000008E
+S1233100CF310086F15A03860C5ACBCC00015CC8CE33561632EB4C3B194C38804C378010EE
+S1233120EF20FE4C3780343BFE302A087E302A8E003C262ACE00007E302AFE3028087E3008
+S1233140288E003C2618CE00007E3028FE3026087E30268E00182606CE00007E3026FC30C7
+S123316026CD300016325D863A163316FC3028CD300016325D863A163316FC302ACD3000FC
+S123318016325D860D163316860A1633163A300B353B34C77B302CCD0000A630813922204F
+S12331A081302D08028D0004221620EE812B2730812D272C812A2728812F27248100273873
+S12331C0876A0030341632EB860D163316860A163316CE33261632EB8604B702303A313D0D
+S12331E07A302CA61E81302DD7813922D3CB01C10122CDCD000020A2A61E81302DC28139A3
+S123320022BEB6302C27B987B702303A313D3BCD0000E630272AC12B2726C12D2722C12AF6
+S1233220271EC12F271AC1202716C1302D17C1392213C03037CC000A13B7C63319ED20D2DA
+S123324087B7023A3D8604B7023A3D343536A67F27056A3020F8876A303231303D34353BC2
+S12332608C000027572D633635348630CE3013CD00051632E53031876A4032CE000A181087
+S12332808E00002708CB306B60B7D420EE8C000026F33A3B8C000A2C0486306A60B6302C9C
+S12332A0812D26026A60CE301316324B1632EBFD3024CE30131632DC3A31303D8630163336
+S12332C01686301633163A31303D36862D7A302C3240800150C001C30001208B36876A305E
+S12332E00436FB323D6A300436FB3D36A630270516331620F7323D36353416331D27FB8155
+S12333000D270A6A3016331603270220ED860A1633163031323D4FCC80FC5ACF3D4FCC2042
+S12333200396CF3D873D496E76616C696420696E70757420666F726D61740D0A0045636140
+S12333406C633E20004F766572666C6F77204572726F720D0A0052756C657320666F722015
+S123336043616C63756C61746F723A0D0A31292020496E70757420706F7369746976652091
+S1233380646563696D616C20696E7465676572206E756D62657273206F6E6C790D0A3229DC
+S12333A02020496E70757420616E64206F7574707574206D6178696D756D20666F7572207B
+S12333C06469676974206E756D62657273206F6E6C790D0A3329202056616C6964206F7038
+S12333E0657261746F7273206172653A202B2C202D2C202A2C20616E64202F0D0A3429209B
+S123340020496E707574206E756D6265722077697468206C656164696E67207A65726F20FF
+S12334206973204F4B0D0A35292020496E707574206F6E6C792074776F206E756D62657228
+S12334407320616E64206F6E65206F70657261746F7220696E206265747765656E2C206EF9
+S12334606F207370616365730D0A3629202053686F77204563616C633E2070726F6D7074EB
+S123348020616E64206563686F207072696E742075736572206B65797374726F6B65732056
+S12334A0756E6C74696C2052657475726E206B65790D0A372920205265706561742070724D
+S12334C0696E74207573657220696E70757420616E64207072696E7420616E7377657220FE
+S12334E0616674657220746865203D207369676E0D0A38292020496E2063617365206F6607
+S123350020616E20696E76616C696420696E70757420666F726D61742C20726570656174EB
+S1233520207072696E7420746865207573657220696E70757420756E74696C2074686520DD
+S12335406572726F72206368617261637465720D0A39292020496E2063617365206F66202F
+S1233560616E20696E76616C696420696E70757420666F726D61742C207072696E7420657A
+S123358072726F72206D657373616765206F6E20746865206E657874206C696E653A2049B5
+S12335A06E76616C696420696E70757420666F726D61740D0A313029204B656570203136C3
+S12335C062697420696E7465726E616C2062696E617279206E756D62657220666F726D61A8
+S12335E0742C2064657465637420616E6420666C6167206F766572666C6F77206572726F15
+S1233600720D0A3131292055736520696E7465676572206469766973696F6E20616E64203F
+S11B36207472756E6361746520616E79206672616374696F6E0D0A0033
+S105FFF03123B7
+S9030000FC
diff --git a/cmpen472_hw8McDonnell/bin/main.dbg b/cmpen472_hw8McDonnell/bin/main.dbg
new file mode 100644
index 0000000..e946a3c
--- /dev/null
+++ b/cmpen472_hw8McDonnell/bin/main.dbg
@@ -0,0 +1,576 @@
+**************************************************************************
+*
+* Title: Calculator
+*
+* Objective: CMPEN 472 Homework 7
+*
+* Revision: V1.0
+*
+* Date: Mar. 7, 2025
+*
+* Programmer: Jacob McDonnell
+*
+* Company: The Pennsylvania State University
+* Department of Computer Science and Engineering
+*
+* Algorithm: Simple Serial I/O, address poking and modifying
+*
+* Register Use: A & B to current byte, etc,
+* X & Y holds address of strings and length of string,
+* D to hold data and address of the memory location to work on.
+*
+* Memory Use: RAM Locations from $3000 for data,
+* RAM Locations from $3100 for program
+*
+* Input: Serial Port for User Input
+*
+* Output: Serial Port for String Output
+* Memory locations changed if modified by user
+*
+* Observation: This program is a simple 16-bit calculator. The input can be
+* any 4 digit positive decimal integer, the output can be negative.
+* The +, -, *, and / operators are supported. Only two numbers at
+* a time.
+*
+* Note: ON CSM-12C128 board,
+*
+* Comments: This program is developed and simulated using CodeWarrior
+* development software and targeted for Axion
+* Manufacturing's CSM-12C128 board running at 24MHz.
+*
+**************************************************************************
+* Parameter Declearation Section
+*
+* Export Symbols
+ xdef pgstart ; export 'pgstart' symbol
+ absentry pgstart ; for assembly entry point
+
+* Symbols and Macros
+PORTA equ $0000 ; i/o port A addresses
+DDRA equ $0002 ; data direction register for PORTA
+PORTB equ $0001 ; i/o port B addresses
+DDRB equ $0003 ; data direction register for PORTB
+
+SCIBDH equ $00C8 ; Serial port (SCI) Baud Register H
+SCIBDL equ $00C9 ; Serial port (SCI) Baud Register L
+SCICR2 equ $00CB ; Serial port (SCI) Control Register 2
+SCISR1 equ $00CC ; Serial port (SCI) Status Register 1
+SCIDRL equ $00CF ; Serial port (SCI) Data Register
+
+CRGFLG EQU $0037 ; Clock and Reset Generator Flags
+CRGINT EQU $0038 ; Clock and Reset Generator Interrupts
+RTICTL EQU $003B ; Real Time Interrupt Control
+
+CR equ $0d ; carriage return, ASCII 'Return' key
+LF equ $0a ; line feed, ASCII 'next line' character
+NULL equ $00 ; NULL Terminator character
+
+**************************************************************************
+* Data Section: address used [ $3000 to $30FF ] RAM Memory
+*
+ org $3000 ; Reserved RAM memory starting address
+ ; for Data for CMPEN 472 class
+buffer ds.b $0010 ; Array of 16 bytes to read a string
+ dc.b NULL ; NULL terminated
+lenBuf dc.w $0010 ; Length of buffer array
+
+buffer2 ds.b $0010 ; Array of 16 bytes for reading and reversal
+ dc.b NULL ; NULL terminated
+lenBuf2 dc.w $0010 ; length of buffer2
+
+hours dc.w $0000 ; Buffer to hold the hours of the time
+
+minutes dc.w $0000 ; Buffer to hold the minutes of the time
+
+seconds dc.w $0000 ; Buffer to hold the seconds of the time
+
+operator dc.b $0
+
+numBuf dc.b $0
+
+*
+* There is a section Data Section at the end of the file
+**************************************************************************
+* Interrupt Vector Section: address used [ $FFF0 to $FFFF ] RAM Memory
+*
+ org $FFF0 ; Memory location for Interrupt vector section for simulator
+ dc.w rtiisr ; Real Time Interrupt vector
+*
+**************************************************************************
+* Program Section: address used [ $3100 to $3FFF ] RAM Memory
+*
+ org $3100 ; Program start address, in RAM
+pgstart lds #$3100 ; initialize the stack pointer
+
+ ldaa #%11110001 ; LED 1,2,3,4 at PORTB bit 4,5,6,7
+ staa DDRB ; set PORTB bit 4,5,6,7 as output
+
+ ldaa #$0C ; Enable SCI port Tx and Rx units
+ staa SCICR2 ; disable SCI interrupts
+
+ ldd #$0001 ; Set SCI Baud Register = $0001 => 1.5M baud at 24MHz (for simulation)
+ std SCIBDH ; SCI port baud rate change
+
+ ldx #msg ; Load the address of the welcome message into X
+ jsr WriteString ; Write the string to the serial console
+
+ bset RTICTL,%00011001; set RTI: dev=10*(2**10)=2.555msec for C128 board
+ ; 4MHz quartz oscillator clock
+ bset CRGINT,%10000000; enable RTI interrupt
+ bset CRGFLG,%10000000; clear RTI IF (Interrupt Flag)
+
+ cli ; Enable interrupts
+mainLoop
+ bra mainLoop ; Loop back to mainLoop always
+
+**************************************************************************
+* Subroutine Section: address used [ $3100 to $3FFF ] RAM Memory
+*
+
+rtiisr bset CRGFLG,%10000000; Clear RTI Interrupt Flag
+ pshx ; Save X to the stack
+ pshd ; Save D to the stack
+ ldx seconds ; Load the seconds into X
+ inx ; Increment the seconds by 1
+ stx seconds ; Save the new seconds to the location
+ cpx #60 ; Compare X to 60
+ bne rtidone ; If X != 60, exit isr
+ ldx #0 ; Reset the seconds
+ stx seconds ; Save the new seconds to the location
+ ldx minutes ; load the minutes into X
+ inx ; Increment the minutes by 1
+ stx minutes ; Save the updated minutes
+ cpx #60 ; Compare the minutes to 60
+ bne rtidone ; If X != 60, exit isr
+ ldx #0 ; Reset the minutes
+ stx minutes ; Save the updated minutes
+ ldx hours ; Load the hours into X
+ inx ; Increment the hours by 1
+ stx hours ; Save the updated hours
+ cpx #24 ; Compare the hours to 24
+ bne rtidone ; If X != 24, exit the isr
+ ldx #0 ; Reset the hours
+ stx hours ; Save the updated hours
+rtidone ldd hours ; Load the hours into D
+ ldy #buffer ; Load the address of buffer into Y
+ jsr PrintDecimalWord; Print the number to the serial
+ ldaa #':' ; Load the character ':' into A
+ jsr putchar ; Write the character to the serial
+ ldd minutes ; Load the minutes into D
+ ldy #buffer ; Load the address of buffer into Y
+ jsr PrintDecimalWord; Print the number to the serial
+ ldaa #':' ; Load the character ':' into A
+ jsr putchar ; Write the character to the serial
+ ldd seconds ; Load the seconds into D
+ ldy #buffer ; Load the address of buffer into Y
+ jsr PrintDecimalWord; Print the number to the serial
+ ldaa #CR ; Load the character CR into A
+ jsr putchar ; Write the character to the serial
+ ldaa #LF ; Load the character LF into A
+ jsr putchar ; Write the character to the serial
+ puld ; Restore D from the stack
+ pulx ; Restore X from the stack
+ RTI
+
+;*************************************************************************
+; VerifyInput subroutine
+;
+; This subroutine will verify the user input is valid.
+;
+; Input: An address of a Null terminated string in register X.
+; Output: If valid Zero bit = 0 in CCR, if invalid, Zero bit = 1
+; and the string is outputed up to the error on the serial
+; console with an error message.
+; Registers in use: X for the address of the string, A for reading characters.
+; Y to count the number of digits in a number, & B to count the number of numbers
+; Memory locations in use: Memory Address for serial line, address of the string, 1 byte for operator
+;
+; Comments: This subroutine will modify the user string if invalid.
+;
+
+VerifyInput
+ pshy ; Save Y to the stack
+ pshd ; Save D to the stack
+ pshx ; Save X to the stack
+ clrb ; Set B to Zero
+ stab operator ; Clear operator
+ ldy #0 ; Load Zero into Y
+vNumLoop ldaa 1,x+ ; Load character from X into A
+ cmpa #'9' ; Compare A to '9'
+ bhi vInvalid ; If A > '9', not valid string
+ cmpa #'0' ; Compare A to '0'
+ blt vIsOp ; If A < '0', check if operator
+ iny ; Increment Y by 1 to count numbers
+ cpy #4 ; Compare Y to 4
+ bhi vInvalid ; If greater than 4, invalid
+ bra vNumLoop ; Loop back to check for more digits
+vIsOp cmpa #'+' ; Compare A to '+'
+ beq vOp ; This is an operator
+ cmpa #'-' ; Compare A to '-'
+ beq vOp ; This is an operator
+ cmpa #'*' ; Compare A to '*'
+ beq vOp ; This is an operator
+ cmpa #'/' ; Compare A to '/'
+ beq vOp ; This is an operator
+ cmpa #NULL ; Compare A to NULL character
+ beq vEndOfLine ; Check if end of line
+vInvalid clra ; Set A to zero
+ staa 0,X ; Write Null terminator to X
+ pulx ; Restore X from the stack
+ pshx ; Save X to the stack
+ jsr WriteString ; Write invalid string to serial console
+ ldaa #CR ; Load CR into A
+ jsr putchar ; Jump to putchar to write the character
+ ldaa #LF ; Load LF into A
+ jsr putchar ; Jump to putchar to write the character
+ ldx #invalidStr ; Load address of invalid string into X
+ jsr WriteString ; Write invalid string to serial console
+ ldaa #4 ; Load 4 into A to set zero bit
+ tap ; Transfer A to CCR
+ pulx ; Restore X from the stack
+ puld ; Restore D from the stack
+ puly ; Restore Y from the stack
+ rts ; Return to caller
+vOp staa operator ; Store operator in operator buffer
+ ldaa -2,x ; Load previous character into A
+ cmpa #'0' ; Compare A to '0'
+ blt vInvalid ; Invalid string since previous is not number
+ cmpa #'9' ; Compare A to '9'
+ bhi vInvalid ; Invalid string since previous is not number
+ addb #1 ; Increment B by 1
+ cmpb #1 ; Compare B to 1
+ bhi vInvalid ; Invalid string since B > 1 and we have another operator
+ ldy #0 ; Set Y to 0
+ bra vNumLoop ; Check for next number
+vEndOfLine ldaa -2,x ; Load previous character into A
+ cmpa #'0' ; Compare A to '0'
+ blt vInvalid ; Invalid string since previous is not number
+ cmpa #'9' ; Compare A to '9'
+ bhi vInvalid ; Invalid string since previous is not number
+ ldaa operator ; Load operator character from buffer
+ beq vInvalid ; If operator buffer is zero, invalid
+ clra ; Set A to zero
+ tap ; Transfer A to CCR
+ pulx ; Restore X from the stack
+ puld ; Restore D from the stack
+ puly ; Restore Y from the stack
+ rts ; Return to caller
+
+;*************************************************************************
+; ReadDecimal subroutine
+;
+; This subroutine will read an ASCII string of a number in decimal and convert it to
+; its value.
+;
+; Input: A memory address in register X.
+; Output: The value of the number in the Y register, and any errors printed
+; to the serial line. Zero bit is set if error occurs.
+; Registers in use: X for the address of the contents and for a buffer while printing,
+; D for multiplication, B for the character, Y for output value.
+; Memory locations in use: Memory Address for serial line, address of the string
+;
+; Comments: This subroutine will return the value in the Y register, and if an error occurs,
+; the Zero bit in the CCR will be set.
+;
+
+ReadDecimal
+ pshd ; Save D to the stack
+ ldy #0 ; Clear Y register
+dHLoop ldab 1,x+ ; Read Next character from X
+ beq dHDone ; If B == 0, exit loop
+ cmpb #'+' ; Compare B to '+'
+ beq dHDone ; If B == '+', end of number
+ cmpb #'-' ; Compare B to '-'
+ beq dHDone ; If B == '-', end of number
+ cmpb #'*' ; Compare B to '*'
+ beq dHDone ; If B == '+', end of number
+ cmpb #'/' ; Compare B to '/'
+ beq dHDone ; If B == '-', end of number
+ cmpb #' ' ; Compare B to space character
+ beq dHDone ; If B == ' ', exit loop
+ cmpb #'0' ; Compare B to '0' character
+ blt dHError ; If B < '0', bad address, exit loop
+ cmpb #'9' ; Compare B to '9' character
+ bhi dHError ; If B > '9', check if 'A'-'F' characters
+ subb #'0' ; Subtract '0' from B to get true value
+ pshb ; Save B to the stack
+ ldd #10 ; load 10 into D
+ emul ; Multiply Y and D
+ exg d,y ; Transfer data from D to Y
+ pulb ; Restore b from the stack
+ aby ; Add B to Y
+ bra dHLoop ; Branch always to rHLoop
+dHDone clra ; clear A accumulator
+ tap ; Transfer A into CCR to clear zero bit
+ puld ; Restore D from the stack
+ rts ; Return to caller
+dHError ldaa #4 ; Load 4 into A to set zero bit in CCR
+ tap ; Transfer A into CCR to set zero bit and warn error
+ puld ; Restore D from the stack
+ rts ; Return to caller
+
+;*************************************************************************
+; strrev subroutine
+;
+; This subroutine will reverse a string from one buffer into another.
+;
+; Input: Address of null terminated string in X, address of a large enough
+; buffer in Y.
+; Output: The string in X reversed in Y.
+; Registers in use: X for the address of the string, Y for the address of the buffer,
+; A to read characters from the string.
+; Memory locations in use: Memory Address for serial line, address of the string & buffer
+;
+; Comments: This subroutine will not check that the output buffer is large enough, that
+; is the job of the caller.
+;
+
+strrev
+ pshx ; Save X to the stack
+ pshy ; Save Y to the stack
+ psha ; Save A to the stack
+revLoop ldaa 1,y- ; Load Character from Y into A, decrement Y
+ beq revDone ; If Character is 0, exit loop
+ staa 1,x+ ; Save character in address in X, increment X
+ bra revLoop ; Loop back always
+ clra ; Set A to Zero
+revDone staa 1,x+ ; Copy Null terminator into new string
+ pula ; Restore A from the stack
+ puly ; Restore Y from the stack
+ pulx ; Restore X from the stack
+ rts ; Return to caller
+
+;*************************************************************************
+; PrintDecimalWord subroutine
+;
+; This subroutine will print a given word of data to the serial in binary.
+;
+; Input: 1 word of data in register D, Buffer Address in Y
+; Output: Decimal representation of the data on the serial console
+; Registers in use: Y for the address of the buffer, X to count the number of bits
+; written and for division, D for the input, A for characters.
+; Memory locations in use: Memory addresses for serial, and operator to hold sign
+;
+; Comments: This subroutine requires serial to be setup and putchar subroutine.
+;
+
+PrintDecimalWord
+ pshx ; Save X to the stack
+ pshy ; Save Y to the stack
+ pshd ; Save D (A:B) to the stack
+ cpd #0 ; Compare D to zero
+ beq dIsZero ; Branch to hIsZero
+ blt dIsNegative ; If D < 0, Jump to dIsNegative
+dAfterNeg psha ; Save A to the stack
+ pshy ; Save Y to the stack
+ pshx ; Save x to the stack
+ ldaa #'0' ; Load the '0' character into A
+ ldx #buffer2 ; Load the address of buffer2 into X
+ ldy #5 ; Load 5 into Y
+ jsr memset ; Write '0' to the first 5 bytes in buffer2
+ pulx ; Restore X from the stack
+ puly ; Restore Y from the stack
+ clra ; Set A to zero
+ staa 0,y ; Load Zero into Y for Null Terminator
+ pula ; Restore A from the stack
+dPrintLoop ldx #10 ; Load 10 in X for division
+ idiv ; Divide D / 10 to get Hex Digit
+ cpx #0 ; Compare X to 0
+ beq dCheck ; If X == 0, branch to check D is zero
+dDNotZero addb #'0' ; Add '0' to B to get ASCII Character
+ stab 1,+y ; Save character from B to Y
+ exg X,D ; Swap values in X and D
+ bra dPrintLoop ; Loop to hPrintLoop
+dCheck cpd #0 ; Compare D to 0
+ bne dDNotZero ; If D != 0, branch back to hDNotZero
+dPrintDone puld ; Restore D from the stack
+ pshd ; Save D to the stack
+ cpd #10 ; Compare D to 10
+ bge dNoZero ; If D >= 10, jump to dNoZero
+ ldaa #'0' ; Load '0' character into A
+ staa 1,+y ; Load the '0' character in A to Y and increment Y
+dNoZero ldaa operator ; Load operator into A to see if negative
+ cmpa #'-' ; Compare A to '-'
+ bne dNotNeg ; If A != '-', jump to dNotNeg
+ staa 1,+y ; Save '-' into buffer
+dNotNeg ldx #buffer2 ; Load the address of buffer2 in X
+ jsr strrev ; Reverse string in Y in buffer in X
+ jsr WriteString ; Jump to write string to write the number
+ ldy lenBuf2 ; Load the length of buffer2 into Y
+ ldx #buffer2 ; Load the address of buffer2 into X
+ jsr Zeros ; Fill buffer2 with zeros
+ puld ; Restore D (A:B) from the stack
+ puly ; Restore Y from the stack
+ pulx ; Restore X from the stack
+ rts ; Return to caller
+dIsZero ldaa #'0' ; Load '0' character into A
+ jsr putchar ; Print character to the screen
+ ldaa #'0' ; Load '0' character into A
+ jsr putchar ; Print character to the screen
+ puld ; Restore D (A:B) from the stack
+ puly ; Restore Y from the stack
+ pulx ; Restore X from the stack
+ rts ; Return to caller
+dIsNegative psha ; Save A to the stack
+ ldaa #'-' ; Load '-' into A
+ staa operator ; Save '-' to operator buffer
+ pula ; Restore A from the stack
+ nega ; Two's complement of A
+ suba #1 ; Subtract 1 from A
+ negb ; Two'complement of B
+ subb #1 ; Subtract 1 from B
+ addd #1 ; Add 1 to D
+ bra dAfterNeg ; Jump back to dAfterNeg
+
+;*************************************************************************
+; Zeros subroutine
+;
+; This subroutine will write zeros to every byte in a given array.
+;
+; Input: Address of an array in X and its length in Y
+; Output: Zeros in every byte of an array.
+; Registers in use: X for the address of the array, Y for the length, and A for 0
+; Memory locations in use: Memory Address of the array
+;
+; Comments: This subroutine requires serial to be setup and putchar subroutine.
+;
+
+Zeros
+ psha ; Save A to the Stack
+ clra ; Clear A
+zerosLoop staa 1,x+ ; Load A into byte at X
+ dbne y,zerosLoop ; Decrement Y and loop if Y != 0
+ pula ; Restore A from the stack
+ rts ; Return to caller
+
+;*************************************************************************
+; memset subroutine
+;
+; This subroutine will write a given byte to every byte in a given array.
+;
+; Input: Address of an array in X and its length in Y, the byte in A
+; Output: The given byte in every byte of an array.
+; Registers in use: X for the address of the array, Y for the length, and A for the given byte
+; Memory locations in use: Memory Address of the array
+;
+; Comments: This subroutine requires serial to be setup and putchar subroutine.
+;
+
+memset
+ staa 1,x+ ; Load A into byte at X
+ dbne y,memset ; Decrement Y and loop if Y != 0
+ rts ; Return to caller
+
+;*************************************************************************
+; WriteString subroutine
+;
+; This subroutine will write a given null terminated string to the serial.
+;
+; Input: Address of null terminated string in X
+; Output: Null terminated string written to serial
+; Registers in use: X for the address of the string and A for the current byte
+; Memory locations in use: Memory Address for serial line, address of the string
+;
+; Comments: This subroutine requires serial to be setup and putchar subroutine.
+;
+
+WriteString
+ psha ; Save A to the stack
+writeLoop ldaa 1,x+ ; Load the byte at addr in X, then add 1
+ beq doneWrite ; if A == 0, branch to doneWrite
+ jsr putchar ; Jump to putchar to write byte to serial
+ bra writeLoop ; branch always to writeLoop
+doneWrite pula ; restore A from the stack
+ rts ; return to caller
+
+;*************************************************************************
+; ReadString subroutine
+;
+; This subroutine will read a string from the serial line to a given address.
+;
+; Input: Address of an array in X
+; Output: Null terminated string in the given array
+; Registers in use: X for the address of the string Y for the length of the string,
+; and A for the current byte
+; Memory locations in use: Memory Address for serial line, address of the string
+;
+; Comments: This subroutine requires serial to be setup and getchar subroutine.
+;
+
+ReadString
+ psha ; Save accumulator A to the stack
+ pshy ; Save Y to the stack
+ pshx ; Save X to the stack
+readLoop jsr getchar ; Jump to putchar to write byte to serial
+ beq readLoop ; While A == 0, loop
+ cmpa #CR ; If A == CR, exit loop
+ beq doneRead ; Branch to doneRead if A == CR
+ staa 1,x+ ; Save the byte to the addr in X, then add 1
+ jsr putchar ; Write Character back to the terminal
+ dey ; Decrement Y by 1
+ beq doneRead ; If Y == 0, no more room, stop reading
+ bra readLoop ; branch always to readLoop
+doneRead ldaa #LF ; Load Line Feed into A
+ jsr putchar ; Write LF to terminal
+ pulx ; Restore X from the stack
+ pulY ; Restore Y from the stack
+ pula ; restore A from the stack
+ rts ; return to caller
+
+;*************************************************************************
+; putchar subroutine
+;
+; This subroutine writes a single byte to a serial line
+;
+; Input: A single ASCII byte in accumulator A
+; Output: Sends one character to SCI port
+; Registers in use: Accumulator A with input byte
+; Memory locations in use: SCISR1 and SCIDRL status and data registers
+;
+
+putchar brclr SCISR1,#%10000000,putchar ; wait for transmit buffer empty
+ staa SCIDRL ; send a character
+ rts ; Return to caller
+
+;*************************************************************************
+; putchar subroutine
+;
+; This subroutine reads one byte from the SCI port
+;
+; Input: One byte from the SCI port
+; Output: One byte in accumulator A
+; Registers in use: Accumulator A for output byte
+; Memory locations in use: SCISR1 and SCIDRL status and data registers
+;
+
+getchar brclr SCISR1,#%00100000,getchar7 ; If no input on SCI port, return 0
+ ldaa SCIDRL ; Read one byte from SCI port into A
+ rts ; Return to caller
+getchar7 clra ; Set A to 0
+ rts ; Return to caller
+
+*
+**************************************************************************
+* Data Section 2: address used [ $3100 to $3FFF ] RAM Memory
+*
+
+invalidStr dc.b 'Invalid input format',CR,LF,NULL ; Invalid input error message
+
+prompt dc.b 'Ecalc> ',NULL ; Prompt string for calculator
+
+overflow dc.b 'Overflow Error',CR,LF,NULL ; Overflow error message
+
+; msg: this is the main option menu string
+msg dc.b 'Rules for Calculator:',CR,LF
+ dc.b '1) Input positive decimal integer numbers only',CR,LF
+ dc.b '2) Input and output maximum four digit numbers only',CR,LF
+ dc.b '3) Valid operators are: +, -, *, and /',CR,LF
+ dc.b '4) Input number with leading zero is OK',CR,LF
+ dc.b '5) Input only two numbers and one operator in between, no spaces',CR,LF
+ dc.b '6) Show Ecalc> prompt and echo print user keystrokes unltil Return key',CR,LF
+ dc.b '7) Repeat print user input and print answer after the = sign',CR,LF
+ dc.b '8) In case of an invalid input format, repeat print the user input until the error character',CR,LF
+ dc.b '9) In case of an invalid input format, print error message on the next line: Invalid input format',CR,LF
+ dc.b '10) Keep 16bit internal binary number format, detect and flag overflow error',CR,LF
+ dc.b '11) Use integer division and truncate any fraction',CR,LF,NULL
+
diff --git a/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Postload.cmd b/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Postload.cmd
new file mode 100644
index 0000000..ac4d359
--- /dev/null
+++ b/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Postload.cmd
@@ -0,0 +1 @@
+// After load the commands written below will be executed
diff --git a/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Preload.cmd b/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Preload.cmd
new file mode 100644
index 0000000..0bed464
--- /dev/null
+++ b/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Preload.cmd
@@ -0,0 +1 @@
+// Before load the commands written below will be executed
diff --git a/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Reset.cmd b/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Reset.cmd
new file mode 100644
index 0000000..bf55944
--- /dev/null
+++ b/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Reset.cmd
@@ -0,0 +1 @@
+// After reset the commands written below will be executed
diff --git a/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_SetCPU.cmd b/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_SetCPU.cmd
new file mode 100644
index 0000000..6a1549a
--- /dev/null
+++ b/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_SetCPU.cmd
@@ -0,0 +1 @@
+// At startup the commands written below will be executed
diff --git a/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Startup.cmd b/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Startup.cmd
new file mode 100644
index 0000000..6a1549a
--- /dev/null
+++ b/cmpen472_hw8McDonnell/cmd/Full_Chip_Simulation_Startup.cmd
@@ -0,0 +1 @@
+// At startup the commands written below will be executed
diff --git a/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell.mcp b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell.mcp
new file mode 100644
index 0000000..ce6cfc9
--- /dev/null
+++ b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell.mcp
Binary files differ
diff --git a/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/CWSettingsWindows.stg b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/CWSettingsWindows.stg
new file mode 100644
index 0000000..60d7785
--- /dev/null
+++ b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/CWSettingsWindows.stg
Binary files differ
diff --git a/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.o b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.o
new file mode 100644
index 0000000..af94fce
--- /dev/null
+++ b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.o
Binary files differ
diff --git a/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.sx b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.sx
new file mode 100644
index 0000000..5482821
--- /dev/null
+++ b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.sx
@@ -0,0 +1,47 @@
+S0840000433A5C55736572735C4A61636F62204D63446F6E6E656C6C5C446F63756D656E74735C434D50454E2D3437322D48575C636D70656E3437325F6877384D63446F6E6E656C6C5C636D70656E3437325F6877384D63446F6E6E656C6C5F446174615C5374616E646172645C4F626A656374436F64655C6D61696E2E61736D2E70726DC9
+S123300000000000000000000000000000000000000010000000000000000000000000009C
+S111302000000000001000000000000000008E
+S105FFF03123B7
+S1233100CF310086F15A03860C5ACBCC00015CC8CE33561632EB4C3B194C38804C378010EE
+S1233120EF20FE4C3780343BFE302A087E302A8E003C262ACE00007E302AFE3028087E3008
+S1233140288E003C2618CE00007E3028FE3026087E30268E00182606CE00007E3026FC30C7
+S123316026CD300016325D863A163316FC3028CD300016325D863A163316FC302ACD3000FC
+S123318016325D860D163316860A1633163A300B353B34C77B302CCD0000A630813922204F
+S12331A081302D08028D0004221620EE812B2730812D272C812A2728812F27248100273873
+S12331C0876A0030341632EB860D163316860A163316CE33261632EB8604B702303A313D0D
+S12331E07A302CA61E81302DD7813922D3CB01C10122CDCD000020A2A61E81302DC28139A3
+S123320022BEB6302C27B987B702303A313D3BCD0000E630272AC12B2726C12D2722C12AF6
+S1233220271EC12F271AC1202716C1302D17C1392213C03037CC000A13B7C63319ED20D2DA
+S123324087B7023A3D8604B7023A3D343536A67F27056A3020F8876A303231303D34353BC2
+S12332608C000027572D633635348630CE3013CD00051632E53031876A4032CE000A181087
+S12332808E00002708CB306B60B7D420EE8C000026F33A3B8C000A2C0486306A60B6302C9C
+S12332A0812D26026A60CE301316324B1632EBFD3024CE30131632DC3A31303D8630163336
+S12332C01686301633163A31303D36862D7A302C3240800150C001C30001208B36876A305E
+S12332E00436FB323D6A300436FB3D36A630270516331620F7323D36353416331D27FB8155
+S12333000D270A6A3016331603270220ED860A1633163031323D4FCC80FC5ACF3D4FCC2042
+S12333200396CF3D873D496E76616C696420696E70757420666F726D61740D0A0045636140
+S12333406C633E20004F766572666C6F77204572726F720D0A0052756C657320666F722015
+S123336043616C63756C61746F723A0D0A31292020496E70757420706F7369746976652091
+S1233380646563696D616C20696E7465676572206E756D62657273206F6E6C790D0A3229DC
+S12333A02020496E70757420616E64206F7574707574206D6178696D756D20666F7572207B
+S12333C06469676974206E756D62657273206F6E6C790D0A3329202056616C6964206F7038
+S12333E0657261746F7273206172653A202B2C202D2C202A2C20616E64202F0D0A3429209B
+S123340020496E707574206E756D6265722077697468206C656164696E67207A65726F20FF
+S12334206973204F4B0D0A35292020496E707574206F6E6C792074776F206E756D62657228
+S12334407320616E64206F6E65206F70657261746F7220696E206265747765656E2C206EF9
+S12334606F207370616365730D0A3629202053686F77204563616C633E2070726F6D7074EB
+S123348020616E64206563686F207072696E742075736572206B65797374726F6B65732056
+S12334A0756E6C74696C2052657475726E206B65790D0A372920205265706561742070724D
+S12334C0696E74207573657220696E70757420616E64207072696E7420616E7377657220FE
+S12334E0616674657220746865203D207369676E0D0A38292020496E2063617365206F6607
+S123350020616E20696E76616C696420696E70757420666F726D61742C20726570656174EB
+S1233520207072696E7420746865207573657220696E70757420756E74696C2074686520DD
+S12335406572726F72206368617261637465720D0A39292020496E2063617365206F66202F
+S1233560616E20696E76616C696420696E70757420666F726D61742C207072696E7420657A
+S123358072726F72206D657373616765206F6E20746865206E657874206C696E653A2049B5
+S12335A06E76616C696420696E70757420666F726D61740D0A313029204B656570203136C3
+S12335C062697420696E7465726E616C2062696E617279206E756D62657220666F726D61A8
+S12335E0742C2064657465637420616E6420666C6167206F766572666C6F77206572726F15
+S1233600720D0A3131292055736520696E7465676572206469766973696F6E20616E64203F
+S11B36207472756E6361746520616E79206672616374696F6E0D0A0033
+S9033100CB
diff --git a/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/TargetDataWindows.tdt b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/TargetDataWindows.tdt
new file mode 100644
index 0000000..a624e60
--- /dev/null
+++ b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/TargetDataWindows.tdt
Binary files differ
diff --git a/cmpen472_hw8McDonnell/prm/burner.bbl b/cmpen472_hw8McDonnell/prm/burner.bbl
new file mode 100644
index 0000000..0c57619
--- /dev/null
+++ b/cmpen472_hw8McDonnell/prm/burner.bbl
@@ -0,0 +1,157 @@
+/* logical s-record file */
+OPENFILE "%ABS_FILE%.s19"
+format=motorola
+busWidth=1
+origin=0
+len=0x1000000
+destination=0
+SRECORD=Sx
+SENDBYTE 1 "%ABS_FILE%"
+CLOSE
+
+
+/* physical s-record file */
+OPENFILE "%ABS_FILE%.phy"
+format = motorola
+busWidth = 1
+len = 0x4000
+
+/* logical non banked flash at $4000 and $C000 to physical */
+origin = 0x004000
+destination = 0x0F8000
+SENDBYTE 1 "%ABS_FILE%"
+
+origin = 0x00C000
+destination = 0x0FC000
+SENDBYTE 1 "%ABS_FILE%"
+
+/* physical FTS512K flash window to physical
+origin = 0x008000
+destination = 0x080000
+SENDBYTE 1 "%ABS_FILE%"
+*/
+
+/* physical FTS256K parts flash window to physical
+origin = 0x008000
+destination = 0x0C0000
+SENDBYTE 1 "%ABS_FILE%"
+*/
+
+/* physical FTS128K parts flash window to physical
+origin = 0x008000
+destination = 0x0E0000
+SENDBYTE 1 "%ABS_FILE%"
+*/
+
+/* physical FTS64K parts flash window to physical
+origin = 0x008000
+destination = 0x0F0000
+SENDBYTE 1 "%ABS_FILE%"
+*/
+
+/* physical FTS32K parts flash window to physical
+origin = 0x008000
+destination = 0x0F8000
+SENDBYTE 1 "%ABS_FILE%"
+*/
+
+/* logical 512 kB banked flash to physical */
+origin = 0x208000
+destination = 0x080000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x218000
+destination = 0x084000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x228000
+destination = 0x088000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x238000
+destination = 0x08C000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x248000
+destination = 0x090000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x258000
+destination = 0x094000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x268000
+destination = 0x098000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x278000
+destination = 0x09C000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x288000
+destination = 0x0A0000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x298000
+destination = 0x0A4000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x2A8000
+destination = 0x0A8000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x2B8000
+destination = 0x0AC000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x2C8000
+destination = 0x0B0000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x2D8000
+destination = 0x0B4000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x2E8000
+destination = 0x0B8000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x2F8000
+destination = 0x0BC000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x308000
+destination = 0x0C0000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x318000
+destination = 0x0C4000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x328000
+destination = 0x0C8000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x338000
+destination = 0x0CC000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x348000
+destination = 0x0D0000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x358000
+destination = 0x0D4000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x368000
+destination = 0x0D8000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x378000
+destination = 0x0DC000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x388000
+destination = 0x0E0000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x398000
+destination = 0x0E4000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x3A8000
+destination = 0x0E8000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x3B8000
+destination = 0x0EC000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x3C8000
+destination = 0x0F0000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x3D8000
+destination = 0x0F4000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x3E8000
+destination = 0x0F8000
+SENDBYTE 1 "%ABS_FILE%"
+origin = 0x3F8000
+destination = 0x0FC000
+SENDBYTE 1 "%ABS_FILE%"
+
+CLOSE
+
diff --git a/cmpen472hw7_McDonnell/Full_Chip_Simulation.ini b/cmpen472hw7_McDonnell/Full_Chip_Simulation.ini
index 9b200fa..31a4a6c 100644
--- a/cmpen472hw7_McDonnell/Full_Chip_Simulation.ini
+++ b/cmpen472hw7_McDonnell/Full_Chip_Simulation.ini
@@ -10,7 +10,7 @@ Target=sim
Layout=ASM_layout.hwl
LoadDialogOptions=AUTOERASEANDFLASH NORUNAFTERLOAD
CPU=HC12
-MainFrame=0,1,-1,-1,-1,-1,556,102,2213,1114
+MainFrame=0,1,-1,-1,-1,-1,663,183,2320,1195
TOOLBAR=57600 57601 32795 0 57635 57634 57637 0 57671 57669 0 32777 32776 32782 32780 32781 32778 0 32806
Configuration=Full_Chip_Simulation.hwc
Statusbar=1
diff --git a/cmpen472hw7_McDonnell/bin/Project.abs b/cmpen472hw7_McDonnell/bin/Project.abs
index f9f25c0..746d865 100644
--- a/cmpen472hw7_McDonnell/bin/Project.abs
+++ b/cmpen472hw7_McDonnell/bin/Project.abs
Binary files differ
diff --git a/cmpen472hw7_McDonnell/cmpen472hw7_McDonnell.mcp b/cmpen472hw7_McDonnell/cmpen472hw7_McDonnell.mcp
index 0e1bc8c..774ea54 100644
--- a/cmpen472hw7_McDonnell/cmpen472hw7_McDonnell.mcp
+++ b/cmpen472hw7_McDonnell/cmpen472hw7_McDonnell.mcp
Binary files differ
diff --git a/cmpen472hw7_McDonnell/cmpen472hw7_McDonnell_Data/Standard/ObjectCode/main.asm.o b/cmpen472hw7_McDonnell/cmpen472hw7_McDonnell_Data/Standard/ObjectCode/main.asm.o
index f9f25c0..746d865 100644
--- a/cmpen472hw7_McDonnell/cmpen472hw7_McDonnell_Data/Standard/ObjectCode/main.asm.o
+++ b/cmpen472hw7_McDonnell/cmpen472hw7_McDonnell_Data/Standard/ObjectCode/main.asm.o
Binary files differ
diff --git a/cmpen472hw7_McDonnell/cmpen472hw7_McDonnell_Data/Standard/TargetDataWindows.tdt b/cmpen472hw7_McDonnell/cmpen472hw7_McDonnell_Data/Standard/TargetDataWindows.tdt
index 2b27396..98fcc7b 100644
--- a/cmpen472hw7_McDonnell/cmpen472hw7_McDonnell_Data/Standard/TargetDataWindows.tdt
+++ b/cmpen472hw7_McDonnell/cmpen472hw7_McDonnell_Data/Standard/TargetDataWindows.tdt
Binary files differ