-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCInd.asm
54 lines (51 loc) · 1.22 KB
/
CInd.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
;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
proc indUpdate
dopush ax,bx,dx
mov ax,[row]
mov bx,28 ;row length. (14*2 because array is word)
mul bx ;multiplying row number by row length (row count starts at 0)
add ax,[cell] ;adding cell value
mov di,ax
add di, offset worldArr
dopop dx,bx,ax
ret
endp indUpdate
;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
proc rowDec
dec [row]
call indUpdate
ret
endp rowDec
;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
proc rowNext
add [row],1
mov [cell],0
call indUpdate
ret
endp rowNext
;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
proc rowSkip
add [row], 1
call indUpdate
ret
endp rowSkip
;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
proc indReset
mov [cell],0
mov [row],0
call indUpdate
ret
endp indReset
;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
proc incCell
add [cell],2
call indUpdate
ret
endp incCell
;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
proc decCell
sub [cell],2
call indUpdate
ret
endp decCell
;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''