Created
March 27, 2018 03:08
-
-
Save raminfp/d8f98e691c8ae7ab62aab1b9d5f1c0a4 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
cmp_digit(2, 4); | |
| | | |
| | | |
esi edi | |
ret: | |
0 : true | |
1 : false | |
*/ | |
unsigned int cmp_digit(int a, int b) | |
{ | |
// TODO ; Chech isdigit() | |
DWORD dwReturn; | |
__asm | |
{ | |
pushad | |
mov esi, a | |
mov edi, b | |
call __OK | |
__OK: | |
cmp esi, edi | |
jne __NOK | |
mov eax, 0 | |
jmp __EXIST | |
__NOK: | |
xor eax, eax | |
mov eax, 1 | |
jmp __EXIST | |
__EXIST: | |
mov[dwReturn], eax | |
} | |
return dwReturn; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment