* * HW4 * * Purpose: sum up all the values from 1 to n * * Author: Heather D. Pfeiffer * RAM equ $0010 EEPROM equ $f800 RESET equ $fffe * Save space in RAM for the sum org RAM sum rmb 1 * Program code where constant n is stored * at top of program org EEPROM n fcb $0f start ldaa #0 * initialize sum ldab n * initialize count down again beq next * while (countdown != 0) aba * sum = sum + countdown decb bra again * end while next staa sum * store sum endloop bra endloop * dead loop * Setup reset vector org RESET fdb start