-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmouse_instructions.txt~
97 lines (76 loc) · 1.42 KB
/
mouse_instructions.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//This is gonna be the code for accessing the values in each of the mouse data busses
//firstly need to specify that the interrupt for mouse will start from address 00
//Do this inside the Verilog code for now
//RAM contents will look like this
/*
Mem[0] = 8'h00;
Mem[1] = 8'h01;
Mem[2] = 8'h02;
Mem[3] = 8'h03;
*/
//ROM also needs to have this
/*
ROM[8'hFF] = 8'h00;
*/
//To simulate the mouse without using memreadh
/*
//info about the interrupt location
ROM[8'hFF] = 8'h00;
//load a 01
ROM[0] = 8'b00000000;
ROM[0] = 8'b00000001;
store F2 a
ROM[0] = 8'b00000010;
ROM[0] = 8'b11110010;
//load a A0
ROM[0] = 8'b00000000;
ROM[0] = 8'b10100000;
//load a A1
ROM[0] = 8'b00000000;
ROM[0] = 8'b10100001;
//load a A2
ROM[0] = 8'b00000000;
ROM[0] = 8'b10100010;
*/
//Disable insterrupts completely
// 1 - load value of 01 from RAM
// 2 - store this value to address F2
//timer_isr:
//when timer comes, loads these values back to regs
//and store into 7seg & LEDs Base Addresses
//load a 01
//store D0 a
//load a 02
//store C0 a
/*
load b E0
store C0 b
store D0 b
goto_idle
mouse_isr:
//Load values from Mouse data addresses to regs
//and store them into RAM
load a A0
store 00 a
load a A1
store 01 a
load a A2
store 02 a
goto_idle
*/
//address == 00
goto FF
timer_isr:
load a E0
store C4 a
load_val a FF //light up PWM full on
store C3 a
goto_idle
mouse_isr:
load b A1
store C0 b
store C1 b
load b A2
store C2 b
store D0 b
goto_idle