Title: 2.6:The statement that `inc rax` takes 1 byte in x86 is incorrect. · Issue #329 · algorithmica-org/algorithmica · GitHub
Open Graph Title: 2.6:The statement that `inc rax` takes 1 byte in x86 is incorrect. · Issue #329 · algorithmica-org/algorithmica
X Title: 2.6:The statement that `inc rax` takes 1 byte in x86 is incorrect. · Issue #329 · algorithmica-org/algorithmica
Description: in section 2.6,you noted "something simple and very common like inc rax takes one byte". In the x86_64 architecture, the machine code for the inc rax instruction is actually \x48\xff\xc0 and inc eax is \xff\xc0, which is not 1 byte long....
Open Graph Description: in section 2.6,you noted "something simple and very common like inc rax takes one byte". In the x86_64 architecture, the machine code for the inc rax instruction is actually \x48\xff\xc0 and inc ea...
X Description: in section 2.6,you noted "something simple and very common like inc rax takes one byte". In the x86_64 architecture, the machine code for the inc rax instruction is actually \x48\xff\xc0 ...
Opengraph URL: https://github.com/algorithmica-org/algorithmica/issues/329
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"2.6:The statement that `inc rax` takes 1 byte in x86 is incorrect.","articleBody":"in section 2.6,you noted \"something simple and very common like inc rax takes one byte\".\n\nIn the x86_64 architecture, the machine code for the inc rax instruction is actually \\x48\\xff\\xc0 and inc eax is \\xff\\xc0, which is not 1 byte long. The confusion likely arises from mixing up with the 32-bit version of the instruction.\n\nIn the x86 (32-bit) architecture, the instruction inc eax has the machine code \\x40, which is indeed 1 byte. However, when moving to the x86_64 (64-bit) architecture, the instruction inc rax requires a REX prefix (\\x48), followed by \\xff\\xc0, making the total size 3 bytes.\n\nTo clarify:\n\nIn x86 (32-bit): inc eax machine code is \\x40 (1 byte).\nIn x86_64 (64-bit): inc rax machine code is \\x48\\xff\\xc0 (3 bytes), with the \\x48 prefix indicating the use of the 64-bit register (rax instead of eax).\nThis distinction is important for understanding how machine code differs between 32-bit and 64-bit architectures. Therefore, the statement that \"inc rax takes 1 byte\" should be corrected to reflect that it actually requires 3 bytes in x86_64.","author":{"url":"https://github.com/collectcrop","@type":"Person","name":"collectcrop"},"datePublished":"2025-02-26T13:18:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/329/algorithmica/issues/329"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7ddf917d-10e6-bfb4-6df1-907106905218 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 89C4:336295:840D1F:AEEBF3:697D2AF6 |
| html-safe-nonce | 3a5479dc6f1e27f37445582fe895f6f122ad6367bd6bdf1c040d6ad22601e0b9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OUM0OjMzNjI5NTo4NDBEMUY6QUVFQkYzOjY5N0QyQUY2IiwidmlzaXRvcl9pZCI6IjgyODA4NDkzOTgzMjE5ODIxOTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ee09663d5caee4b1215599f9f6ff1e23f34c8bf2348cfa142b47a8f1dac02d0b |
| hovercard-subject-tag | issue:2881577472 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/algorithmica-org/algorithmica/329/issue_layout |
| twitter:image | https://opengraph.githubassets.com/71874aea79c222cb3d8dedce3957fa27c9a410de029d5510d5160f930b3eda41/algorithmica-org/algorithmica/issues/329 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/71874aea79c222cb3d8dedce3957fa27c9a410de029d5510d5160f930b3eda41/algorithmica-org/algorithmica/issues/329 |
| og:image:alt | in section 2.6,you noted "something simple and very common like inc rax takes one byte". In the x86_64 architecture, the machine code for the inc rax instruction is actually \x48\xff\xc0 and inc ea... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | collectcrop |
| hostname | github.com |
| expected-hostname | github.com |
| None | 947d30920225f8abb17692477afd5992252045b901780d1bc8fa47c03b5fde64 |
| turbo-cache-control | no-preview |
| go-import | github.com/algorithmica-org/algorithmica git https://github.com/algorithmica-org/algorithmica.git |
| octolytics-dimension-user_id | 51334463 |
| octolytics-dimension-user_login | algorithmica-org |
| octolytics-dimension-repository_id | 333536823 |
| octolytics-dimension-repository_nwo | algorithmica-org/algorithmica |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 333536823 |
| octolytics-dimension-repository_network_root_nwo | algorithmica-org/algorithmica |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 92fcc0e25bb4da7fe9a458840cb7f3cafa272eb8 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width