Stdle #129 · addressing · 2026-10-13
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, #-32]! adrp x8, arr@PAGE add x8, x8, arr@PAGEOFF mov x9, #1 ldr w10, [x8, x9, lsl #2] add x9, x9, #1 ldr w12, [x8, x9, lsl #2] add w10, w10, w12 sub sp, sp, #16 str x10, [sp] adrp x0, fmt@PAGE add x0, x0, fmt@PAGEOFF bl _printf add sp, sp, #16 ldp x29, x30, [sp], #32 mov w0, #0 ret.section __DATA,__data.align 2arr: .long 10, 20, 30, 40.section __TEXT,__cstringfmt: .asciz "%d\n"Addressing