Lab 3 Aarch64
It’s time for Aarch64 architecture. First of all, the basic code for print a message: .text .globl _start _start: mov x0, 1 /* file descriptor: 1 is stdout */ adr x1, msg /* message location (memory address) */ mov x2, len /* message length (bytes) */ mov x8, 64 /* write is syscall #64 */ svc 0 /* invoke syscall */ mov x0, 0 /* status -> 0 */ mov x8, 93 /* exit is syscall #93 */ svc 0 /* invoke syscall */ .data msg: .ascii "Loop: \n" len = . - msg /* message length */ This basically prints “Loop: \n”. Now, We’ll try to print 0-9, as we’ve done in x86_64 (but now, a little faster, as we know + or – what to do). First, to the loop, we start variables, as we done in x86_64: start = 0 /* starting value for the loop index; note that this is a symbol (constant), not a variabl