There are some restrictions, and some differences in encoding.
rsp
(and esp
, etc) may not be used as an index register. There are many instructions which take arguments or return results in particular registers - for example, the variable shift instructions only take their argument in cl
.
The arithmetic instructions (and test
) have short encodings for rax
plus a 32-bit immediate:
8: 48 05 ff ff 00 00 add $0xffff,%rax
e: 48 81 c3 ff ff 00 00 add $0xffff,%rbx
I'm sure there are some other bits and pieces I can't bring to mind at the moment: consult the architecture manual for the gory details.