I have a byte-array of characters declared in .data
chars db 'spipopd'
and I have set rdi to point to the base index of this array
mov rdi, chars
At some point, I want to put a character from the array into an 8-bit register. The first statement below produces a valid value, but the second one causes r9b to contain void upon entering the gdb command print $r9b.
mov al, [rdi] ; produces valid value in gdb
mov r9b, [rdi] ; r9b = void, according to gdb
Any of the register r8b to r15b has the same effect. As I understand, both al and r9b are 8-bit, so why does one work, and the other doesn't? My hunch is that, although they are both 8-bit in size, they have some subtle differences that elude me.
The Intel documentation states:
"REX prefixes are used to generate 64-bit operand sizes or reference registers R8-R15."
Is this related to my problem?