← Back to archive

Stdle #12 · floats · 2026-06-18

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]!
fmov d0, #3.5
fmov d1, #1.5
fsub d0, d0, d1
sub sp, sp, #16
str d0, [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,__cstring
fmt: .asciz "%g\n"
Floats
4 attempts left

Answer & explanation