Download The ARMSim# User Guide

Transcript
ARMSim# User Guide
mov
r0,#0
swi
SWI_SETSEG8
@draw a message to the lcd screen on line#1, column 4
mov
r0,#4
@ column number
mov
r1,#1
@ row number
ldr
r2,=Welcome
@ pointer to string
swi
SWI_DRAW_STRING
@ draw to the LCD screen
@display the letter H in 7segment display
ldr
r0,=SEG_B|SEG_C|SEG_G|SEG_E|SEG_F
swi
SWI_SETSEG8
@turn on LEFT led and turn off RIGHT led
mov
r0,#LEFT_LED
swi
SWI_SETLED
@draw a message to the lcd screen on line#2, column 4
mov
r0,#4
@ column number
mov
r1,#2
@ row number
ldr
r2,=LeftLED @ pointer to string
swi
SWI_DRAW_STRING @ draw to the LCD screen
@Wait for 3 second
ldr
r3,=3000
BL
Wait
@turn on RIGHT led and turn off LEFT led
mov
r0,#RIGHT_LED
swi
SWI_SETLED
@draw a message to the lcd screen on line#2, column 4
mov
r0,#4
@ column number
mov
r1,#2
@ row number
ldr
r2,=RightLED
@ pointer to string
swi
SWI_DRAW_STRING @ draw to the LCD screen
@Wait for 3 second
ldr
r3,=3000
BL
Wait
@turn on both led
mov
r0,#(LEFT_LED|RIGHT_LED)
swi
SWI_SETLED
@clear previous line 2
mov
r0,#2
swi
SWI_CLEAR_LINE
@draw a message to inform user to press a black button
mov
r0,#6
@ column number
mov
r1,#2
@ row number
ldr
r2,=PressBlackL @ pointer to string
swi
SWI_DRAW_STRING @ draw to the LCD screen
@wait for user to press a black button
mov
r0,#0
LB1:
swi
SWI_CheckBlack
@get button press into R0
cmp
r0,#0
beq
LB1
@ if zero, no button pressed
cmp
r0,#RIGHT_BLACK_BUTTON
41