I am working on a compiled AArch64 assembly file of a "Hello World" program for Linux.
I have already successfully shortened it from 504 bytes down to 124 bytes.The only more "optimization" I can think of would be to find some instructions that perform two or more tasks in single instruction.
Currently the machine code in the file (represented in asm) is this:
mov x8, 64 // __NR_write
adr x1, hello //the string, I know the exact address
mov x2, 10 //string length (actually only "HelloWorld")
j:
mov x0, 0 // write to stdin happens to work
svc 0
mov x8, 93 // __NR_exit
b j //the branching saves me one instruction to exit with status = 0
Is there any instruction to shorten anything here?