-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeleteObject.asm
executable file
·60 lines (51 loc) · 961 Bytes
/
deleteObject.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
; push array
deleteObject:
push bp
mov bp,sp
push bx
mov bx,[bp+4]
mov cx,[bx]
add bx,2
deleteObject_loop:
push cx
push bx
mov bx,[bx]
cmp word [bx+8],0
jne deleteObject_next1
mov dx,bx
mov bx,[bp+4]
mov ax,[bx]
dec word [bx]
shl ax,1
add bx,ax
;-----------
mov cx,[OBJ_SIGNATURE_SIZE]
shr cx,1
mov bx,[bx]
deleteObject_loop1:
push word [bx]
add bx,2
loop deleteObject_loop1
;------------------
mov bx,dx
add bx,[OBJ_SIGNATURE_SIZE]
mov cx,[OBJ_SIGNATURE_SIZE]
shr cx,1
deleteObject_loop2:
sub bx,2
pop word [bx]
loop deleteObject_loop2
;---------------
pop bx
pop cx
jmp deleteObject_end
deleteObject_next1:
pop bx
pop cx
add bx,2
loop deleteObject_loop
deleteObject_end:
pop bx
mov sp,bp
pop bp
retn 2