-
Notifications
You must be signed in to change notification settings - Fork 0
/
Print.s
53 lines (42 loc) · 1.75 KB
/
Print.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
; Print.s
; Student names: change this to your names or look very silly
; Last modification date: change this to the last modification date or look very silly
; Runs on LM4F120 or TM4C123
; EE319K lab 7 device driver for any LCD
;
; As part of Lab 7, students need to implement these LCD_OutDec and LCD_OutFix
; This driver assumes two low-level LCD functions
; ST7735_OutChar outputs a single 8-bit ASCII character
; ST7735_OutString outputs a null-terminated string
IMPORT ST7735_OutChar
IMPORT ST7735_OutString
EXPORT LCD_OutDec
EXPORT LCD_OutFix
AREA |.text|, CODE, READONLY, ALIGN=2
THUMB
;-----------------------LCD_OutDec-----------------------
; Output a 32-bit number in unsigned decimal format
; Input: R0 (call by value) 32-bit unsigned number
; Output: none
; Invariables: This function must not permanently modify registers R4 to R11
LCD_OutDec
BX LR
;* * * * * * * * End of LCD_OutDec * * * * * * * *
; -----------------------LCD _OutFix----------------------
; Output characters to LCD display in fixed-point format
; unsigned decimal, resolution 0.001, range 0.000 to 9.999
; Inputs: R0 is an unsigned 32-bit number
; Outputs: none
; E.g., R0=0, then output "0.000 "
; R0=3, then output "0.003 "
; R0=89, then output "0.089 "
; R0=123, then output "0.123 "
; R0=9999, then output "9.999 "
; R0>9999, then output "*.*** "
; Invariables: This function must not permanently modify registers R4 to R11
LCD_OutFix
BX LR
ALIGN
;* * * * * * * * End of LCD_OutFix * * * * * * * *
ALIGN ; make sure the end of this section is aligned
END ; end of file