forked from istrangeloop/TIS-100-solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterrupt-handler
16 lines (16 loc) · 1.13 KB
/
interrupt-handler
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
MOV ACC, DOWN | MOV ACC, DOWN | MOV ACC, DOWN | MOV ACC, DOWN |
MOV UP, ACC | MOV UP, ACC | MOV UP, ACC | MOV UP, ACC |
MOV ACC, DOWN | MOV ACC, DOWN | MOV ACC, DOWN | MOV ACC, DOWN |
________________|_________________|_________________|_________________|
MOV UP, ACC | MOV UP, ACC | MOV UP, ACC | MOV UP, ACC |
SUB UP | SUB UP | SUB UP | SUB UP |
JLZ Y | JLZ Y | JLZ Y | JLZ Y |
MOV 0, RIGHT | MOV LEFT, RIGHT | MOV LEFT, RIGHT | MOV LEFT, DOWN |
JMP END | JMP END | JMP END | JMP END |
Y: MOV 1, RIGHT | Y: MOV 2, RIGHT | Y: MOV 3, RIGHT | Y: MOV 4, DOWN |
END: MOV 0, ACC | MOV LEFT, NIL | MOV LEFT, NIL | MOV LEFT, NIL |
| END:MOV 0, ACC | END:MOV 0, ACC | END:MOV 0, ACC |
_______________ |_________________|_________________|_________________|
COMMUNICATION | | MOV RIGHT, DOWN | MOV UP, LEFT |
FAILURE | | | |
________________|_________________|_________________|_________________|