Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scale_number:
- push ebp ;; Pushing Base pointer (contains address of current activation frame
- ;; which is actually the return address of the caller) to the stack
- mov ebp, esp ;; Overrides ebp value to Stack pointer's value which contains the
- ;; address of last used dword in the stack.
- pushad ;; Push all significant registers (8 general purpose registers)
- ;; onto the stack (backup registers values)
- mov ebx, [ebp + 12] ;; Upper bound
- sub dword ebx, [ebp + 8] ;; Substruct ebx with the Lower bound
- mov ecx, [ebp + 16] ;; get the pointer of the result contianer
- finit
- mov eax, dword [seed]
- mul ebx
- push eax
- fild dword [esp]
- add esp, 4
- push 0x0000FFFF
- fidiv dword [esp]
- add esp, 4
- fiadd dword [ebp + 8]
- fstp tword [ecx]
- ffree
- popad
- return_from_function ; macro for quiting the function
- push dword var1
- push 100
- push 40
- call scale_number
- ;; Floating point tester TWORD
- sub esp, 10
- mov ebx, 0
- .loop4:
- mov eax, [var1 + ebx]
- mov [esp + ebx], eax
- inc ebx
- cmp ebx, 10
- jne .loop4
- push format_fp ;; using "%f" , 10, 0 as the format_fp
- call printf
- add esp, 14
- jmp exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement