Skip to content

Instantly share code, notes, and snippets.

@raminfp
Created March 27, 2018 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raminfp/d8f98e691c8ae7ab62aab1b9d5f1c0a4 to your computer and use it in GitHub Desktop.
Save raminfp/d8f98e691c8ae7ab62aab1b9d5f1c0a4 to your computer and use it in GitHub Desktop.
/*
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