-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMouse_Demo.txt
61 lines (48 loc) · 869 Bytes
/
Mouse_Demo.txt
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
init
idle
Timer_Instruct //Timer interrupt starts here
func Choose_DISP //Chooses what to display on the 7 segment display
Mouse_Instruct //Mouse interrupt starts here
lw A A0 //Load mouse status
sw A 01
lw B A1 //Load mouse X
sw B 02
lw A A2 //Load mouse Y
sw A 03
idle //Goto Idle
Choose_DISP
lw A E0 //Loads the value from the slide switches
lw B 04 //Loads constant 2
breq A B DISP_X //Checks if slide switch is = 2
bltq A B DISP_Status //Checks if slide switch < 2
bgtq A B DISP_Y // Checks if slide switch >2
goto Mouse_Instruct
DISP_Status
lw A 01
sw A D0
lw B 02
sw B C0
lw B 03
sw B C1
ret
DISP_X
lw A 02
sw A D0
lw B 01
sw B C0
lw B 03
sw B C1
ret
DISP_Y
lw A 03
sw A D0
lw B 01
sw B C0
lw B 02
sw B C1
ret
// Ram allocation:
// 0x00 - Current value to display on seven segment display
// 0x01 - Mouse Status
// 0x02 - MouseX
// 0x03 - MouseY