← Back to archive

Stdle #58 · branching · 2026-08-03

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, #-16]!
mov w19, #1
mov w20, #10
1:
cmp w19, w20
bge 2f
add w19, w19, w19
b 1b
2:
sub sp, sp, #16
str x19, [sp]
adrp x0, fmt@PAGE
add x0, x0, fmt@PAGEOFF
bl _printf
add sp, sp, #16
ldp x29, x30, [sp], #16
mov w0, #0
ret
.section __TEXT,__cstring
fmt: .asciz "%d\n"
Branching
4 attempts left

Answer & explanation