I'm just getting into learning assembly code and I have a couple of questions concerning this snippet. Assume %r8 is an array of chars, %r9 is an array of integers and %r10 is an array of long integers.
test:
mov $128, %axh
movzx $128, %bx
movq $64, 4(%r8)
movd $255, 4(%r9)
movq $255, 8(%r9)
movq $0xFFFFFFFF, 8(%r10)
mov %ah, (%r8)
movq $55, (%r8)
ret
First of all, does the register %axh exist or is this a typo for %ah?
Secondly, they do a movq of 64 into index 4 of array %r8. But I learned earlier that chars are represented in 8 bits tops, but a movq moves a 64 bit value (correct?). The same happens for index 8 of array %r9. This is confusing to me, because the bits stored exceed the total bits needed for these datatypes.
Finally, I wonder why ret is called since there is no 'return' register at play here. Or does an assembly process always return, even if it returns nothing?