Documente Academic
Documente Profesional
Documente Cultură
(ECE515)
EXPERIMENT 3
OBJECTIVES
PROCEDURE
PART A
If the left pushbutton is clicked, the left LED is switched on and the right LED is switched
off. The seven-segment LED will display “1”. If the right pushbutton is clicked, the right LED
is switched on and the left LED is switched off. The seven-segment LED will display “2”.
2. Based on the flowchart, write an ARM assembly language program using Notepad++.
Run and test your program using ARMSim#.
PART B
Design a program to blink LEDs in 1 second. First, the left LED is switched on and the right LED
is switched off. After 1 second, the left LED is switched off and the right LED is switched on and
the program continue to blink the LEDs.
2. Based on the flowchart and the main program below, write a 1 second delay subroutine.
3. Run and test your program using ARMSim#.
_start:
MOV R0,#04
MOV R1,#1
LDR R2,=MyString @display message in LCD
SWI 0x204
MOV R0,#4
MOV R1,#2
LDR R2,=MyString2 @display message in LCD
SWI 0X204
AGAIN: MOV R0,#0x02 @light up left LED
SWI 0X201
BL MyDelay @ call delay subroutine
MOV R0,#0x01 @light up right LED
SWI 0X201
BL MyDelay @ call delay subroutine
B AGAIN
MyDelay:
.data
MyString: .asciz "WELCOME TO THE CLASS"
MyString2: .asciz "LED BLINKING IN 1 SECOND"
.equ SWI_GetTicks, 0x6d
.end
Submit the followings: