-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyemba.asm
88 lines (74 loc) · 951 Bytes
/
yemba.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
extern printf, scanf
section .data
; declaration des variables en memoire
a: dd 0
b: dd 0
c: dd 0
d: dd 0
fmt:db "%d", 10, 0
fmtlec:db "%d", 0
section .text
global_start
_start:
push 5
;affectation
pop eax
mov [a], eax
push 10
;affectation
pop eax
mov [b], eax
push 0
;affectation
pop eax
mov [c], eax
push 15
;affectation
pop eax
mov [d], eax
;afficher
mov eax, [a]
push eax
push dword fmt
call printf
;afficher
mov eax, [b]
push eax
push dword fmt
call printf
;afficher
mov eax, [c]
push eax
push dword fmt
call printf
;afficher
mov eax, [d]
push eax
push dword fmt
call printf
;recuperation en memoire
mov eax, [a]
push eax
push 5
;Teste d'égalité
pop ebx
pop eax
cmp eax, ebx
jne test1
push 1
jmp fintest1
test1:
push 0
fintest1:
;Reduction du alors1
pop eax
cmp eax,1
jne sinon1
;afficher
mov eax, [b]
push eax
push dword fmt
call printf
mov eax,1 ; sys_exit
mov ebx,0; Exit with return code of 0 (no error)
int 80h