{"id":4696,"date":"2022-05-31T14:29:01","date_gmt":"2022-05-31T21:29:01","guid":{"rendered":"http:\/\/www.contrapositivediary.com\/?p=4696"},"modified":"2022-05-31T14:30:53","modified_gmt":"2022-05-31T21:30:53","slug":"in-pursuit-of-x64","status":"publish","type":"post","link":"https:\/\/www.contrapositivediary.com\/?p=4696","title":{"rendered":"In Pursuit of x64"},"content":{"rendered":"<p>You may be wondering where I am, given that I haven&#8217;t posted a Contra entry for over a month. I didn&#8217;t want May to conclude with zero entries posted, so I figured I&#8217;d take a break here and get you up to speed.<\/p>\n<p>Here&#8217;s the deal: My publisher has asked for a Fourth Edition of <em>Assembly Language Step-By-Step<\/em>. It&#8217;s been thirteen years since the Third Edition came out, so it&#8217;s well past time. The idea here is to bring the book up to date on the x64 architecture. In fact, so that no one will mistake what&#8217;s going on, the title of the new edition will be <em>x64 Assembly Language Step-By-Step<\/em>, Fourth Edition. Whether they keep the &#8220;x&#8221; in lowercase remains to be seen.<\/p>\n<p>So I&#8217;m off and editing, writing new code and checking every code snippet in a SASM sandbox, and making sure that I don&#8217;t forget and talk about EAX and other 32-bits-and-down entities without good reason. (There are good reasons. Even AH and AL are still with us and used for certain things.) Make no mistake: This is going to be a <em>lot<\/em> of work. The Third Edition is 600 pages long, which isn&#8217;t the longest book I&#8217;ve ever written (that honor belongs to <em>Borland Pascal 7 From Square One<\/em>, at 810 pages) but it&#8217;s right up there.<\/p>\n<p>My great fear has been the possibility of needing to add a lot of new material that would make the book even longer, but in truth, that won&#8217;t be a huge problem. Here&#8217;s why: Some things that I spent a lot of pages on can be cut <em>way<\/em> back. Good example: In 32-bit Linux, system calls are made through the INT 80H call gate. In the Third Edition I went into considerable detail about how software interrupts work in a general sense. Now, x64 Linux uses a new x64 instruction, SYSCALL, to make calls into the OS. I&#8217;m not completely sure, but I don&#8217;t think it&#8217;s possible to use software interrupts at all in userspace programming anymore. I do have to explain SYSCALL, but there&#8217;s just not as much there there, and it won&#8217;t take nearly as many words and diagrams.<\/p>\n<p>Oh, and of course, segments are pretty much a thing of the past. Segment management (such that it is) belongs to the OS now, and for userspace programming, at least, you can forget about them. I&#8217;m leaving a little description of the old segment\/offset memory model for historical context, but not nearly as much as in previous editions.<\/p>\n<p>I also dumped the Game of Big Bux, which doesn&#8217;t pull its weight in the explanation department, and isn&#8217;t nearly as funny now as it was in 1990. But have faith: The Martians are still with us.<\/p>\n<p>My guess is that from a page count standpoint, it will pretty much be a wash.<\/p>\n<p>It&#8217;s going to take me awhile. I don&#8217;t know how long, in truth. Especially since I am going to try to keep my fiction output from drying up completely. The book will slow me down, but (for a change) the publisher is not in a huge hurry and I think they&#8217;ll give me the time I need. I have 56,000 words down on <em>The Everything Machine<\/em>, and don&#8217;t intend to put it on ice for months and months. I&#8217;m not sure how well that&#8217;s going to work. We&#8217;ll see.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may be wondering where I am, given that I haven&#8217;t posted a Contra entry for over a month. I didn&#8217;t want May to conclude with zero entries posted, so I figured I&#8217;d take a break here and get you up to speed. Here&#8217;s the deal: My publisher has asked for a Fourth Edition of [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[240,59,32,241],"class_list":["post-4696","post","type-post","status-publish","format-standard","hentry","category-ideasandanalysis","tag-computers","tag-linux","tag-programming","tag-x64"],"_links":{"self":[{"href":"https:\/\/www.contrapositivediary.com\/index.php?rest_route=\/wp\/v2\/posts\/4696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.contrapositivediary.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.contrapositivediary.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.contrapositivediary.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.contrapositivediary.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4696"}],"version-history":[{"count":2,"href":"https:\/\/www.contrapositivediary.com\/index.php?rest_route=\/wp\/v2\/posts\/4696\/revisions"}],"predecessor-version":[{"id":4698,"href":"https:\/\/www.contrapositivediary.com\/index.php?rest_route=\/wp\/v2\/posts\/4696\/revisions\/4698"}],"wp:attachment":[{"href":"https:\/\/www.contrapositivediary.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.contrapositivediary.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.contrapositivediary.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}