assembly - Using the esp register -



assembly - Using the esp register -

i trying understand how utilize stack assembly , in effort came across next code in 1 of questions in so, namely:

push ecx mov eax, 4 mov ebx, 1 mov ecx, result mov edx, result_len int 0x80 mov eax, 4 mov ebx, 1 mov ecx, esp add together [ecx], dword 48 mov edx, 2 int 0x80

in case ecx, holding number , author displaying number (correct me if wrong!) first moving stack pointer ecx , converting number ascii character adding 48 memory address ecx pointing. have been able same thing "pop ecx" , convert ascii? not quite understand why author proceeding in way. help appreciated.

would have been able same thing "pop ecx" , convert ascii?

no. sys_write scheme call, needs pointer string print. pushing ecx onto stack, create pointer (address) in esp.

assembly nasm esp

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -