When passing less than 64 bit integer in 64 bit register, what should rest of bits be?
edit: I found very similar question: https://groups.google.com/g/x86-64-abi/c/h7FFh30oS3s/m/Gksanh3WAAAJ
- I want to call
void myfunc(unsigned short arg);
with(unsigned short)0b1010101010101010
argument. - Page 26 of https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs/6235340483/artifacts/file/x86-64-ABI/abi.pdf says
2. If the class is INTEGER, the next available register of the sequence %rdi, %rsi, %rdx, %rcx, %r8 and %r9 is used19.
- Argument should be in %rdi.
-
%rdi is 64 bits,
(unsigned short)0b1010101010101010
is 16 bits,%rdi: ????????????????????????????????????????????????1010101010101010 \______________________________________________/ What should these bits be?
Edited by BZZZZ