-
Notifications
You must be signed in to change notification settings - Fork 2
/
assCode.s
67 lines (49 loc) · 773 Bytes
/
assCode.s
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
.global main
.text
main:
movq %rsp,%rbp
sub $216,%rsp
xor %rax, %rax
movq %rax,-8(%rbp)
xor %rax, %rax
movq %rax,-16(%rbp)
leaq .showstring, %rdi
leaq .s0, %rsi
xor %rax, %rax
call printf
movq $40,%rax
push %rax
leaq .show, %rdi
pop %rsi
xor %rax, %rax
call printf
movq $6,%rax
push %rax
movq $5,%rax
push %rax
pop %rbx
pop %rax
sub %rbx, %rax
push %rax
pop %rax
movq %rax,-8(%rbp)
movq $1,%rax
push %rax
pop %rax
movq %rax,-16(%rbp)
movq -16(%rbp), %rbx
movq -8(%rbp), %rax
cmp %rax,%rbx
jnz IF0
leaq .showstring, %rdi
leaq .s1, %rsi
xor %rax, %rax
call printf
IF0 :
add $216, %rsp
ret
.data
.show: .string " %d \n"
.showstring: .string " %s \n"
.s0: .string "HellothisismafirstProgram"
.s1: .string "equal"