Stdle #113 · arithmetic · 2026-09-27
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]! mov w8, #1234 mov w9, #0rev_loop: cbz w8, rev_done mov w10, #10 udiv w11, w8, w10 mul w12, w11, w10 sub w12, w8, w12 mov w10, #10 mul w9, w9, w10 add w9, w9, w12 mov w8, w11 b rev_looprev_done: sub sp, sp, #16 str x9, [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 __TEXT,__cstringfmt: .asciz "%d\n"Arithmetic