
{"id":18583,"date":"2010-07-15T23:45:59","date_gmt":"2010-07-15T18:15:59","guid":{"rendered":"http:\/\/www.jeffrin.in\/?p=2029"},"modified":"2010-07-15T23:45:59","modified_gmt":"2010-07-15T18:15:59","slug":"push-instruction-push-rbx-2","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2010\/07\/15\/push-instruction-push-rbx-2\/","title":{"rendered":"What is a PUSH instruction ?"},"content":{"rendered":"<p><u>ABOUT PUSH INSTRUCTION RELATED<\/u><\/p>\n<pre>\nIn 8086, the main stack register is called stack pointer - SP. The stack segment register (SS) is usually used to store information about the memory segment that stores the call stack of currently executed program. SP points to current stack top. By default, the stack grows downward in memory, so newer values are placed at lower memory addresses. To push a value to the stack, the PUSH instruction is used. To pop a value from the stack, the POP instruction is used.\n\n<\/pre>\n<p><u>TYPICAL GDB SESSION<\/u><br \/>\n[bash]<br \/>\n(gdb) disass<br \/>\nDump of assembler code for function _IO_default_uflow:<br \/>\n   0x00007f7c1e9964d0 :\tmov    0xd8(%rdi),%rax<br \/>\n=&amp;gt; 0x00007f7c1e9964d7 :\tpush   %rbx<br \/>\n   0x00007f7c1e9964d8 :\tmov    %rdi,%rbx<br \/>\n   0x00007f7c1e9964db :\tcallq  *0x20(%rax)<br \/>\n   0x00007f7c1e9964de :\tcmp    $0xffffffffffffffff,%eax<br \/>\n   0x00007f7c1e9964e1 :\tje     0x7f7c1e9964f2<br \/>\n   0x00007f7c1e9964e3 :\tmov    0x8(%rbx),%rdx<br \/>\n   0x00007f7c1e9964e7 :\tmovzbl (%rdx),%eax<br \/>\n   0x00007f7c1e9964ea :\tadd    $0x1,%rdx<br \/>\n   0x00007f7c1e9964ee :\tmov    %rdx,0x8(%rbx)<br \/>\n   0x00007f7c1e9964f2 :\tpop    %rbx<br \/>\n   0x00007f7c1e9964f3 :\tretq<br \/>\nEnd of assembler dump.<br \/>\n(gdb)<br \/>\n[\/bash]<\/p>\n<pre>\nrbx is the 64 bit equivelant for ebx register\n\nPUSH instruction pushes  a value onto  the stack. Here i think push instruction pushes the value of rbx register on to the stack.\n<\/pre>\n<p>LINKS<br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Stack_register\">https:\/\/en.wikipedia.org\/wiki\/Stack_register<\/a><br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/X86_instruction_listings\">https:\/\/en.wikipedia.org\/wiki\/X86_instruction_listings<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ABOUT PUSH INSTRUCTION RELATED In 8086, the main stack register is called stack pointer &#8211; SP. The stack segment register (SS) is usually used to store information about the memory segment that stores the call stack of currently executed program. SP points to current stack top. By default, the stack grows downward in memory, so &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2010\/07\/15\/push-instruction-push-rbx-2\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;What is a PUSH instruction ?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2034,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[83],"tags":[263,1359],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/18583"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=18583"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/18583\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media\/2034"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=18583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=18583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=18583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}