-
Notifications
You must be signed in to change notification settings - Fork 0
/
snakee.asm
134 lines (99 loc) · 1.32 KB
/
snakee.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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
;download the jasmin from github or google : jasmin lrz tum
mov eax,0x0f0f
or eax,0xf0f0
mov word [0x2a],1
mov word [0x2c],1
mov word [0x2], 2
game_loop:
jasminsleep 500
mov eax,2
call get_movement
cmp word [0x1e],1
je ende
jmp game_loop
get_movement:
cmp word [0x1c],1
je left
cmp word [0x1c],2
je up
cmp word [0x1c],4
je down
cmp word [0x1c],8
je right
special_place:
ret
left:
cmp word [0x2c],0
je to_return
sub word [0x2c],1
mov dx,[0x2a]
mul dx
mov edx,0
mov dx,1
mov di,[0x2c]
loop_start:
cmp di,0
je to_return
shl dx,1
sub di,1
jmp loop_start
to_return:
add word [eax], dx
jmp special_place
up:
cmp word [0x2a],0
je to_return1
sub word [0x2a],1
mov dx,[0x2a]
mul dx
mov ecx,0
mov cx,[eax]
mov edx,0
mov dx,1
mov di,[0x2c]
loop_start1:
cmp di,0
je to_return1
shl dx,1
sub di,1
jmp loop_start1
to_return1:
add word [ecx], dx
jmp special_place
down:
cmp word [0x2a],15
je to_return2
add word [0x2a],1
mov dx,[0x2a]
mul dx
mov edx,0
mov dx,1
mov di,[0x2c]
loop_start2:
cmp di,0
je to_return2
shl dx,1
sub di,1
jmp loop_start2
to_return2:
add word [eax], dx
jmp special_place
right:
cmp word [0x2c],15
je to_return3
add word [0x2c],1
mov dx,[0x2a]
mul dx
mov edx,0
mov dx,1
mov di,[0x2c]
loop_start3:
cmp di,0
je to_return3
shl dx,1
sub di,1
jmp loop_start3
to_return3:
add word [eax], dx
jmp special_place
ende: