# ===============================================================
# RARS 64-bit mode
#
# to set RARS to 64-bit mode: settings -> 64 bit
=================================================================
# load floating-point double values
# add  floating-point double values
# ===============================================================
# code found on the web
# ===============================================================

.data

# Define 64-bit double-precision floating-point values

pi:       .double 3.141592653589793
my_val:   .double 2.718281828459045

.text
.globl main
main:

    # Load the address of 'pi' into a general-purpose register (t0)

    la t0, pi

    # Load the 64-bit double value from memory into floating-point
    # register ft0

    fld ft0, 0(t0)

    # Load the address of 'my_val' into t1

    la t1, my_val

    # Load the second double value into ft1

    fld ft1, 0(t1)

    # Perform double-precision addition: ft2 = ft0 + ft1

    fadd.d ft2, ft0, ft1

    # Exit program (system call example)

    li a7, 93
    li a0, 0
    ecall