Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- format PE console
- entry main
- include 'macro/import32.inc'
- include 'macro/proc32.inc'
- section '.data' data readable writeable
- msg1 db 'Tauras Steponavicius IIF-15',0
- msg2 db 'kuri uzdavini norite sprest? (1/2, 3-iseiti)',0
- msg4 db 'Iveskite pradines valandas: ',0
- msg5 db 'Iveskite pradines minutes: ',0
- msg6 db 'Iveskite pradines sekundes: ',0
- msg7 db 'Iveskite galines valandas: ',0
- msg8 db 'Iveskite galines minutes: ',0
- msg9 db 'Iveskite galines sekundes: ',0
- msg10 db ' Val ',0
- msg11 db ' Min ',0
- msg12 db ' Sek ',0
- msg3 db 0xa,0
- formatas dd '%d',0
- msg db '%d ',0
- choice dd ?
- val1 dd ?
- min1 dd ?
- sek1 dd ?
- val2 dd ?
- min2 dd ?
- sek2 dd ?
- val dd ?
- min dd ?
- sek dd ?
- multi dd ?
- space db ',',0
- p db "pause>nul",0
- section '.code' code readable executable
- func1:
- push ebp
- mov ebp, esp
- mov [val], 0
- mov [min], 0
- mov [sek], 0
- push msg4
- call [printf]
- push val1
- push formatas
- call [scanf]
- push msg5
- call [printf]
- push min1
- push formatas
- call [scanf]
- push msg6
- call [printf]
- push sek1
- push formatas
- call [scanf]
- mov eax, [val1]
- imul eax, 3600
- mov ebx, [min1]
- imul ebx, 60
- mov ecx, [sek1]
- add ecx, eax
- add ecx, ebx
- mov [sek], ecx
- push msg7
- call [printf]
- push val2
- push formatas
- call [scanf]
- push msg8
- call [printf]
- push min2
- push formatas
- call [scanf]
- push msg9
- call [printf]
- push sek2
- push formatas
- call [scanf]
- mov eax, [val2]
- imul eax, 3600
- mov ebx, [min2]
- imul ebx, 60
- mov ecx, [sek2]
- add ecx, eax
- add ecx, ebx
- sub [sek], ecx
- mov eax, [sek]
- mov ebx, [min]
- mov ecx, [val]
- @minloop:
- cmp eax, 60
- jl @valloop
- sub eax, 60
- mov ebx, [min]
- add ebx, 1
- mov [min], ebx
- jmp @minloop
- @valloop:
- cmp ebx, 60
- jl @output
- sub ebx, 60
- mov ecx, [val]
- add ecx, 1
- mov [val], ecx
- jmp @valloop
- @output:
- mov [sek], eax
- mov [min], ebx
- mov [val], ecx
- push [val]
- push formatas
- call [printf]
- push msg10
- call [printf]
- push [min]
- push formatas
- call [printf]
- push msg11
- call [printf]
- push [sek]
- push formatas
- call [printf]
- push msg12
- call [printf]
- mov esp, ebp
- pop ebp
- ret
- func:
- push ebp
- mov ebp, esp
- push msg1
- call [printf]
- push msg3
- call [printf]
- mov esp, ebp
- pop ebp
- ret
- func2:
- push ebp
- mov ebp, esp
- mov eax, -10
- @looper:
- cmp eax, 12
- je @endlooper
- mov ebx, eax
- mov [multi], eax
- imul eax, [multi]
- imul eax, [multi]
- imul eax, [multi]
- imul eax, [multi]
- imul eax, 5
- add eax, [multi]
- mov [multi], eax
- push [multi]
- push formatas
- call [printf]
- push msg3
- call [printf]
- add ebx, 2
- mov eax, ebx
- jmp @looper
- @endlooper:
- mov esp, ebp
- pop ebp
- ret
- funcmenu:
- push ebp
- mov ebp, esp
- @start:
- push msg2
- call [printf]
- push choice
- push formatas
- call [scanf]
- mov eax, [choice]
- cmp eax, 1
- je @func1
- cmp eax, 2
- je @func2
- cmp eax, 3
- je @pab
- jmp @start
- @func1:
- call func1
- jmp @start
- @func2:
- call func2
- jmp @start
- call func2
- @pab:
- mov esp, ebp
- pop ebp
- ret
- main:
- call func
- call funcmenu
- invoke system, p ;Calling function with invoke command
- invoke exit, 0
- section '.idata' import data readable
- library msvcrt,'msvcrt.dll'
- import msvcrt,\
- printf,'printf',\
- scanf, 'scanf',\
- system,'system',\
- exit,'exit'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement