Menu

[73c16a]: / Optimizer / Maker.asm  Maximize  Restore  History

Download this file

386 lines (376 with data), 6.4 kB

  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
format PE console
include 'C:\Users\NanoBytes\Desktop\BOLT v3\bin\INCLUDE\win32ax.inc'
include 'C:\Users\NanoBytes\Desktop\BOLT v3\bin\INCLUDE\BOLT.inc'
Memory DD ?
Library DD ?
Return DD ?
Index DD ?
proc write_BOLT
mov ebp,esp
mov eax,[ebp+8]
stdcall getString,eax
stdcall print
mov esp,ebp
ret
endp
proc writeLn_BOLT
mov ebp,esp
setString "\n"
call loadString
stdcall getString,eax
call loadString
push eax
mov eax,dword[ebp+8]
pop ebx
stdcall addString,eax,ebx
mov dword[ebp+8],eax
sub esp,0
mov eax,dword[ebp+8]
stdcall getString,eax
call loadString
stdcall getString,eax
call loadString
push eax
push ebp
call write_BOLT
pop ebp
add esp,4
add esp,0
mov esp,ebp
ret
endp
proc getNumber_BOLT
mov ebp,esp
invoke GetProcAddress, [Library], "gets"
stdcall eax,String
call atof
mov esp,ebp
ret
endp
proc round_BOLT
mov ebp,esp
sub esp,4
invoke HeapAlloc,<invoke GetProcessHeap>,HEAP_ZERO_MEMORY,8
add esp,4
mov dword[ebp+-4],eax
sub esp,4
setString "10"
call atof
add esp,4
mov eax,[ebp+8]
fld qword[eax]
sub esp,4
setString "1"
call atof
add esp,4
fsubp st1, st0
sub esp,4
call fpow
add esp,4
cmp al,1
mov eax,dword[ebp+-4]
fstp qword[eax]
mov eax,[ebp+-4]
FLD qword[eax]
mov eax,[ebp+12]
FLD qword[eax]
fmul st0, st1
frndint
fxch
fdivp st1,st0
mov eax,dword[ebp+-4]
FSTP qword[eax]
mov eax,[ebp+-4]
fld qword[eax]
sub esp,4
setString "0"
call atof
add esp,4
xor eax,eax
fcomip st1
sete al
fcomp
fcomp
mov [Index],eax
fild [Index]
cmp al,1
cmp al,1
jne Label_8
mov eax,[ebp+-4]
fld qword[eax]
fabs
cmp al,1
mov eax,dword[ebp+-4]
fstp qword[eax]
jmp Label_9
Label_8:
Label_9:
mov eax,[ebp+-4]
fld qword[eax]
cmp al,1
mov esp,ebp
ret
mov esp,ebp
fldz
ret
endp
start:
invoke AllocConsole
invoke GetProcessHeap
mov [Memory],eax
invoke LoadLibrary,"MSVCRT.dll"
mov [Library],eax
mov ebp,esp
FSTCW word[esp+2]
or word[esp+2], 0C00h
FLDCW word[esp+2]
invoke GetProcAddress, [Library], "time"
mov ebx,eax
stdcall ebx,0
push eax
invoke GetProcAddress, [Library], "srand"
mov ebx,eax
pop eax
stdcall ebx,eax
invoke GetProcAddress, [Library], "rand"
stdcall eax
sub esp,0
setString "Enter the angle you want to find the sine of (deg): "
call loadString
stdcall getString,eax
call loadString
push eax
push ebp
call write_BOLT
pop ebp
add esp,4
add esp,0
sub esp,4
invoke HeapAlloc,<invoke GetProcessHeap>,HEAP_ZERO_MEMORY,8
add esp,4
mov dword[ebp+-4],eax
sub esp,4
push ebp
call getNumber_BOLT
pop ebp
add esp,0
add esp,4
cmp al,1
mov eax,dword[ebp+-4]
fstp qword[eax]
sub esp,8
invoke HeapAlloc,<invoke GetProcessHeap>,HEAP_ZERO_MEMORY,8
add esp,8
mov dword[ebp+-8],eax
mov eax,[ebp+-4]
fld qword[eax]
sub esp,8
setString "0.01745329"
call atof
add esp,8
fmulp st1, st0
cmp al,1
mov eax,dword[ebp+-8]
fstp qword[eax]
sub esp,12
invoke HeapAlloc,<invoke GetProcessHeap>,HEAP_ZERO_MEMORY,8
add esp,12
mov dword[ebp+-12],eax
sub esp,12
setString "0"
call atof
add esp,12
cmp al,1
mov eax,dword[ebp+-12]
fstp qword[eax]
sub esp,16
invoke HeapAlloc,<invoke GetProcessHeap>,HEAP_ZERO_MEMORY,8
add esp,16
mov dword[ebp+-16],eax
sub esp,16
setString "1"
call atof
add esp,16
cmp al,1
mov eax,dword[ebp+-16]
fstp qword[eax]
sub esp,16
setString "15"
call atof
add esp,16
cmp al,1
sub esp,20
invoke HeapAlloc,<invoke GetProcessHeap>,HEAP_ZERO_MEMORY,8
add esp,20
mov dword[ebp+-20],eax
mov eax,dword[ebp+-20]
fld qword[eax]
fld1
faddp st1, st0
mov eax,dword[ebp+-20]
fstp qword[eax]
sub esp,24
fistp dword[esp]
inc dword[esp]
pop eax
mov ecx,eax
Label_10:
push ecx
cmp ecx,1
jle Label_11
mov eax,[ebp+-16]
fld qword[eax]
mov eax,[ebp+-8]
fld qword[eax]
mov eax,[ebp+-20]
fld qword[eax]
sub esp,24
setString "2"
call atof
add esp,24
fmulp st1, st0
sub esp,24
setString "1"
call atof
add esp,24
fsubp st1, st0
sub esp,24
call fpow
add esp,24
mov eax,[ebp+-20]
fld qword[eax]
sub esp,24
setString "2"
call atof
add esp,24
fmulp st1, st0
sub esp,24
setString "1"
call atof
add esp,24
fsubp st1, st0
fld1
fxch
@@:
fld1
fcomip st,st1
jae @f
fld st
fld1
fsubp
fxch
fmulp st2,st
jmp @b
@@:
fstp st
fdivp st1, st0
fmulp st1, st0
cmp al,1
mov eax,dword[ebp+-12]
fld qword[eax]
faddp st1, st0
mov eax,dword[ebp+-12]
fstp qword[eax]
sub esp,24
setString "1"
call atof
add esp,24
fchs
cmp al,1
mov eax,dword[ebp+-16]
fld qword[eax]
fmulp st1, st0
mov eax,dword[ebp+-16]
fstp qword[eax]
pop ecx
cmp ecx,1
jle Label_11
dec ecx
mov eax,dword[ebp+-20]
fld qword[eax]
fld1
faddp st1, st0
mov eax,dword[ebp+-20]
fstp qword[eax]
jmp Label_10
Label_11:
add esp,16
sub esp,16
mov eax,[ebp+-12]
fld qword[eax]
cmp al,1
sub esp,16
invoke HeapAlloc,<invoke GetProcessHeap>,HEAP_ZERO_MEMORY,8
add esp,16
fstp qword[eax]
push eax
sub esp,16
setString "8"
call atof
add esp,16
cmp al,1
sub esp,16
invoke HeapAlloc,<invoke GetProcessHeap>,HEAP_ZERO_MEMORY,8
add esp,16
fstp qword[eax]
push eax
push ebp
call round_BOLT
pop ebp
add esp,8
add esp,16
cmp al,1
mov eax,dword[ebp+-12]
fstp qword[eax]
sub esp,16
sub esp,16
setString "The sine of "
call loadString
add esp,16
push eax
mov eax,[ebp+-4]
fld qword[eax]
cmp al,1
sub esp,16
call ftoa
call loadString
add esp,16
pop ebx
sub esp,16
stdcall addString,ebx,eax
add esp,16
push eax
sub esp,16
setString " degrees is "
call loadString
add esp,16
pop ebx
sub esp,16
stdcall addString,ebx,eax
add esp,16
push eax
mov eax,[ebp+-12]
fld qword[eax]
cmp al,1
sub esp,16
call ftoa
call loadString
add esp,16
pop ebx
sub esp,16
stdcall addString,ebx,eax
add esp,16
sub esp,16
stdcall getString,eax
call loadString
add esp,16
push eax
push ebp
call writeLn_BOLT
pop ebp
add esp,4
add esp,16
call halt
invoke FreeLibrary,[Library]
invoke ExitProcess,0
.end start
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.