TAL Reference Manual

Standard Functions
TAL Reference Manual526371-001
14-13
Examples of $DBLL Function
Examples of $DBLL Function
1. In this example, $DBLL returns an INT(32) value formed from two INT variables,
FIRST_INT and SECOND_INT:
INT first_int, second_int; !Declare variables
INT(32) some_double;
some_double := $DBLL (first_int, second_int);
!Return INT(32) value
2. In this example, $DBLL returns an extended (32-bit) address from two INT
constants that represent a standard (16-bit) address in the current user code
segment:
INT .EXT p; !Declare 32-bit simple
! pointer
@p := ($DBLL (2, 7)) '<<' 1; !Return 32-bit address in
! user code segment
$DBLR Function
The $DBLR function returns an INT(32) value from an INT, FIXED(0), REAL, or
REAL(64) expression and applies rounding to the result.
expression
is an INT, FIXED(0), REAL, or REAL(64) expression.
Usage Consideration
If expression is too large in magnitude to be represented by a 32-bit two’s complement
integer, $DBLR sets the overflow indicator.
Examples of $DBLR Function
1. In this example, $DBLR returns a rounded INT(32) value from a REAL expression:
REAL r2 := 1.5e0; !Declare variables
INT(32) b32;
b32 := $DBLR (r2); !Return 2D
$DBLR ( expression
)
VST1409.vsd