.
clm$longreal_arithmetic         IDENT
.
.
.  PURPOSE:
.    This module contains functions that call standard math library
.    functions.  These functions simply load the arguments from the
.    CYBIL parameter list into the appropriate registers and call the
.    corresponding math library function.
.
.
.  Parameter list offsets:
.
left                            equ       0
right                           equ       8
.
.
.  External reference definitions for math library functions:
.
                                use       binding
.
                                ref       mlp$vdtod
dtod                            address   c,mlp$vdtod
.
                                ref       mlp$vdtoi
dtoi                            address   c,mlp$vdtoi
.
                                ref       mlp$vitod
itod                            address   c,mlp$vitod
.
                                ref       mlp$vitoi
itoi                            address   c,mlp$vitoi
.
                                use code
.
                                page
.
. ----------------------------------------------------------------------------
.
. FUNCTION [XDCL] clp$dtod
.   (    left {input} : longreal;
.        right: longreal): longreal;
.
. ----------------------------------------------------------------------------
.
.
clp$dtod                        align     0,8
                                def       clp$dtod
.
                                la        ae,a4,left
                                lbyts,8   x2,ae,x0,0
                                lbyts,8   x3,ae,x0,8
.
                                la        ac,a4,right
                                lbyts,8   x4,ac,x0,0
                                lbyts,8   x5,ac,x0,8
.
                                ente      x0,0040(16)
                                callseg   dtod,a3,a4
.
                                return
.
                                page
.
. ----------------------------------------------------------------------------
.
. FUNCTION [XDCL] clp$dtoi
.   (    left: longreal;
.        right: integer): longreal;
.
. ----------------------------------------------------------------------------
.
.
clp$dtoi                        align     0,8
                                def       clp$dtoi
.
                                la        ae,a4,left
                                lbyts,8   x2,ae,x0,0
                                lbyts,8   x3,ae,x0,8
.
                                lx        x4,a4,right
.
                                ente      x0,0040(16)
                                callseg   dtoi,a3,a4
.
                                return
.
                                page
.
. ----------------------------------------------------------------------------
.
. FUNCTION [XDCL] clp$itod
.   (    left: integer;
.        right: longreal): longreal;
.
. ----------------------------------------------------------------------------
.
.
clp$itod                        align     0,8
                                def       clp$itod
.
                                lx        x2,a4,left
.
                                la        ac,a4,right
                                lbyts,8   x3,ac,x0,0
                                lbyts,8   x4,ac,x0,8
.
                                ente      x0,0040(16)
                                callseg   itod,a3,a4
.
                                return
.
                                page
.
. ----------------------------------------------------------------------------
.
. FUNCTION [XDCL] clp$itoi
.   (    left: integer;
.        right: integer): integer;
.
. ----------------------------------------------------------------------------
.
.
clp$itoi                        align     0,8
                                def       clp$itoi
.
                                lx        x2,a4,left
.
                                lx        x3,a4,right
.
                                ente      x0,0040(16)
                                callseg   itoi,a3,a4
.
                                return
.
                                end
