FOR ARM INSTRUCTORS HELP! Please provide a full (source code aka programming cod
ID: 3689781 • Letter: F
Question
FOR ARM INSTRUCTORS HELP!
Please provide a full (source code aka programming code ) for ARMSIM program that uses arm instruction to make a simple program that have
2 BUTTONS (we will call them left and right buttons )
1 LCD DISPLAY
1 8-SEGMENT DISPLAY
==> when pressing the left button , the LCD displays 'hello' and the 8 segment display 'A'
==> when pressing right button, the LCD displays 'exit' and 8 segment display 'E'
*please see the picture to see the embest board that we use as a plugin in ARMSIM
ARMSim The ARM Simulator Dept. of Co File View Cache Debug Watch Help r Science PluginUIView EmbestBoardPlugin 0.0 0.1 0.2 0.3 1.1 1.2 1.3 2.0 2.1 2.2 2.3 3.0 3.1 3.2 3.3Explanation / Answer
Code
swi 0x202 @this swi call sets the content of ro as,r0= 2 if @left button was pressed or r0=1 if right button @ was pressed
cmp r0,#0x02 @ check whether left button was pressed.
beq LEFTBUTT
cmp r0,#0x01 @ check whether rightt button was pressed.
beq RIGHTBUT
LEFTBUTT:
swi SWI_CLEAR_DISPLAY @ clear the present LCD screen
mov r0,#0 @ 8-segment cleared to blank
mov r0,#4 @ column number
mov r1,#1 @ row number
ldr r2,=Hello @ pointer to the string Hello
swi SWI_DRAW_STRING @ draw the string to LCD screen
ldr r0,= SEG_A|SEG_B|SEG_C|SEG_G|SEG_E|SEG_F
swi SWI_SETSEG8 @display A on 8-segment
RIGHTBUT:
swi SWI_CLEAR_DISPLAY @ clear the present LCD screen
mov r0,#0 @ 8-segment cleared to blank
mov r0,#4 @ column number
mov r1,#1 @ row number
ldr r2,=Exit @ pointer to string Hello
swi SWI_DRAW_STRING @ draw to the LCD screen
ldr r0,= SEG_A|SEG_D |SEG_G|SEG_E|SEG_F
swi SWI_SETSEG8 @ display E on 8-segment
.data
Hello: .asciz "Hello" @ data initializations.
Exit: .asciz "Exit"
.end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.