Last active
August 29, 2015 13:57
-
-
Save antonijn/9871951 to your computer and use it in GitHub Desktop.
strlen function using cdecl in x86-16
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
| strlen: | |
| push bp | |
| mov bp, sp | |
| mov si, 0 | |
| .rep: | |
| mov ax, [bp + si + 4] | |
| test ax, ax | |
| jz .break | |
| inc si | |
| jmp .rep | |
| .break: | |
| mov ax, si | |
| pop bp | |
| retn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment