summaryrefslogtreecommitdiff
path: root/ExamPrepTwo/Sources
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2025-02-14 18:20:46 -0500
committerJacob McDonnell <jacob@jacobmcdonnell.com>2025-02-14 18:20:46 -0500
commit7b2d0640e6209539d80e79126d3b05ff8bf88176 (patch)
tree46cd3c6455e37e1654aaf96c753454ecca223fbd /ExamPrepTwo/Sources
parentdb27faf84654f0084542536e538044a0458bb554 (diff)
HW4 Finished
Diffstat (limited to 'ExamPrepTwo/Sources')
-rw-r--r--ExamPrepTwo/Sources/derivative.inc10
-rw-r--r--ExamPrepTwo/Sources/main.asm56
2 files changed, 66 insertions, 0 deletions
diff --git a/ExamPrepTwo/Sources/derivative.inc b/ExamPrepTwo/Sources/derivative.inc
new file mode 100644
index 0000000..988343b
--- /dev/null
+++ b/ExamPrepTwo/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/ExamPrepTwo/Sources/main.asm b/ExamPrepTwo/Sources/main.asm
new file mode 100644
index 0000000..fc86659
--- /dev/null
+++ b/ExamPrepTwo/Sources/main.asm
@@ -0,0 +1,56 @@
+**************************************************************************
+* 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
+
+**************************************************************************
+* Data Section: address used [ $3000 to $30FF ] RAM Memory
+*
+ org $3000 ; Reserved RAM memory starting address
+ ; for Data for CMPEN 472 class
+num dc.b 0
+
+*
+**************************************************************************
+* Program Section: address used [ $3100 to $3FFF ] RAM Memory
+*
+ org $3100 ; Program start address, in RAM
+pgstart ldaa #70
+ ldab #60
+ aba
+ nop
+
+ ldaa #60
+ ldab #-70
+ aba
+ nop
+
+ ldaa #-60
+ ldab #-70
+ sba
+ nop
+
+ ldaa #70
+ ldab #-60
+ sba
+ nop
+
+ ldab num
+
+dly ldaa num
+loop deca
+ bne loop
+
+*
+**************************************************************************
+
+done
+ end ; Last line of the file \ No newline at end of file