From 1e325fa7d885c55b8dd4dc9a74be2518173933e3 Mon Sep 17 00:00:00 2001 From: Perry Kivolowitz Date: Thu, 21 Jul 2022 11:11:09 -0500 Subject: [PATCH] more source code for the chapter --- section_1/float/frintp.s | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 section_1/float/frintp.s diff --git a/section_1/float/frintp.s b/section_1/float/frintp.s new file mode 100644 index 0000000..53a78cb --- /dev/null +++ b/section_1/float/frintp.s @@ -0,0 +1,28 @@ + .text + .global main + .align 2 + +main: str x30, [sp, -16]! + + ldr x0, =d + ldr d0, [x0] + frintp d0, d0 + ldr x0, =fmt1 + bl printf + + ldr x0, =h + ldr d0, [x0] + frintp d0, d0 + ldr x0, =fmt2 + bl printf + + ldr x30, [sp], 16 + mov w0, wzr + ret + + .data +fmt1: .asciz "with fraction: %f\n" +fmt2: .asciz "without fraction: %f\n" +d: .double 5.00000001 +h: .double 5.0 + .end