summaryrefslogtreecommitdiff
path: root/tests/fixtures/radd-pi.s
blob: 2921d914a980a72f28edbeed9d5bf092495d8a58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
; High-precision real arithmetic example.
;
; Build/run from examples/:
;   ../utils/mcpu-as -o radd-pi.o radd-pi.s
;   ../utils/mcpu-ld --stack-size=512 -o radd-pi radd-pi.o
;   ../utils/mcpu-run --digits=60 --real-reg=r4096@0x00400 radd-pi
;
; Expected output starts with:
;   5.14159265358979323846264338327950288419716939937510582097
;
.data

.align 16
result:
        .real 4096, 0.0

.text
_start_life:

        LDR     r4096@0x00000, 2.0
        RCONST  r4096@0x00200, PI
        RADD    r4096@0x00400, r4096@0x00000, r4096@0x00200
        STORE   result, r4096@0x00400
        HALT