Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 3.33 KB

README.md

File metadata and controls

47 lines (37 loc) · 3.33 KB

DOUBLE-EXT

Double cell integer manipulating extra words.

Words

Words definition table columns:

  • Name: A name of a word with optional parameters.
  • Imm.: Immediate - if a word is executed even if we are in the compilation mode.
  • Mode: I = interpretation mode only (not available during compilation), C = compilation mode only (not available during interpretation), IC = available in both modes.
  • Description: A word name, followed by the stack diagram - () = data stack, [] = return stack, {} = object stack - and description of the word itself.

Words (DOUBLE-EXT)

Name Imm. Mode Description
2ROT no IC Double rotate
(n1 n2 n3 n4 n5 n6 -- n3 n4 n5 n6 n1 n2)
Rotate the third pair on the stack to the top of the stack, moving down the first and the second pair.

Words (Extra)

Name Imm. Mode Description
>DOUBLE no IC String to number
( -- d true | false) {s -- }
Parses a string into a double cell integer. Leaves true and the number on the stack, if the conversion was successfull. Leaves just false, if the conversion failed.
D* no IC d3 = d1 * d2
(d1 d2 -- d3)
Multiplies d1 and d2 and leaves the product on the stack.
D/ no IC d3 = d1 / d2
(d1 d2 -- d3)
Divides d1 by d2 and leaves the quotient on the stack.
D<= no IC Less than or equal
(d1 d2 -- flag)
Returns -1 if d1 <= d2, 0 otherwise.
D<> no IC Not equal
(d1 d2 -- flag)
Returns -1 if d1 is not equal to d2, 0 otherwise.
D> no IC Greater than
(d1 d2 -- flag)
Returns -1 if d1 > d2, 0 otherwise.
D>= no IC Greater than or equal
(d1 d2 -- flag)
Returns -1 if d1 >= d2, 0 otherwise.
D0<> no IC Nonzero
(d1 -- flag)
Returns -1 if d1 is not equal to 0, 0 otherwise.
D0> no IC Greater than zero
(d1 -- flag)
Returns -1 if d1 is greater than 0, 0 otherwise.
D1+ no IC Add one
(d1 -- d2)
Adds one to the top of the stack.
D1- no IC Subtract one
(d1 -- d2)
Substracts one from the top of the stack.
D2+ no IC Add two
(d1 -- d2)
Adds two to the top of the stack.
D2- no IC Subtract two
(d1 -- d2)
Substracts two from the top of the stack.
DAND no IC Bitwise and
(d1 d2 -- d3)
Stores the bitwise AND of d1 and n2 on the stack.
DMOD no IC Modulus (remainder)
(d1 d2 -- d3)
The remainder when d1 is divided by d2 is left on the top of the stack.
D/MOD no IC d3 = d1 mod d2, d4 = d1 / d2
(d1 d2 -- d3 d4)
Divides d1 by d2 and leaves quotient on top of stack, remainder as next on stack.
DNOT no IC Bitwise not
(d1 -- d2)
Inverts the bits in the value on the top of the stack. This performs logical negation for truth values of −1 (True) and 0 (False).
DOR no IC Bitwise or
(d1 d2 -- d3)
Stores the bitwise or of d1 and d2 on the stack.
DXOR no IC Bitwise exclusive or
(d1 d2 -- d3)
Stores the bitwise exclusive or of d1 and d2 on the stack.

TODO

Words: DU<