Stdle #149 · addressing · 2026-11-02
What does this Assembly snippet output?
A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
.global _main.align 2_main: stp x29, x30, [sp, #-48]! stp x19, x20, [sp, #16] adrp x19, arr@PAGE add x19, x19, arr@PAGEOFF mov w20, #0 mov w9, #5loop: cbz w9, done ldr w8, [x19], #4 add w20, w20, w8 sub w9, w9, #1 b loopdone: sub sp, sp, #16 str x20, [sp] adrp x0, fmt@PAGE add x0, x0, fmt@PAGEOFF bl _printf add sp, sp, #16 ldp x19, x20, [sp, #16] ldp x29, x30, [sp], #48 mov w0, #0 ret.section __DATA,__data.align 2arr: .long 1, 2, 3, 4, 5.section __TEXT,__cstringfmt: .asciz "%d\n"Addressing