Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- format PE console
- entry main
- include 'd:/Projects/Assembler/SALO/SALO Compiler/INCLUDE/win32amacro.inc'
- section '.text' code readable executable
- ; peretvoryuvane : lpcstr as dword ptr ebp+8
- lpcstrvptr:
- push ebp
- mov ebp, esp
- ;native
- mov eax, dword ptr ebp+8
- mov esp, ebp
- pop ebp
- ret
- ; znachennya : float32 as dword ptr ebp+8
- lyapnutyfloat32:
- push ebp
- mov ebp, esp
- sub esp, 16
- ;expression printstr ( "" )
- push lpcstr3
- call [printstr]
- add esp, 4
- ;local void_ptr variable k at dword ptr ebp-4
- ;expression k = lpcstrvptr ( "%f" )
- push lpcstr4
- call lpcstrvptr
- add esp, 4
- mov dword ptr ebp-4, eax
- ;native
- movss xmm0, dword ptr ebp+8
- cvtss2sd xmm0, xmm0
- sub esp, 8
- movsd qword ptr esp, xmm0
- push dword ptr ebp-4
- call printstr
- add esp, 12
- mov esp, ebp
- pop ebp
- ret
- ; : void as dword ptr ebp+8
- main:
- push ebp
- mov ebp, esp
- sub esp, 16
- ;local float32 variable a at dword ptr ebp-4
- ;expression a = 7.0
- mov dword ptr ebp-4, 7.0
- ;local float32 variable b at dword ptr ebp-8
- ;expression b = 5.0
- mov dword ptr ebp-8, 5.0
- ;local float32 variable v at dword ptr ebp-12
- ;expression v = a + b
- movss xmm0, dword ptr ebp-4
- addss xmm0, dword ptr ebp-8
- movd dword ptr ebp-12, xmm0
- ;expression lyapnutyfloat32 ( v )
- push dword ptr ebp-12
- call lyapnutyfloat32
- add esp, 4
- ;expression return 0
- mov eax, 0
- mov esp, ebp
- pop ebp
- invoke ExitProcess, eax
- section '.data' data readable writeable
- lpcstr3 db 0
- lpcstr4 db "%f",0
- section '.idata' data import readable
- library kernel32,'kernel32.dll',\
- msvcrt,'msvcrt.dll'
- import kernel32,\
- ExitProcess,'ExitProcess',\
- SetConsoleCP,'SetConsoleCP',\
- SetConsoleOutputCP,'SetConsoleOutputCP'
- import msvcrt,\
- scanint32,'scanf',\
- printint32,'printf',\
- printstr,'printf'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement