-
-
Save cryptohedge/8433796 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global main | |
| extern printf | |
| extern puts | |
| extern scanf | |
| extern exit | |
| section .text | |
| main: | |
| push dword hint1 | |
| call puts | |
| add esp,4 | |
| push dword b | |
| push dword a | |
| push dword d2 | |
| call scanf | |
| add esp,12 | |
| xor eax, eax | |
| xor ebx, ebx | |
| xor edx, edx | |
| mov eax,[a] | |
| mov ebx,[b] | |
| cmp eax,ebx | |
| JL LESS | |
| JG GREAT | |
| mov edx,2 | |
| JMP PRINT | |
| GREAT: | |
| add ebx, 2 | |
| xchg ebx, eax | |
| cdq | |
| imul ebx | |
| mov edx, eax | |
| JMP PRINT | |
| LESS: | |
| cdq | |
| mov ebx, 8 | |
| imul ebx | |
| add eax, 4 | |
| mov edx, eax | |
| JMP PRINT | |
| PRINT: | |
| push dword edx | |
| push dword hint | |
| call printf | |
| add esp,8 | |
| push dword 0 | |
| call exit | |
| ret | |
| section .data | |
| a dd 0 | |
| b dd 0 | |
| hint1 db "Enter value a and b:",0 | |
| d2 db "%d%d",0 | |
| hint db "Answer: %d",0xA,0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment