
{"id":1926,"date":"2010-07-08T20:22:17","date_gmt":"2010-07-08T14:52:17","guid":{"rendered":"http:\/\/www.jeffrin.in\/?p=1926"},"modified":"2010-07-08T20:22:17","modified_gmt":"2010-07-08T14:52:17","slug":"register-edi-holds-the-bit-offset","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2010\/07\/08\/register-edi-holds-the-bit-offset\/","title":{"rendered":"Register EDI holds the bit offset &#8230;"},"content":{"rendered":"<pre>\n<h3> software | Windows |<\/h3>\n<\/pre>\n<pre>\n<a href=\"http:\/\/www.trueangle.org\/wp-content\/uploads\/2010\/07\/3f2b0-edi1-2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.trueangle.org\/wp-content\/uploads\/2010\/07\/3f2b0-edi1-2.png\" alt=\"\" title=\"edi\" width=\"113\" height=\"106\" class=\"aligncenter size-full wp-image-1929\" \/><\/a>\n<\/pre>\n<pre>\nEDI: The Destination Index\n\nEvery loop that generates data must store the result in memory, and\ndoing so requires a moving pointer. The destination index, EDI, is that\n pointer. The destination index holds the implied write address of all\n string operations. The most useful string instruction, remarkably\n enough, is the seldom-used STOS. STOS copies data from the\n accumulator into memory and increments the destination index. This\n one-byte instruction is perfect, since the final result of any calculation\n should be in the accumulator anyhow, and storing results in a moving\n memory address is a common task.\n\nsource :\nhttp:\/\/www.swansontec.com\/sregisters.html\n<\/pre>\n<pre>\n<h3> software | GNU\/Linux | <\/h3>\n<\/pre>\n<pre>\n(gdb) info registers\nrax            0xfffffffffffffdfc\t-516\nrbx            0x5dc\t1500\nrcx            0xffffffffffffffff\t-1\nrdx            0x5dc\t1500\nrsi            0x1\t1\nrdi            0x7fffedb60c40\t140737181518912\nrbp            0x23c7160\t0x23c7160\nrsp            0x7fffedb60bf0\t0x7fffedb60bf0\nr8             0x0\t0\nr9             0xffffffff\t4294967295\nr10            0x8\t8\nr11            0x246\t582\nr12            0x7fffedb60c40\t140737181518912\nr13            0x7fffedb60c50\t140737181518928\nr14            0x0\t0\nr15            0x1\t1\nrip            0x7fc4a09070c8\t0x7fc4a09070c8 \neflags         0x246\t[ PF ZF IF ]\ncs             0x33\t51\nss             0x2b\t43\nds             0x0\t0\nes             0x0\t0\nfs             0x0\t0\ngs             0x0\t0\n(gdb)\n\n<h4> rdi            0x7fffedb60c40\t140737181518912 <\/h4>\n\nThe RAX, RBX, RCX, RDX, RBP, RSI, RDI, and RSP registers are used by\n both 32-bit and 64-bit binaries. However, in 32-bit mode, only the low\n 32 bits of these registers are accessible by 32-bit binaries. In the x86\n architecture, these registers are EAX, EBX, ECX, EDX, EBP, ESI, EDI,\n and ESP.\n\nsource :\nhttp:\/\/developers.sun.com\/solaris\/articles\/x64_dbx.html\n\n<\/pre>\n<pre>\n<h3> | Related Discussion | <\/h3>\n\nknut st. osmundsen 2007-02-09 18:29:55 EST\nDescription of problem:\n\nCrashing at __lll_mutex_timedlock_wait+148 (\/lib64\/tls\/libpthread.so.0):\nlock cmpxchg %edx,(%rdi)\nBecause the syscall wasn't made and %rdi hasn't been loaded with %r12\n yet.\nVersion-Release number of selected component (if applicable):\nglibc-3.4.0\nHow to fix:\nMove the mov %r12,%rdi instruction up somewhere before the je 8f.\n\nHow to reproduce:\n\nThis isn't easy to reproduce and I'm not going to write a testcase for it\nsince it's a very obvious bug in the code. But, my from the situation I\nget it in is that it requires a 2nd thread to signal the condition variable\n\/mutex (I'm not quite sure which it is) while the crashing thread is\nengaging a sleep.\n\n\nsource :\nhttps:\/\/bugzilla.redhat.com\/show_bug.cgi?id=228103\n<\/pre>\n<pre>\n<h3> | Variation | <\/h3>\n\nHardware 64 bit.\nWindows OS 32 bit so uses EDI.\nGNU\/Linux 64 bit version so used RDI.\n\nLinks(s).\nhttp:\/\/archive.midrange.com\/wdsci-l\/200903\/msg00083.html\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>software | Windows | EDI: The Destination Index Every loop that generates data must store the result in memory, and doing so requires a moving pointer. The destination index, EDI, is that pointer. The destination index holds the implied write address of all string operations. The most useful string instruction, remarkably enough, is the seldom-used &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2010\/07\/08\/register-edi-holds-the-bit-offset\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Register EDI holds the bit offset &#8230;&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/1926"}],"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=1926"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/1926\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=1926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=1926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=1926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}