Difference between revisions of "Example 1"

From SkullSecurity
Jump to navigation Jump to search
Line 1: Line 1:
{{Infobox assembly}}
<pre>
<pre>
   mov    eax, 3
   mov    eax, 3
Line 29: Line 31:
   ret
   ret
</pre>
</pre>
[[Category: assembly examples]]

Revision as of 19:28, 12 March 2007

Assembly Language Tutorial
Please choose a tutorial page:
   mov     eax, 3
   mov     esi, ecx
   xor     ecx, ecx
 Top:
   movsx   edx, byte ptr [ecx+esi]
   sub     edx, 30h
   lea     edi, [eax+eax]
   xor     edx, edi
   add     eax, edx
   inc     ecx
   cmp     ecx, 0Ch
   jl      short Top

   xor     edx, edx
   mov     ecx, 0Ah
   div     ecx

   movsx   eax, byte ptr [esi+0Ch]
   add     edx, 30h
   cmp     eax, edx
   jnz     bottom

   mov     eax, 1
   ret

 bottom:
   xor     eax, eax
   ret