Pelles C forum
Assembly language => Assembly discussions => Topic started by: HellOfMice on January 24, 2025, 09:37:22 AM
-
Going to 64 bits we loose 4/2 registers
Look at:
MOV CH,127 ; No error
MOV DIL,254 ; No Error
MOV AL,CH ; No Error
MOV DL,DIL ; No Error
MOV CH,DIL ; Forbidden !
In this instruction we suppose that REX = 0 so the use of DIL is forbidden
Idem for AH/SPL CH/BPL DH/SIL & BH/DIL
SPL, BPL, SIL and DIL have a 40h prefix (REX)
AH & SPL have the same opcode except that SPL has a REX prefix
The REX prefix allows to use 64 bits properties
I thought it was funny
A+
Philippe
-
Maybe using a third register as a helper?
MOV DL,DIL
MOV CH,DL
-
Yes in 64 bit mode, we have no choice
-
Going to 64 bits we loose 4/2 registers
Look at:
MOV CH,127 ; No error
MOV DIL,254 ; No Error
MOV AL,CH ; No Error
MOV DL,DIL ; No Error
MOV CH,DIL ; Forbidden !
In this instruction we suppose that REX = 0 so the use of DIL is forbidden
Idem for AH/SPL CH/BPL DH/SIL & BH/DIL
SPL, BPL, SIL and DIL have a 40h prefix (REX)
AH & SPL have the same opcode except that SPL has a REX prefix
The REX prefix allows to use 64 bits properties
I thought it was funny
A+
Philippe
This is one of those quirks introduced in x86-64 due to backward compatibility while expanding the register set.