; *********************************************************************** ; * * ; * Flash the LEDs on the DSLMU Microcontroller Board * ; * First Version * ; * * ; *********************************************************************** ; ; Author: John Zaitseff ; Date: 24th June, 2003 ; Version: 1.8 ; ; This program, when run on the DSLMU Microcontroller Board, flashes the ; LEDs on and off. Apart from some of the comments, it is essentially ; identical to flash-v1.s in Experiment 1. ; ----------------------------------------------------------------------- ; Constant values used in this program .equ portA, 0x10000000 ; Address of Port A in the I/O space .equ Value1, 0b11111111 ; Value to turn LEDs on .equ Value2, 0b00000000 ; Value to turn LEDs off ; ----------------------------------------------------------------------- ; Assembly-language preamble .text ; Executable code follows _start: .global _start ; "_start" is required by the linker .global main ; "main" is our main program b main ; ----------------------------------------------------------------------- ; Start of the main program main: ; Entry to the function "main" ; Although "main" is technically a function, this particular ; function has an infinite loop and so never returns to its caller. ldr r1, =portA ; Load address of Port A into R1 ; (ie, the value of the constant ; LED_port) into register R1 main_loop: ; Start of the infinite loop mov r0, #Value1 ; Load value to turn LEDs on strb r0, [r1] ; Write the byte to Port A mov r0, #Value2 ; Load value to turn LEDs off strb r0, [r1] ; Write the byte to Port A b main_loop ; Do this forever (or until stopped) ; ----------------------------------------------------------------------- .end