-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateScreen.s
68 lines (58 loc) · 1.43 KB
/
updateScreen.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
AREA routines, CODE, READONLY
THUMB
;updateScreen.s
;Updates values shown on LCD (frequency and magnitude) with the given string address.
;Inputs: R10 (string address)
; R9 (LCD-related register)
; R7 (max freq magnitude)
; R8 (max freq response index, between 1-511)
IMPORT convertASCII
IMPORT LCDSendData
IMPORT LCDSendString
EXPORT updateScreen
updateScreen PROC
PUSH {R0-R2, LR}
;Clear relevant regions of the screen
;MAGNITUDE
MOV R9,#0x99 ;Starting point of X
BL LCDSendData
MOV R9,#0x40 ;Y=0
BL LCDSendData
MOV R9,#0x100 ;Clear screen
MOV R0,#58
clearY0 BL LCDSendData
SUBS R0,#1
BNE clearY0
MOV R9,#0xBF ;Starting point of X
BL LCDSendData
MOV R9,#0x41 ;Y=1
BL LCDSendData
MOV R9,#0x100 ;Clear screen
MOV R0,#15
clearY1 BL LCDSendData
SUBS R0,#1
BNE clearY1
;Write to relevant regions of the screen
;MAGNITUDE
MOV R9,#0x99 ;Starting point of X
BL LCDSendData
MOV R9,#0x40 ;Y=0
BL LCDSendData
MOV R0,R7
BL convertASCII
MOV R0,R10
BL LCDSendString
;FREQUENCY
MOV R9,#0xBF ;Starting point of X
BL LCDSendData
MOV R9,#0x41 ;Y=1
BL LCDSendData
MOV R0,R8
BL convertASCII
MOV R0,R10
BL LCDSendString
POP {R0-R2, LR}
BX LR
ENDP
ALIGN
END