.file "readprintfloat.c" gcc2_compiled.: .section ".rodata" .align 8 .LLC0: .asciz "Enter a number >" .align 8 .LLC1: .asciz "%f" .align 8 .LLC2: .asciz "%10.5f\n" .section ".text" .align 4 .global main .type main,#function .proc 020 main: !#PROLOGUE# 0 save %sp,-120,%sp !#PROLOGUE# 1 sethi %hi(.LLC0),%o1 or %o1,%lo(.LLC0),%o0 call printf,0 nop ld [%fp-20],%f2 fstod %f2,%f4 std %f4,[%fp-16] ldd [%fp-16],%o2 sethi %hi(.LLC1),%o1 or %o1,%lo(.LLC1),%o0 mov %o2,%o1 mov %o3,%o2 call scanf,0 nop ld [%fp-20],%f2 fstod %f2,%f4 std %f4,[%fp-16] ldd [%fp-16],%o2 sethi %hi(.LLC2),%o1 or %o1,%lo(.LLC2),%o0 mov %o2,%o1 mov %o3,%o2 call printf,0 nop .LL1: ret restore .LLfe1: .size main,.LLfe1-main .ident "GCC: (GNU) 2.8.1" /* // File: readprintfloat.c // We can disassemble to see how to store and print a float #include void main() {float x; printf("Enter a number >"); scanf("%f",x); printf("%10.5f\n",x); } */