-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.txt
39 lines (39 loc) · 796 Bytes
/
input.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
.pos 0
init: irmovl Stack, %esp
irmovl Stack, %ebp
call Main
halt
.align 4
array: .long 0xd
.long 0xc0
.long 0xb00
.long 0xa000
Main: pushl %ebp
rrmovl %esp, %ebp
irmovl $4, %eax
pushl %eax
irmovl array, %edx
pushl %edx
call Sum
rrmovl %ebp, %esp
popl %ebp
ret
Sum: pushl %ebp
rrmovl %esp, %ebp
mrmovl 8(%ebp), %ecx
mrmovl 12(%ebp), %edx
xorl %eax, %eax
andl %edx, %edx
je End
Loop: mrmovl (%ecx), %esi
addl %esi, %eax
irmovl $4, %ebx
addl %ebx, %ecx
irmovl $-1, %ebx
addl %ebx, %edx
jne Loop
End: rrmovl %ebp, %esp
popl %ebp
ret
.pos 0x100
Stack: