Skip to content

Instantly share code, notes, and snippets.

@antonijn
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save antonijn/9871951 to your computer and use it in GitHub Desktop.

Select an option

Save antonijn/9871951 to your computer and use it in GitHub Desktop.
strlen function using cdecl in x86-16
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