DOUBLE-EXT --- The Optional Double Number Word Set
Copyright (C) Tektronix, Inc. 1998 - 2001. All rights reserved.
description: Double Numbers use two cells per number.
The forth text interpreter' number is conversion is changed to see numbers immediatly followed by a decimal point as a two-cell number. Entering decimal 1234 leaves a single-cell number 1234 on the stack, and entering decimal 1234. leaves the double cell number 1234 0 on the stack.
FORTH
2CONSTANT
( x1 x2 "name" -- )( | ) ; |
; |
create a word that contains the specified twocell number in its body. when the name is executed, these numbers are left on the stack
12. 2CONSTANT X .s <emtpy stack> ok X .s 0 12 ok
dpANS 8.6.1.0360 - standard forth word
FORTH
2VARIABLE
( -- )(
)
;
p4:"two-variable";
CREATE a new variable definition. When executed leave the >BODY address on stack. In pfe, the data area of a 2VARIABLE is ERASEd initially.
dpANS 8.6.1.0440 - standard forth word
FORTH
2LITERAL
( x1 x2 -- )immediate( | ) ; |
; |
compile a double-cell number to the current definition. When run, the doubele-cell is left on the stack for execution.
( -- x1 x2 )
(in most configurations this word is statesmart and it will do nothing in interpret-mode. See 2LITERAL, for a non-immediate variant)
dpANS 8.6.1.0390 - standard forth word
FORTH
D+
( d1.ud1 d2.ud2 -- d3.ud3 )( | ) ; |
; |
the double-cell sum operation ( + )
dpANS 8.6.1.1040 - standard forth word
FORTH
D-
( .. )(
)
;
as:"d-minus";
ordinary primitive D-
an executable word (no special usage info)
or wrapper call around p4_d_minus
dpANS 8.6.1.1050 - standard forth word
FORTH
D.
( d1.d1 -- )(
)
;
p4:"d-dot";
freefield output for a double-cell number ( . )
dpANS 8.6.1.1060 - standard forth word
FORTH
D.R
( d1.d1 n -- )(
)
;
p4:"d-dot-r";
aligned output for a double-cell number ( .R )
dpANS 8.6.1.1070 - standard forth word
FORTH
D0<
( d1.d1 -- flag )(
)
;
p4:"d-zero-less";
the double-cell less-than-zero operation ( 0< )
FORTH
D0=
( d1.d1 -- flag )(
)
;
p4:"d-zero-equals";
the double-cell equal-to-zero operation ( 0= )
dpANS 8.6.1.1080 - standard forth word
FORTH
D2*
( d1.d1 -- d1.d1' )(
)
;
p4:"d-two-star";
the double-cell arithmetic shiftleft-by-1 operation ( 2* )
dpANS 8.6.1.1090 - standard forth word
FORTH
D2/
( d1.d1 -- d1.d1' )(
)
;
p4:"d-two-slash";
the double-cell arithmetic shiftright-by-1 operation ( 2/ )
dpANS 8.6.1.1100 - standard forth word
FORTH
D<
( d1.d1 d2.d2 -- flag )(
)
;
p4:"d-less";
the double-cell is-less operation ( < )
FORTH
D=
( d1.d1 d2.d2 -- flag )(
)
;
p4:"d-equals";
the double-cell is-equal operation ( = )
dpANS 8.6.1.1120 - standard forth word
FORTH
D>S
( d.d -- n )(
)
;
p4:"d-to-s";
result is the numeric equivalent of d. If the double number was greater than what could fit into a single cell number, the modulo cellsize will be left since the higher-significant bits are just DROPed
FORTH
DABS
( d1.d1 -- d1.d1' )(
)
;
p4:"d-abs";
the double-cell abs operation ( ABS )
dpANS 8.6.1.1160 - standard forth word
FORTH
DMAX
( d1.d1 d2.d2 -- d1.d1|d2.d2 )( | ) ; |
; |
the double-cell max operation ( MAX )
dpANS 8.6.1.1210 - standard forth word
FORTH
DMIN
( d1.d1 d2.d2 -- d1.d1|d2.d2 )( | ) ; |
; |
the double-cell max operation ( MIN )
dpANS 8.6.1.1220 - standard forth word
FORTH
DNEGATE
( d1.d1 -- d1.d1' )( | ) ; |
; |
the double-cell arithmetic negate operation ( NEGATE )
dpANS 8.6.1.1230 - standard forth word
FORTH
M*/
( d1.d1 n1 +n2 -- d2.d2 )( | ) ; |
; |
the double-cell multiply-divide operation using a triple-cell intermediate result for * ( *\/ )
dpANS 8.6.1.1820 - standard forth word
FORTH
M+
( d1.d1 n1 -- d2.d2 )(
)
;
p4:"m-plus";
the double-cell mixed-operand sum operation ( + / D+ )
dpANS 8.6.1.1830 - standard forth word
ENVIRONMENT
DOUBLE-EXT
( .. )(
)
;
as:"double-minus-ext";
( 1994 ) constant DOUBLE-EXT
an ordinary constant (no special usage info)
ENVIRONMENT
MAX-D
( .. )(
)
;
as:"max-minus-d";
ordinary primitive MAX-D
an executable word (no special usage info)
or wrapper call around p__max_d
ENVIRONMENT
MAX-UD
( .. )(
)
;
as:"max-minus-ud";
ordinary primitive MAX-UD
an executable word (no special usage info)
or wrapper call around p__max_ud