0

I haven't done assembly language programming for a decade or so, and the last time I did it was in school, but I really wanted to get a better grasp on the internals of x86 architecture (and computer organization in general), so I am trying to understand now how the granular access to 32-bit & 64-bit general purpose registers could happen. I've only had some experience with 16-bit registers (assembly in DOS), and that was easy. E.g.

AX ~ |AL|AH|

But what about EAX? Would something like this be legit?

EAX ~ |AL|AH|EAL|EAH|

Everywhere I looked it was just a simple

EAX ~ |AL|AH| EAX |

Not to mention 64-bit registers:

RAX ~ |AL|AH| EAX |    RAX    |
Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
wintermute
  • 488
  • 1
  • 9
  • 22
  • 4
    X86 doesn't allow you to address individual bytes through a register in the upper 16-bit of a 32-bit register (like EAX). and upper 48-bits of a 64-bit register (like RAX). – Michael Petch Dec 04 '17 at 06:37
  • @MichaelPetch thank you. Just out of curiosity, was there a specific reasoning behind that decision? – wintermute Dec 04 '17 at 06:46
  • 1
    This answer might be of use: https://stackoverflow.com/a/45502300/3857942 in response to your question – Michael Petch Dec 04 '17 at 07:03
  • 1
    personal design choice, you would have to ask the individuals at intel directly if you can find them and they are willing to talk. wouldnt make much sense, decades ago when this processor family entered in an 8 bit world with a 16 bit processor having this 8/16 notion. A while later transitioning from 16 to 32, doesnt make sense to keep this up on a microcoded (CISC) processor, would have not been a surprise to get rid of ah/al and just have EAX then later get rid of EAX for RAX. But they didnt. my understanding is the legacy support is painful for performance. – old_timer Dec 04 '17 at 11:48
  • 1
    At the same time legacy support is perhaps one reason why wintel continues to have any kind of market share. – old_timer Dec 04 '17 at 11:49

0 Answers0