From 7b2d0640e6209539d80e79126d3b05ff8bf88176 Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Fri, 14 Feb 2025 18:20:46 -0500 Subject: HW4 Finished --- ExamPrepTwo/Sources/derivative.inc | 10 +++++++ ExamPrepTwo/Sources/main.asm | 56 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 ExamPrepTwo/Sources/derivative.inc create mode 100644 ExamPrepTwo/Sources/main.asm (limited to 'ExamPrepTwo/Sources') 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 -- cgit v1.2.3