{"id":952,"date":"2009-01-30T01:07:43","date_gmt":"2009-01-29T16:07:43","guid":{"rendered":"http:\/\/terzeron.com\/?p=952"},"modified":"2009-01-30T01:07:43","modified_gmt":"2009-01-29T16:07:43","slug":"x86-assembly-code%ec%9d%98-register%eb%a5%bc-%ec%84%a4%eb%aa%85%ec%9c%bc%eb%a1%9c-%eb%b0%94%ea%bf%94%ec%a3%bc%eb%8a%94-%ec%8a%a4%ed%81%ac%eb%a6%bd%ed%8a%b8","status":"publish","type":"post","link":"https:\/\/terzeron.com\/?p=952","title":{"rendered":"x86 assembly code\uc758 register\ub97c \uc124\uba85\uc73c\ub85c \ubc14\uafd4\uc8fc\ub294 \uc2a4\ud06c\ub9bd\ud2b8"},"content":{"rendered":"<p>x86 assembly code\ub97c \uc77d\uc5b4\uc57c \ud558\ub294 \uacbd\uc6b0\uac00 \uac00\ub054 \uc788\ub294\ub370, operator\ub294 \uadf8\ub807\ub2e4 \uccd0\ub3c4 \uc218\ub9ce\uc740 register\ub294 \uc678\uc6b0\uae30\uac00 \uc27d\uc9c0 \uc54a\uc544\uc11c \uc544\uc608 \uc2a4\ud06c\ub9bd\ud2b8\ub85c \uc791\uc131\ud55c \uc801\uc774 \uc788\ub2e4. \uc18c\uc2a4 \ucf54\ub4dc\ub97c \uc815\ub9ac\ud558\ub2e4\uac00 \ubc1c\uacac\ud558\uc5ec \ud639\uc2dc\ub098 \uacf5\uc720\ud560 \uc218 \uc788\uc744 \uaebc\ub9ac\uac00 \ub418\uc9c0 \uc54a\uc744\uae4c \uc2f6\uc5b4 \ud3ec\uc2a4\ud305\ud574\ubcf8\ub2e4.<\/p>\n<p>\uc544\ub798 \ub0b4\uc6a9\uc744 annotate_asm.pl\uc774\ub77c\ub294 \uc774\ub984\uc73c\ub85c \uc800\uc7a5\ud55c\ub2e4.<br \/>\n<a href='http:\/\/terzeron.com\/wp-content\/uploads\/2009\/01\/annotate_asm.pl'>annotate_asm.pl<\/a><\/p>\n<pre class=\"brush: php\">#!\/usr\/bin\/env perl\n\nwhile (<>) {\ns\/%ax\/\\[return value 16\\]\/g;\ns\/%bx\/\\[callee saved 16\\]\/g;\ns\/%cx\/\\[4th arg 16\\]\/g;\ns\/%dx\/\\[3rd arg 16\\]\/g;\ns\/%si\/\\[2nd arg 16\\]\/g;\ns\/%di\/\\[1st arg 16\\]\/g;\ns\/%bp\/\\[callee saved 16\\]\/g;\ns\/%sp\/\\[stack pointer 16\\]\/g;\ns\/%r8w\/\\[5th arg 16\\]\/g;\ns\/%r9w\/\\[6th arg 16\\]\/g;\ns\/%r10w\/\\[callee saved 16\\]\/g;\ns\/%r11w\/\\[used for linking 16\\]\/g;\ns\/%r12w\/\\[callee saved 16\\]\/g;\ns\/%r13w\/\\[callee saved 16\\]\/g;\ns\/%r14w\/\\[callee saved 16\\]\/g;\ns\/%r15w\/\\[callee saved 16\\]\/g;\ns\/%eax\/\\[return value 32\\]\/g;\ns\/%ebx\/\\[callee saved 32\\]\/g;\ns\/%ecx\/\\[4th arg 32\\]\/g;\ns\/%edx\/\\[3rd arg 32\\]\/g;\ns\/%esi\/\\[2nd arg 32\\]\/g;\ns\/%edi\/\\[1st arg 32\\]\/g;\ns\/%ebp\/\\[callee saved 32\\]\/g;\ns\/%esp\/\\[stack pointer 32\\]\/g;\ns\/%r8d\/\\[5th arg 32\\]\/g;\ns\/%r9d\/\\[6th arg 32\\]\/g;\ns\/%r10d\/\\[callee saved 32\\]\/g;\ns\/%r11d\/\\[used for linking 32\\]\/g;\ns\/%r12d\/\\[callee saved 32\\]\/g;\ns\/%r13d\/\\[callee saved 32\\]\/g;\ns\/%r14d\/\\[callee saved 32\\]\/g;\ns\/%r15d\/\\[callee saved 32\\]\/g;\ns\/%rax\/\\[return value 64\\]\/g;\ns\/%rbx\/\\[callee saved 64\\]\/g;\ns\/%rcx\/\\[4th arg 64\\]\/g;\ns\/%rdx\/\\[3rd arg 64\\]\/g;\ns\/%rsi\/\\[2nd arg 64\\]\/g;\ns\/%rdi\/\\[1st arg 64\\]\/g;\ns\/%rbp\/\\[callee saved 64\\]\/g;\ns\/%rsp\/\\[stack pointer 64\\]\/g;\ns\/%r8\/\\[5th arg 64\\]\/g;\ns\/%r9\/\\[6th arg 64\\]\/g;\ns\/%r10\/\\[callee saved 64\\]\/g;\ns\/%r11\/\\[used for linking 64\\]\/g;\ns\/%r12\/\\[callee saved 64\\]\/g;\ns\/%r13\/\\[callee saved 64\\]\/g;\ns\/%r14\/\\[callee saved 64\\]\/g;\ns\/%r15\/\\[callee saved 64\\]\/g;\nprint;\n}<\/pre>\n<p>\uc0ac\uc6a9\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre class=\"brush: xml\">$ gcc -S -o test.s test.c\n$ .\/annotate_asm.pl test.s<\/pre>\n<p>\uc124\uba85\uc758 \ubaa8\uc591\uc740 \uc9d0\uc791\ub300\ub85c \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre class=\"brush: xml\">\t.file\t\"test.c\"\n.text\n.globl main\n.type\tmain, @function\nmain:\nleal\t4([stack pointer 32]), [4th arg 32]\nandl\t$-16, [stack pointer 32]\npushl\t-4([4th arg 32])\npushl\t[callee saved 32]\nmovl\t[stack pointer 32], [callee saved 32]\npushl\t[4th arg 32]\nsubl\t$404, [stack pointer 32]\naddl\t$404, [stack pointer 32]\npopl\t[4th arg 32]\npopl\t[callee saved 32]\nleal\t-4([4th arg 32]), [stack pointer 32]\nret\n.size\tmain, .-main\n.ident\t\"GCC: (Ubuntu 4.3.2-1ubuntu12) 4.3.2\"\n.section\t.note.GNU-stack,\"\",@progbits<\/pre>\n<p>\ub2e4\ub9cc, \uc704\uc5d0 \uc815\ub9ac\ub41c register \uc911\uc5d0\ub294 \ube60\uc9c4 \uac83\uc774 \uc788\uc744 \uc218 \uc788\ub2e4.<\/p>\n<div class=\"fb-background-color\">\n\t\t\t  <div \n\t\t\t  \tclass = \"fb-comments\" \n\t\t\t  \tdata-href = \"https:\/\/terzeron.com\/?p=952\"\n\t\t\t  \tdata-numposts = \"100\"\n\t\t\t  \tdata-lazy = \"true\"\n\t\t\t\tdata-colorscheme = \"light\"\n\t\t\t\tdata-order-by = \"time\"\n\t\t\t\tdata-mobile=true>\n\t\t\t  <\/div><\/div>\n\t\t  <style>\n\t\t    .fb-background-color {\n\t\t\t\tbackground: #ffffff !important;\n\t\t\t}\n\t\t\t.fb_iframe_widget_fluid_desktop iframe {\n\t\t\t    width: 100% !important;\n\t\t\t}\n\t\t  <\/style>\n\t\t  ","protected":false},"excerpt":{"rendered":"<p>x86 assembly code\ub97c \uc77d\uc5b4\uc57c \ud558\ub294 \uacbd\uc6b0\uac00 \uac00\ub054 \uc788\ub294\ub370, operator\ub294 \uadf8\ub807\ub2e4 \uccd0\ub3c4 \uc218\ub9ce\uc740 register\ub294 \uc678\uc6b0\uae30\uac00 \uc27d\uc9c0 \uc54a\uc544\uc11c \uc544\uc608 \uc2a4\ud06c\ub9bd\ud2b8\ub85c \uc791\uc131\ud55c \uc801\uc774 \uc788\ub2e4. \uc18c\uc2a4 \ucf54\ub4dc\ub97c \uc815\ub9ac\ud558\ub2e4\uac00 \ubc1c\uacac\ud558\uc5ec \ud639\uc2dc\ub098 \uacf5\uc720\ud560 \uc218 \uc788\uc744 \uaebc\ub9ac\uac00 \ub418\uc9c0 \uc54a\uc744\uae4c \uc2f6\uc5b4 \ud3ec\uc2a4\ud305\ud574\ubcf8\ub2e4. \uc544\ub798 \ub0b4\uc6a9\uc744 annotate_asm.pl\uc774\ub77c\ub294 \uc774\ub984\uc73c\ub85c \uc800\uc7a5\ud55c\ub2e4. annotate_asm.pl &hellip; <a href=\"https:\/\/terzeron.com\/?p=952\">\uacc4\uc18d \uc77d\uae30 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[13],"tags":[],"class_list":["post-952","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/posts\/952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=952"}],"version-history":[{"count":0,"href":"https:\/\/terzeron.com\/index.php?rest_route=\/wp\/v2\/posts\/952\/revisions"}],"wp:attachment":[{"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/terzeron.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}