summaryrefslogtreecommitdiff
path: root/ExamPrepTwo/Sources/main.asm
diff options
context:
space:
mode:
Diffstat (limited to 'ExamPrepTwo/Sources/main.asm')
-rw-r--r--ExamPrepTwo/Sources/main.asm56
1 files changed, 56 insertions, 0 deletions
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