-
Notifications
You must be signed in to change notification settings - Fork 0
/
entreeSortie.asm
86 lines (85 loc) · 1.01 KB
/
entreeSortie.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
extrn lirent:proc, ecrent:proc
extrn ecrbool:proc
extrn ecrch:proc, ligsuiv:proc
.model SMALL
.586
.CODE
debut :
STARTUPCODE
mov bp,sp
sub sp,6
.DATA
mess0 DB "x=$"
.CODE
lea dx,mess0
push dx
call ecrch
lea dx, [bp-2]
push dx
call lirent
call ligsuiv
.DATA
mess1 DB "y=$"
.CODE
lea dx,mess1
push dx
call ecrch
lea dx, [bp-4]
push dx
call lirent
call ligsuiv
.DATA
mess2 DB "x+y=$"
.CODE
lea dx,mess2
push dx
call ecrch
push word ptr [bp-2]
push word ptr [bp-4]
pop bx
pop ax
add ax,bx
push ax
call ecrent
call ligsuiv
push word ptr [bp-2]
push word ptr [bp-4]
push word ptr 2
pop bx
pop ax
cwd
idiv bx
push ax
pop bx
pop ax
add ax,bx
push ax
push word ptr 5
pop bx
pop ax
cwd
idiv bx
push ax
pop ax
mov word ptr [bp-6], ax
push word ptr [bp-4]
push word ptr 3
push word ptr [bp-4]
pop bx
pop ax
imul bx
push ax
pop bx
pop ax
add ax,bx
push ax
push word ptr 4
pop bx
pop ax
sub ax,bx
push ax
pop ax
mov word ptr [bp-2], ax
nop
EXITCODE
end debut