Earlier quoted context omitted.
Of course - you are completely right, an oversight in wanting to correct my mistake as quickly as possible. With that fixed, is there any reason not to use push here?
Yes, because: push 1 ; 6A 01 (2 bytes) pop rdi ; 5F (1 byte) is longer than a simple: mov edi, eax ; 89 C7 (2 bytes)
But even if it was 32 bit, then we would't have to copy a 1, since the syscall number for sys_write would be 4 instead of 1.
I get the same total size with both variants in 64 bit mode.
push 1
pop rax
mov rdi, rax
Assembling to 48 89 C7 (3 bytes)seems to be same in size as
push 1
pop rax
push 1
pop rdi
Assembling to 6A 01 5F (3 bytes)