Does a1 / x11 keep its old argument value after a call?
Do not assume so. a0-a7 are not preserved across calls, and the callee may overwrite them.
One of the a0-a7 integer argument registers; the psABI also uses a1 for return values. It is not preserved across calls.
The standard psABI uses a0-a7 as argument registers, with only a0-a1 also used for return values. They are not preserved across calls.
a1 / x11 belongs to the a0-a7 argument-register group. The psABI uses a0-a7 for arguments and a0-a1 for return values; these registers are not preserved across calls.
The psABI marks a0-a7 as not preserved across calls.
a0 / a1 are the first two argument registers that the psABI also uses for return values; after a call, do not assume they retain old arguments.
For a scalar of at most XLEN bits, the psABI passes it by value on the stack when no argument register is available.
addi a1, zero, 3 # write a1
# The psABI also uses a1 for return valuesDo not assume so. a0-a7 are not preserved across calls, and the callee may overwrite them.
The psABI uses a0-a1 for return values as well as arguments.