diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2025-01-20 15:43:15 -0500 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2025-01-20 15:43:15 -0500 |
| commit | 7d6115ca9b1276a3158ef9c7bd5f7288b55221c6 (patch) | |
| tree | f67a228733d4711bad6b79c4a6ac8ed0fedbd7a6 | |
Homework 1
22 files changed, 435 insertions, 0 deletions
diff --git a/HW1/ASM_layout.hwl b/HW1/ASM_layout.hwl new file mode 100644 index 0000000..3600632 --- /dev/null +++ b/HW1/ASM_layout.hwl @@ -0,0 +1,18 @@ +OPEN source 0 0 60 42
+Source < attributes MARKS off
+OPEN assembly 60 0 40 30
+Assembly < attributes ADR on,CODE off,ABSADR on,SYMB off,TOPPC 0xF800
+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,ADDRESS 0x80
+OPEN data 0 42 60 28
+Data < attributes SCOPE global,COMPLEMENT None,FORMAT Symb,MODE automatic,UPDATERATE 10,NAMEWIDTH 16
+OPEN command 0 70 60 30
+Command < attributes CACHESIZE 1000
+bckcolor 50331647
+font 'Courier New' 9 BLACK
+AUTOSIZE on
+ACTIVATE Assembly Memory Register Command Data Source Procedure
diff --git a/HW1/CMPEN472HW1McDonnell.mcp b/HW1/CMPEN472HW1McDonnell.mcp Binary files differnew file mode 100644 index 0000000..3426ce8 --- /dev/null +++ b/HW1/CMPEN472HW1McDonnell.mcp diff --git a/HW1/CMPEN472HW1McDonnell_Data/CWSettingsWindows.stg b/HW1/CMPEN472HW1McDonnell_Data/CWSettingsWindows.stg Binary files differnew file mode 100644 index 0000000..af68d57 --- /dev/null +++ b/HW1/CMPEN472HW1McDonnell_Data/CWSettingsWindows.stg diff --git a/HW1/CMPEN472HW1McDonnell_Data/Standard/ObjectCode/main.asm.o b/HW1/CMPEN472HW1McDonnell_Data/Standard/ObjectCode/main.asm.o Binary files differnew file mode 100644 index 0000000..f706514 --- /dev/null +++ b/HW1/CMPEN472HW1McDonnell_Data/Standard/ObjectCode/main.asm.o diff --git a/HW1/CMPEN472HW1McDonnell_Data/Standard/ObjectCode/main.asm.sx b/HW1/CMPEN472HW1McDonnell_Data/Standard/ObjectCode/main.asm.sx new file mode 100644 index 0000000..1771e8c --- /dev/null +++ b/HW1/CMPEN472HW1McDonnell_Data/Standard/ObjectCode/main.asm.sx @@ -0,0 +1,11 @@ +S0750000433A5C55736572735C4A61636F62204D63446F6E6E656C6C5C446F63756D656E74735C434D50454E3437324857314D63446F6E6E656C6C5C434D50454E3437324857314D63446F6E6E656C6C5F446174615C5374616E646172645C4F626A656374436F64655C6D61696E2E61736D2E70726DC9
+S12330000000000000000000000000000000000000000000000000000000000000000000AC
+S123302000000000000000000000000000000000000000000000000000000000000000008C
+S123304000000000000000000000000000000000000000000000000000000000000000006C
+S123306000000000000000000000000000000000000000000000000000000000000000004C
+S123308000000000000000000000000000000000000000000000000000000000000000002C
+S12330A000000000000000000000000000000000000000000000000000000000000000000C
+S12330C00000000000000000000000000000000000000000000000000000000000000000EC
+S10530E000E109
+S1133100862AF630E1CE30006A00085326FA20FE03
+S9033100CB
diff --git a/HW1/CMPEN472HW1McDonnell_Data/Standard/TargetDataWindows.tdt b/HW1/CMPEN472HW1McDonnell_Data/Standard/TargetDataWindows.tdt Binary files differnew file mode 100644 index 0000000..a3ebd6d --- /dev/null +++ b/HW1/CMPEN472HW1McDonnell_Data/Standard/TargetDataWindows.tdt diff --git a/HW1/Default.mem b/HW1/Default.mem Binary files differnew file mode 100644 index 0000000..bf49148 --- /dev/null +++ b/HW1/Default.mem diff --git a/HW1/Full_Chip_Simulation.ini b/HW1/Full_Chip_Simulation.ini new file mode 100644 index 0000000..b41d59e --- /dev/null +++ b/HW1/Full_Chip_Simulation.ini @@ -0,0 +1,27 @@ +[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,211,107,2131,1130
+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
diff --git a/HW1/Sources/cmpen472hw1_McDonnell.asm b/HW1/Sources/cmpen472hw1_McDonnell.asm new file mode 100644 index 0000000..31da964 --- /dev/null +++ b/HW1/Sources/cmpen472hw1_McDonnell.asm @@ -0,0 +1,63 @@ +**********************************************************************************************
+*
+* Title: Star Fill (In Memory) Homework #1
+*
+* Objective: CMPEN472 Homework #1 demonstration program. Fill 225 bytes of memory with '*'.
+*
+* Revision: V1.0
+*
+* Date: Jan. 22, 2025
+*
+* Programmer: Jacob McDonnell
+*
+* Company: The Pennsylvania State Universtiy
+* Electrical Engineering and Computer Science
+*
+* Algorithm: While Loop demo of HCS12 Assembly
+*
+* Register Use: A accumulator: character to be placed in memory
+* B accumulator: counter of filled memory locations
+* X register: pointer to memory location to fill
+*
+* Memory use: RAM locations $3000 to $30E1
+*
+* Input: No input, data and parameters are hard coded.
+*
+* Output: Memory locations $3000 to $30E1 are filled with '*' character.
+*
+* Observation: This program is designed for instruction purpose.
+* This program can be a template for other loop based code.
+*
+* Comments: This program is developed and simulated using CodeWarrior Development Software.
+*
+**********************************************************************************************
+* Parameter Declaration Section
+*
+* Export Symbols
+ xdef pgstart ; export 'pgstart' symbol
+ absentry pgstart ; for assembly entry point
+* Symbols and Macros
+porta equ $0000 ; i/o port address
+portb equ $0001
+ddra equ $0002
+ddrb equ $0003
+**********************************************************************************************
+* Data Section
+*
+ org $3000 ; reserved memory starting address
+here ds.b $e1 ; 225 memory locations reserved
+count dc.b $e1 ; constant counter for stars = 225
+*
+**********************************************************************************************
+* Program Section
+*
+ org $3100 ; Program Start Address in RAM
+pgstart ldaa #'*' ; Load '*' into accumulator A
+ ldab count ; Load count of stars into B
+ ldx #here ; Load address pointer into X
+loop staa 0,x ; Put a start at this memory location
+ inx ; Go to the next memory location
+ decb ; Decrement the counter
+ bne loop ; Loop if not done
+done bra done ; Task finished
+ end ; Last line of a file
\ No newline at end of file diff --git a/HW1/Sources/derivative.inc b/HW1/Sources/derivative.inc new file mode 100644 index 0000000..9320da5 --- /dev/null +++ b/HW1/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/HW1/Sources/main.asm b/HW1/Sources/main.asm new file mode 100644 index 0000000..31da964 --- /dev/null +++ b/HW1/Sources/main.asm @@ -0,0 +1,63 @@ +**********************************************************************************************
+*
+* Title: Star Fill (In Memory) Homework #1
+*
+* Objective: CMPEN472 Homework #1 demonstration program. Fill 225 bytes of memory with '*'.
+*
+* Revision: V1.0
+*
+* Date: Jan. 22, 2025
+*
+* Programmer: Jacob McDonnell
+*
+* Company: The Pennsylvania State Universtiy
+* Electrical Engineering and Computer Science
+*
+* Algorithm: While Loop demo of HCS12 Assembly
+*
+* Register Use: A accumulator: character to be placed in memory
+* B accumulator: counter of filled memory locations
+* X register: pointer to memory location to fill
+*
+* Memory use: RAM locations $3000 to $30E1
+*
+* Input: No input, data and parameters are hard coded.
+*
+* Output: Memory locations $3000 to $30E1 are filled with '*' character.
+*
+* Observation: This program is designed for instruction purpose.
+* This program can be a template for other loop based code.
+*
+* Comments: This program is developed and simulated using CodeWarrior Development Software.
+*
+**********************************************************************************************
+* Parameter Declaration Section
+*
+* Export Symbols
+ xdef pgstart ; export 'pgstart' symbol
+ absentry pgstart ; for assembly entry point
+* Symbols and Macros
+porta equ $0000 ; i/o port address
+portb equ $0001
+ddra equ $0002
+ddrb equ $0003
+**********************************************************************************************
+* Data Section
+*
+ org $3000 ; reserved memory starting address
+here ds.b $e1 ; 225 memory locations reserved
+count dc.b $e1 ; constant counter for stars = 225
+*
+**********************************************************************************************
+* Program Section
+*
+ org $3100 ; Program Start Address in RAM
+pgstart ldaa #'*' ; Load '*' into accumulator A
+ ldab count ; Load count of stars into B
+ ldx #here ; Load address pointer into X
+loop staa 0,x ; Put a start at this memory location
+ inx ; Go to the next memory location
+ decb ; Decrement the counter
+ bne loop ; Loop if not done
+done bra done ; Task finished
+ end ; Last line of a file
\ No newline at end of file diff --git a/HW1/bin/Project.abs b/HW1/bin/Project.abs Binary files differnew file mode 100644 index 0000000..f706514 --- /dev/null +++ b/HW1/bin/Project.abs diff --git a/HW1/bin/Project.abs.phy b/HW1/bin/Project.abs.phy new file mode 100644 index 0000000..f804bef --- /dev/null +++ b/HW1/bin/Project.abs.phy @@ -0,0 +1,2 @@ +S04A0000433A5C55736572735C4A61636F62204D63446F6E6E656C6C5C446F63756D656E74735C434D50454E3437324857314D63446F6E6E656C6C5C62696E5C50726F6A6563742E61627301
+S9030000FC
diff --git a/HW1/bin/Project.abs.s19 b/HW1/bin/Project.abs.s19 new file mode 100644 index 0000000..329468c --- /dev/null +++ b/HW1/bin/Project.abs.s19 @@ -0,0 +1,11 @@ +S04A0000433A5C55736572735C4A61636F62204D63446F6E6E656C6C5C446F63756D656E74735C434D50454E3437324857314D63446F6E6E656C6C5C62696E5C50726F6A6563742E61627301
+S12330000000000000000000000000000000000000000000000000000000000000000000AC
+S123302000000000000000000000000000000000000000000000000000000000000000008C
+S123304000000000000000000000000000000000000000000000000000000000000000006C
+S123306000000000000000000000000000000000000000000000000000000000000000004C
+S123308000000000000000000000000000000000000000000000000000000000000000002C
+S12330A000000000000000000000000000000000000000000000000000000000000000000C
+S12330C00000000000000000000000000000000000000000000000000000000000000000EC
+S10530E000E109
+S1133100862AF630E1CE30006A00085326FA20FE03
+S9030000FC
diff --git a/HW1/bin/main.dbg b/HW1/bin/main.dbg new file mode 100644 index 0000000..5e71d01 --- /dev/null +++ b/HW1/bin/main.dbg @@ -0,0 +1,62 @@ +**********************************************************************************************
+*
+* Title: Star Fill (In Memory) Homework #1
+*
+* Objective: CMPEN472 Homework #1 demonstration program. Fill 225 bytes of memory with '*'.
+*
+* Revision: V1.0
+*
+* Date: Jan. 22, 2025
+*
+* Programmer: Jacob McDonnell
+*
+* Company: The Pennsylvania State Universtiy
+* Electrical Engineering and Computer Science
+*
+* Algorithm: While Loop demo of HCS12 Assembly
+*
+* Register Use: A accumulator: character to be placed in memory
+* B accumulator: counter of filled memory locations
+* X register: pointer to memory location to fill
+*
+* Memory use: RAM locations $3000 to $30E1
+*
+* Input: No input, data and parameters are hard coded.
+*
+* Output: Memory locations $3000 to $30E1 are filled with '*' character.
+*
+* Observation: This program is designed for instruction purpose.
+* This program can be a template for other loop based code.
+*
+* Comments: This program is developed and simulated using CodeWarrior Development Software.
+*
+**********************************************************************************************
+* Parameter Declaration Section
+*
+* Export Symbols
+ xdef pgstart ; export 'pgstart' symbol
+ absentry pgstart ; for assembly entry point
+* Symbols and Macros
+porta equ $0000 ; i/o port address
+portb equ $0001
+ddra equ $0002
+ddrb equ $0003
+**********************************************************************************************
+* Data Section
+*
+ org $3000 ; reserved memory starting address
+here ds.b $e1 ; 225 memory locations reserved
+count dc.b $e1 ; constant counter for stars = 225
+*
+**********************************************************************************************
+* Program Section
+*
+ org $3100 ; Program Start Address in RAM
+pgstart ldaa #'*' ; Load '*' into accumulator A
+ ldab count ; Load count of stars into B
+ ldx #here ; Load address pointer into X
+loop staa 0,x ; Put a start at this memory location
+ inx ; Go to the next memory location
+ decb ; Decrement the counter
+ bne loop ; Loop if not done
+done bra done ; Task finished
diff --git a/HW1/cmd/Full_Chip_Simulation_Postload.cmd b/HW1/cmd/Full_Chip_Simulation_Postload.cmd new file mode 100644 index 0000000..eb00f37 --- /dev/null +++ b/HW1/cmd/Full_Chip_Simulation_Postload.cmd @@ -0,0 +1 @@ +// After load the commands written below will be executed
diff --git a/HW1/cmd/Full_Chip_Simulation_Preload.cmd b/HW1/cmd/Full_Chip_Simulation_Preload.cmd new file mode 100644 index 0000000..691c5ee --- /dev/null +++ b/HW1/cmd/Full_Chip_Simulation_Preload.cmd @@ -0,0 +1 @@ +// Before load the commands written below will be executed
diff --git a/HW1/cmd/Full_Chip_Simulation_Reset.cmd b/HW1/cmd/Full_Chip_Simulation_Reset.cmd new file mode 100644 index 0000000..f0fc874 --- /dev/null +++ b/HW1/cmd/Full_Chip_Simulation_Reset.cmd @@ -0,0 +1 @@ +// After reset the commands written below will be executed
diff --git a/HW1/cmd/Full_Chip_Simulation_SetCPU.cmd b/HW1/cmd/Full_Chip_Simulation_SetCPU.cmd new file mode 100644 index 0000000..5f2b5a5 --- /dev/null +++ b/HW1/cmd/Full_Chip_Simulation_SetCPU.cmd @@ -0,0 +1 @@ +// At startup the commands written below will be executed
diff --git a/HW1/cmd/Full_Chip_Simulation_Startup.cmd b/HW1/cmd/Full_Chip_Simulation_Startup.cmd new file mode 100644 index 0000000..5f2b5a5 --- /dev/null +++ b/HW1/cmd/Full_Chip_Simulation_Startup.cmd @@ -0,0 +1 @@ +// At startup the commands written below will be executed
diff --git a/HW1/prm/burner.bbl b/HW1/prm/burner.bbl new file mode 100644 index 0000000..42c21ed --- /dev/null +++ b/HW1/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/README.md b/README.md new file mode 100644 index 0000000..0599e57 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# CMPEN 472 Homework + +## Due Dates + +- HW 1: 01/22/2025 + |
