Created
October 9, 2008 05:50
-
-
Save stevewillard/15706 to your computer and use it in GitHub Desktop.
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
pushl 16(%ebp) // push the name onto the stack | |
call sizeof // get the size of the string | |
addl $4, %esp // move the stack pointer back | |
incl %eax // sizeof(name) + 1 | |
pushl %eax // push sizeof(name) + 1 | |
call allocate // malloc ( sizeof( name ) + 1 ) | |
addl $4, %esp // move the stack pointer back | |
cmpl $0, %eax // malloc failed, so return 0 | |
je allocfail |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment