-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvdu.asm
57 lines (54 loc) · 2.06 KB
/
vdu.asm
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
#include "swi.asm"
; VDU function values
.set VDU_ClearTextViewport,12
.set VDU_DefineTextColour,17
.set VDU_DefineGraphicsColour,18
.set VDU_DefineLogicalColour,19
.set VDU_RestoreDefaultLogicalColours,20
.set VDU_SelectScreenMode,22
.set VDU_MultiPurpose,23
; VDU macro, can accept upto 10 parameters
.macro VDU v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
.nolist
.if \v1<>-1 ; if macro is passed 1 parameter
MOV R0,#\v1 ; move parameter 1 into R0
SWI OS_WriteC ; write it to the display
.endif
.if \v2<>-1 ; if macro is passed 2 parameters
MOV R0,#\v2 ; move parameter 2 into R0
SWI OS_WriteC ; write it to the display
.endif
.if \v3<>-1 ; if macro is passed 3 parameters
MOV R0,#\v3 ; move parameter 3 into R0
SWI OS_WriteC ; write it to the display
.endif
.if \v4<>-1 ; if macro is passed 4 parameters
MOV R0,#\v4 ; move parameter 4 into R0
SWI OS_WriteC ; write it to the display
.endif
.if \v5<>-1 ; if macro is passed 5 parameters
MOV R0,#\v5 ; move parameter 5 into R0
SWI OS_WriteC ; write it to the display
.endif
.if \v6<>-1 ; if macro is passed 6 parameters
MOV R0,#\v6 ; move parameter 6 into R0
SWI OS_WriteC ; write it to the display
.endif
.if \v7<>-1 ; if macro is passed 7 parameters
MOV R0,#\v7 ; move parameter 7 into R0
SWI OS_WriteC ; write it to the display
.endif
.if \v8<>-1 ; if macro is passed 8 parameters
MOV R0,#\v8 ; move parameter 8 into R0
SWI OS_WriteC ; write it to the display
.endif
.if \v9<>-1 ; if macro is passed 9 parameters
MOV R0,#\v9 ; move parameter 9 into R0
SWI OS_WriteC ; write it to the display
.endif
.if \v10<>-1 ; if macro is passed 9 parameters
MOV R0,#\v10 ; move parameter 9 into R0
SWI OS_WriteC ; write it to the display
.endif
.list
.endm