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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
|
.486
.model flat
extrn __fltused:near
extrn __ftol:near
_DATA segment
public _x
align 4
_x label byte
dd 1
dd 2
dd 3
dd 4
public _main
_DATA ends
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
lea edi,(L2)
push edi
call _print
add esp,4
lea edi,(L4)
push edi
lea edi,(L3)
push edi
call _print
add esp,8
push 10
push 3
lea edi,(L5)
push edi
call _print
add esp,12
push 10
push 4
lea edi,(L8)
push edi
lea edi,(L7)
push edi
lea edi,(L6)
push edi
call _print
add esp,20
push 10
fld qword ptr (L10)
sub esp,8
fstp qword ptr [esp]
lea edi,(L8)
push edi
lea edi,(L7)
push edi
lea edi,(L9)
push edi
call _print
add esp,24
lea edi,(_x)
mov dword ptr (-8)[ebp],edi
mov esi,edi
mov dword ptr (-4)[ebp],esi
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
mov edi,dword ptr (-8)[ebp]
mov esi,edi
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
mov edi,dword ptr (-8)[ebp]
mov esi,edi
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
mov edi,dword ptr (-8)[ebp]
mov esi,edi
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
mov edi,dword ptr (-8)[ebp]
mov esi,edi
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
mov edi,dword ptr (-8)[ebp]
mov esi,edi
sub esp,16
mov edi,esp
mov ecx,16
rep movsb
lea edi,(L11)
push edi
call _print
add esp,100
mov eax,0
L1:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _print
_print:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,28
lea edi,(24)[ebp]
mov dword ptr (-4)[ebp],edi
jmp L17
L14:
mov edi,dword ptr (20)[ebp]
movsx edi,byte ptr [edi]
cmp edi,37
jne L18
mov edi,dword ptr (20)[ebp]
lea edi,(1)[edi]
mov dword ptr (20)[ebp],edi
movsx edi,byte ptr [edi]
mov dword ptr (-8)[ebp],edi
mov edi,dword ptr (-8)[ebp]
cmp edi,115
je L34
cmp edi,115
jg L39
L38:
mov edi,dword ptr (-8)[ebp]
cmp edi,98
jl L20
cmp edi,102
jg L20
jmp dword ptr (L40-392)[edi*4]
_TEXT ends
_TEXT segment
align 4
L40 label byte
dd L23
dd L28
dd L30
dd L20
dd L36
_TEXT ends
_TEXT segment
L39:
cmp dword ptr (-8)[ebp],119
je L32
jmp L20
L23:
mov edi,dword ptr (-4)[ebp]
lea edi,(16)[edi]
mov dword ptr (-28)[ebp],edi
mov dword ptr (-4)[ebp],edi
lea edi,(-24)[ebp]
mov esi,dword ptr (-28)[ebp]
lea esi,(-16)[esi]
mov ecx,16
rep movsb
mov edi,dword ptr (-12)[ebp]
push edi
mov edi,dword ptr (-16)[ebp]
push edi
mov edi,dword ptr (-20)[ebp]
push edi
mov edi,dword ptr (-24)[ebp]
push edi
lea edi,(L24)
push edi
call _printf
add esp,20
jmp L19
L28:
mov edi,dword ptr (-4)[ebp]
lea edi,(4)[edi]
mov dword ptr (-4)[ebp],edi
movsx edi,byte ptr (-4)[edi]
push edi
lea edi,(L29)
push edi
call _printf
add esp,8
jmp L19
L30:
mov edi,dword ptr (-4)[ebp]
lea edi,(4)[edi]
mov dword ptr (-4)[ebp],edi
mov edi,dword ptr (-4)[edi]
push edi
lea edi,(L31)
push edi
call _printf
add esp,8
jmp L19
L32:
mov edi,dword ptr (-4)[ebp]
lea edi,(4)[edi]
mov dword ptr (-4)[ebp],edi
movsx edi,word ptr (-4)[edi]
push edi
lea edi,(L33)
push edi
call _printf
add esp,8
jmp L19
L34:
mov edi,dword ptr (-4)[ebp]
lea edi,(4)[edi]
mov dword ptr (-4)[ebp],edi
mov edi,dword ptr (-4)[edi]
push edi
lea edi,(L35)
push edi
call _printf
add esp,8
jmp L19
L36:
mov edi,dword ptr (-4)[ebp]
lea edi,(8)[edi]
mov dword ptr (-4)[ebp],edi
fld qword ptr (-8)[edi]
sub esp,8
fstp qword ptr [esp]
lea edi,(L37)
push edi
call _printf
add esp,12
jmp L19
L20:
mov edi,dword ptr (20)[ebp]
movsx edi,byte ptr [edi]
push edi
lea edi,(L29)
push edi
call _printf
add esp,8
jmp L19
L18:
mov edi,dword ptr (20)[ebp]
movsx edi,byte ptr [edi]
push edi
lea edi,(L29)
push edi
call _printf
add esp,8
L19:
L15:
inc dword ptr (20)[ebp]
L17:
mov edi,dword ptr (20)[ebp]
movsx edi,byte ptr [edi]
cmp edi,0
jne L14
mov dword ptr (-4)[ebp],0
mov eax,0
L12:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _printf:near
_TEXT segment
_TEXT ends
_TEXT segment
align 1
L37 label byte
db 37
db 102
db 0
align 1
L35 label byte
db 37
db 115
db 0
align 1
L33 label byte
db 37
db 120
db 0
align 1
L31 label byte
db 37
db 100
db 0
align 1
L29 label byte
db 37
db 99
db 0
align 1
L24 label byte
db 123
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 100
db 125
db 0
align 1
L11 label byte
db 37
db 98
db 32
db 37
db 98
db 32
db 37
db 98
db 32
db 37
db 98
db 32
db 37
db 98
db 32
db 37
db 98
db 10
db 0
align 4
L10 label byte
dd 00H
dd 040140000H
align 1
L9 label byte
db 37
db 115
db 37
db 115
db 32
db 37
db 102
db 37
db 99
db 0
align 1
L8 label byte
db 115
db 116
db 0
align 1
L7 label byte
db 116
db 101
db 0
align 1
L6 label byte
db 37
db 115
db 37
db 115
db 32
db 37
db 119
db 37
db 99
db 0
align 1
L5 label byte
db 116
db 101
db 115
db 116
db 32
db 37
db 100
db 37
db 99
db 0
align 1
L4 label byte
db 50
db 0
align 1
L3 label byte
db 116
db 101
db 115
db 116
db 32
db 37
db 115
db 10
db 0
align 1
L2 label byte
db 116
db 101
db 115
db 116
db 32
db 49
db 10
db 0
_TEXT ends
end
|