News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Why are there no AXL, AXH, AH2, or AL2 registers?

Started by sefaen, January 04, 2009, 06:04:40 AM

Previous topic - Next topic

sefaen

I was studying this diagram in the AoA book, and was just wondering why there aren't more 8-bit or 16-bit registers. Seems like there is room, but I have a tendency to overanalyze. I am also a novice.

I would guess, from what I have read thus far, that I could utilize the "upper parts" of a 32-bit register and use them for 8-bit or 16-bit data.

Like say:

EAX
0000 0001 0000 0000 0000 0000 0000 0000

I could say the value of the upper 8-bit portion of EAX (let's call it AH2) is one.
I am probably wrong, but just curious.

Rockoon

Not in a single instruction, no.

Part of the problem is the explosion in instructions that would result, essentialy requiring yet-another prefix byte used to toggle an instruction from using 'al' to using 'axl' (as you call it) ...

Now consider the registers for 64-bit modes, and you yet-again have another 4 bytes which arent uniquely addressable within a register so you need yet-another prefix byte of some kind, and lets not forget the additional 8 general purpose registers...

It would, however, have been nice to have been given a general-purpose-register equivilent to the sse swizzle instructions (it could have also replaced bswap in 64-bit mode)

Edited to add:

You need to remember that the original 8088 was designed to be binary compatable with the z80, which was designed to be backward compatible with the 8080, .. which is the only reason there was a method of accessing the second bytes of these registers.. the entire thing greatly complicates the instruction set.
When C++ compilers can be coerced to emit rcl and rcr, I *might* consider using one.

tenkey

Quote from: Rockoon on January 04, 2009, 08:14:26 AM
You need to remember that the original 8088 was designed to be binary compatable with the z80,

Not really. It was architecturally very similar, so that migration was relatively easy.


8080/Z80:

Binary   ASM
CD xxxx  CALL xxxx
C3 xxxx  JMP  xxxx
C9       RET

8086/8088:

Binary   ASM
E8 dddd  CALL xxxx
E9 dddd  JMP  xxxx
C3       RET
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8

Rockoon

woops.. for some reason I remember it differently...

hrm
When C++ compilers can be coerced to emit rcl and rcr, I *might* consider using one.

vanjast

It probably was never envisaged that the microprocessor would ever end up here, so no allowances for far future expansions were considered.

As an example, somewhere in the archives Bill Gates has been noted to say that "..we'd never need more than 756K (or something less than this) of Ram". - What a hoot.  :P
:8)

Rockoon

Quote from: vanjast on January 05, 2009, 11:04:00 PM
It probably was never envisaged that the microprocessor would ever end up here, so no allowances for far future expansions were considered.

As an example, somewhere in the archives Bill Gates has been noted to say that "..we'd never need more than 756K (or something less than this) of Ram". - What a hoot.  :P
:8)

http://en.wikiquote.org/wiki/Bill_Gates

Note what is in the Misattributed section.

This is what happens when people think that spreading their religion is more important than spreading facts.
When C++ compilers can be coerced to emit rcl and rcr, I *might* consider using one.

ttaylor

 :toothy That's one of my favorite all time quotes  :U

vanjast

Could be a rumour, or 'plausible deniability'...   :bg