* Data: nn-n Addr: - Float: - Multiply `n1` by `n2` and return the result. Class: class:primitive | Namespace: global | Interface Layer: all Example #1: #2 #6 * #-1 #100 * + Data: nn-n Addr: - Float: - Add `n1` to `n2` and return the result. Class: class:primitive | Namespace: global | Interface Layer: all Example #1: #1 #2 + , Data: n- Addr: - Float: - Store the specified value into the memory at `here` and increment `Heap` by 1. Class: class:word | Namespace: global | Interface Layer: all Example #1: $a , $b , $c , #0 , - Data: nn-n Addr: - Float: - Subtract `n2` from `n1` and return the result. Class: class:primitive | Namespace: global | Interface Layer: all Example #1: #2 #1 - ---reveal--- Data: - Addr: - Float: - Switch to the exposed (public) portion of a lexical namespace. Class: class:word | Namespace: global | Interface Layer: all -eq? Data: nn-f Addr: - Float: - Compare two values for inequality. Returns `TRUE` if they are not equal or `FALSE` otherwise. Class: class:primitive | Namespace: global | Interface Layer: all Example #1: #1 #2 -eq? $a $b -eq? -if Data: fq- Addr: - Float: - Execute the quotation if the flag is `FALSE`. Class: class:word | Namespace: global | Interface Layer: all /mod Data: nm-rv Addr: - Float: - Divide `n` by `m` and return the integer part of the quotient and remainder. Class: class:primitive | Namespace: global | Interface Layer: all 0; Data: n-n || n- Addr: - Float: - If `n` is zero, drop `n` and exit the current word. If non-zero, leave `n` alone and allow execution to continue. Class: class:macro | Namespace: global | Interface Layer: all ; Data: - Addr: - Float: - End the current definition. Class: class:macro | Namespace: global | Interface Layer: all ASCII:ESC Data: -n Addr: - Float: - Constant. Refers to specific ASCII code. Class: class:data | Namespace: ASCII | Interface Layer: all I Data: -n Addr: - Float: - Access the loop index for the current loop. (For loops made using `indexed-times`) Class: class:word | Namespace: global | Interface Layer: all TRUE Data: -n Addr: - Float: - Returns `-1`, the value used to indicate a TRUE result. Class: class:word | Namespace: global | Interface Layer: all [ Data: - Addr: - Float: - Begin a quotation. Class: class:macro | Namespace: global | Interface Layer: all ] Data: - Addr: - Float: - End a quotation. Class: class:macro | Namespace: global | Interface Layer: all a:for-each Data: aq- Addr: - Float: - Execute the quote once for each item in the array. Class: class:word | Namespace: a | Interface Layer: all again Data: - Addr: - Float: - Close an unconditional loop. Branches back to the prior `repeat`. Class: class:macro | Namespace: global | Interface Layer: all allot Data: n- Addr: - Float: - Allocate the specified number of cells from the `Heap`. Class: class:word | Namespace: global | Interface Layer: all Example #1: 'Buffer d:create #100 allot bi Data: xqq-? Addr: - Float: - Execute q1 against x, then execute q2 against a copy of x. Class: class:word | Namespace: global | Interface Layer: all Example #1: #100 [ #10 * ] [ #10 - ] bi bi@ Data: xyq-? Addr: - Float: - Execute q against x, then execute q against y. Class: class:word | Namespace: global | Interface Layer: all Example #1: #10 #20 [ #3 * ] bi@ block:read Data: na- Addr: - Float: - Read 1024 cells from block n in the block storage into memory at address a. Class: class:word | Namespace: block | Interface Layer: rre block:write Data: na- Addr: - Float: - Save the 1024 cells at address a to block n in the block storage. Class: class:word | Namespace: block | Interface Layer: rre buffer:add Data: n- Addr: - Float: - Append a value to the current buffer. Class: class:word | Namespace: buffer | Interface Layer: all buffer:preserve Data: q- Addr: - Float: - Save and restore the current buffer before and after executing the specified quote. Class: class:word | Namespace: buffer | Interface Layer: all buffer:set Data: a- Addr: - Float: - Assign a new buffer as the current one. Class: class:word | Namespace: buffer | Interface Layer: all c:get Data: -c Addr: - Float: - Vectored. Read a single keypress. Class: class:word | Namespace: global | Interface Layer: rre c:put Data: c- Addr: - Float: - Vectored. Display a single character. Class: class:word | Namespace: global | Interface Layer: all call Data: a- Addr: - Float: - Call a function. Class: class:primitive | Namespace: global | Interface Layer: all choose Data: fqq- Addr: - Float: - Execute q1 if the flag is true (-1) or q2 if the flag is false (0). Only these flags are valid when using `choose`; passing other values as flags will result in memory corruption. Class: class:word | Namespace: global | Interface Layer: all const Data: ns- Addr: - Float: - Create a constant returning the specified value. Class: class:word | Namespace: global | Interface Layer: all copy Data: sdl- Addr: - Float: - Copy `l` cells from memory at `s` to the memory at `d`. These should not overlap. Class: class:word | Namespace: global | Interface Layer: all d:create Data: s- Addr: - Float: - Hook. Create a new dictionary header named the specified string. The new header will point to `here` and have a class of `class:data`. Class: class:word | Namespace: d | Interface Layer: all d:lookup Data: s-d Addr: - Float: - Lookup the specified name in the dictionary and return a pointer to its dictionary header. This returns zero if the word is not found. This also sets an internal variable ('which' in retro.muri) to the header address. Class: class:word | Namespace: d | Interface Layer: all d:xt Data: d-a Addr: - Float: - Given a dictionary header, return the xt field. Class: class:word | Namespace: d | Interface Layer: all dip Data: nq-n Addr: - Float: - Temporarily remove n from the stack, execute the quotation, and then restore n to the stack. Class: class:word | Namespace: global | Interface Layer: all drop Data: n- Addr: - Float: - Discard the top value on the stack. Class: class:primitive | Namespace: global | Interface Layer: all drop-pair Data: nn- Addr: - Float: - Remove top two items on the stack. Class: class:word | Namespace: global | Interface Layer: all dump-stack Data: - Addr: - Float: - Display the items on the data stack. Class: class:word | Namespace: global | Interface Layer: all dup Data: n-nn Addr: - Float: - Duplicate the top item on the stack. Class: class:primitive | Namespace: global | Interface Layer: all dup-pair Data: nm-nmnm Addr: - Float: - Duplicate the top two items on the stack. Class: class:word | Namespace: global | Interface Layer: all eq? Data: nn-f Addr: - Float: - Compare two values for equality. Returns `TRUE` if they are equal or `FALSE` otherwise. Class: class:primitive | Namespace: global | Interface Layer: all Example #1: #1 #2 eq? $a $b eq? fetch Data: a-n Addr: - Float: - Fetch the value stored at the specified address. Class: class:primitive | Namespace: global | Interface Layer: all Example #1: &Version fetch fetch-next Data: a-an Addr: - Float: - Fetch the value stored at the specified address. Returns the next address and the value. Class: class:word | Namespace: global | Interface Layer: all file:R Data: -n Addr: - Float: - Constant for opening a file in READ mode. Class: class:data | Namespace: file | Interface Layer: rre file:close Data: h- Addr: - Float: - Given a file handle, close the file. Class: class:word | Namespace: file | Interface Layer: rre file:delete Data: s- Addr: - Float: - Delete the named file. Class: class:word | Namespace: file | Interface Layer: rre file:exists? Data: s-f Addr: - Float: - Given a file name, return `TRUE` if it exists or `FALSE` if it does not. Class: class:word | Namespace: file | Interface Layer: rre file:open-for-reading Data: s-nn Addr: - Float: - Open a file for reading. Returns the size (NOS) and a file ID (TOS) Class: class:word | Namespace: file | Interface Layer: rre file:open-for-writing Data: s-n Addr: - Float: - Open a file for writing. Returns the file ID Class: class:word | Namespace: file | Interface Layer: rre file:read Data: h-c Addr: - Float: - Given a file handle, read and return the next character in it. Class: class:word | Namespace: file | Interface Layer: rre file:slurp Data: as- Addr: - Float: - Given an address and a file name, read the file contents into memory starting at the address. Class: class:word | Namespace: file | Interface Layer: rre file:spew Data: ss- Addr: - Float: - Given a string (s1) and a file name (s2), write the string into the file, replacing any existing content. Class: class:word | Namespace: file | Interface Layer: rre file:write Data: ch- Addr: - Float: - Write a character to the file represented by the handle. Class: class:word | Namespace: file | Interface Layer: rre gt? Data: nn-f Addr: - Float: - Compare n1 and n2. Return `TRUE` if n1 is greater than n2, or `FALSE` otherwise. Class: class:primitive | Namespace: global | Interface Layer: all here Data: -a Addr: - Float: - Return the next free address in memory. Class: class:word | Namespace: global | Interface Layer: all hook Data: - Addr: - Float: - Add a hook point into the current word. This should only be used as the first word in a definition. Class: class:macro | Namespace: global | Interface Layer: global Example #1: :foo hook ; Example #2: :bar hook (default_action: n:square n:put nl ; if Data: fq- Addr: - Float: - Execute the quote if the flag is `TRUE`. Class: class:word | Namespace: global | Interface Layer: all indexed-times Data: nq- Addr: - Float: - Run a quote the specified number of times, tracking the loop index in `I`. This is less efficient than `times`, so if the index is not needed, this should be avoided. Class: class:word | Namespace: global | Interface Layer: all interpret Data: s- Addr: - Float: - Vectored. Interpret a single input token. Class: class:word | Namespace: global | Interface Layer: all Example #1: '#100 interpret 'words interpret lt? Data: nn-f Addr: - Float: - Compare n1 and n2. Return `TRUE` if n1 is less than n2, or `FALSE` otherwise. Class: class:primitive | Namespace: global | Interface Layer: all mod Data: nm-o Addr: - Float: - Divide `n` by `m` and return the remainder. Class: class:word | Namespace: global | Interface Layer: all n:-zero? Data: n-f Addr: - Float: - Return `TRUE` if number is not zero, or `FALSE` otherwise. Class: class:word | Namespace: n | Interface Layer: all n:dec Data: n-m Addr: - Float: - Decrement n by one. Class: class:word | Namespace: n | Interface Layer: all Example #1: #100 n:dec n:inc Data: n-m Addr: - Float: - Increment n by one. Class: class:word | Namespace: n | Interface Layer: all Example #1: #100 n:inc n:limit Data: nlu-m Addr: - Float: - Return n if it is within the lower (l) and upper (u) bounds. If outside the bounds, return the closes boundary value. Class: class:word | Namespace: n | Interface Layer: all Example #1: #-10 #5 #8 n:limit #10 #1 #15 n:limit n:put Data: n- Addr: - Float: - Display a number. Class: class:word | Namespace: global | Interface Layer: all n:zero? Data: n-f Addr: - Float: - Return `TRUE` if number is zero, or `FALSE` otherwise. Class: class:word | Namespace: n | Interface Layer: all nl Data: - Addr: - Float: - Display a newline. Class: class:word | Namespace: global | Interface Layer: all over Data: nm-nmn Addr: - Float: - Put a copy of n over m. Class: class:word | Namespace: global | Interface Layer: all repeat Data: - Addr: - Float: - Begin an unconditional loop. Class: class:macro | Namespace: global | Interface Layer: all s:chop Data: s-s Addr: - Float: - Remove the last character from a string. Returns a new string. Class: class:word | Namespace: s | Interface Layer: all s:const Data: ss- Addr: - Float: - Create a constant named s2, returning a pointer to s1. This will use `s:keep` to preserve the original string. Class: class:word | Namespace: s | Interface Layer: all s:format Data: ...s-s Addr: - Float: - Construct a new string using the template passed and items from the stack. Class: class:word | Namespace: s | Interface Layer: all s:get Data: -s Addr: - Float: - Read input from standard in (via `c:get`) until a CR or LF is encountered. Returns a string. Class: class:word | Namespace: all | Interface Layer: rre s:length Data: s-n Addr: - Float: - Return the number of characters in a string, excluding the NULL terminator. Class: class:word | Namespace: s | Interface Layer: all s:put Data: s- Addr: - Float: - Display a string. Class: class:word | Namespace: global | Interface Layer: all s:temp Data: s-s Addr: - Float: - Move a string into the temporary string buffers. Class: class:word | Namespace: s | Interface Layer: all s:tokenize Data: sc-a Addr: - Float: - Takes a string and a character to use as a separator. It splits the string into substrings and returns an array containing pointers to each of them. Class: class:word | Namespace: s | Interface Layer: all set-hook Data: aa- Addr: - Float: - Patch the hook point in a2 to point to a1. Class: class:word | Namespace: global | Interface Layer: all Example #1: :foo hook ; :bar #1 ; &bar &foo set-hook sip Data: nq(?n-?)-n Addr: - Float: - Run quote. After execution completes, put a copy of n back on top of the stack. Class: class:word | Namespace: global | Interface Layer: all store Data: na- Addr: - Float: - Store a value into the specified address. Class: class:primitive | Namespace: global | Interface Layer: all Example #1: 'Base var #10 &Base store swap Data: nm-mn Addr: - Float: - Exchange the position of the top two items on the stack Class: class:primitive | Namespace: global | Interface Layer: all times Data: nq- Addr: - Float: - Run the specified quote the specified number of times. Class: class:word | Namespace: global | Interface Layer: all Example #1: #12 [ $- c:put ] times unhook Data: a- Addr: - Float: - Reset the hook point in a1 to the default definition. Class: class:word | Namespace: global | Interface Layer: all Example #1: :foo hook #1 ; :bar #2 ; &bar &foo set-hook &foo unhook unix:exit Data: n- Addr: - Float: - Exit the current process, returning the specified return code. Class: class:word | Namespace: unix | Interface Layer: rre unix:pclose Data: n- Addr: - Float: - Close a pipe. Class: class:word | Namespace: unix | Interface Layer: rre unix:popen Data: sn-n Addr: - Float: - Open a pipe. Takes a command to run, and a file mode (`file:R` or `file:W`; `file:R+` may work on some systems). Returns a file ID usable with words in the `file:` namespace. Class: class:word | Namespace: unix | Interface Layer: rre unix:system Data: s- Addr: - Float: - Runs another application using the system shell and returns after execution is completed. Class: class:word | Namespace: unix | Interface Layer: rre Example #1: 'ls_-lh_/etc unix:system until Data: q(-f)- Addr: - Float: - Execute quote repeatedly while the quote returns a value of `FALSE`. The quote should return a flag of either `TRUE` or `FALSE`, though `until` will treat any non-zero value as `TRUE`. Class: class:word | Namespace: global | Interface Layer: all Example #1: #10 [ dup n:put nl n:dec dup n:zero? ] until v:dec Data: a- Addr: - Float: - Decrement the value stored at the specified address by 1. Class: class:word | Namespace: v | Interface Layer: all v:inc Data: a- Addr: - Float: - Increment the value stored at the specified address by 1. Class: class:word | Namespace: v | Interface Layer: all v:limit Data: alu- Addr: - Float: - Fetch the value stored at the address, then run `n:limit` against it, using the specified lower and upper bounds. Then store the resulting value back to the original address. Class: class:word | Namespace: v | Interface Layer: all v:preserve Data: aq- Addr: - Float: - Make a copy of the value at the address, then run the quote. Once the quote completes, restore the address to the specified value. Class: class:word | Namespace: v | Interface Layer: all var Data: s- Addr: - Float: - Create a variable. The variable is initialized to 0. Class: class:word | Namespace: global | Interface Layer: all Example #1: 'Base var var-n Data: ns- Addr: - Float: - Create a variable with the specified initial value. Class: class:word | Namespace: global | Interface Layer: all Example #1: #10 'Base var-n {{ Data: - Addr: - Float: - Begin a lexically scoped area. Class: class:word | Namespace: global | Interface Layer: all } Data: -a Addr: - Float: - Complete an array begun by `{`. Returns a pointer to the data. Class: class:word | Namespace: global | Interface Layer: all }} Data: - Addr: - Float: - End a lexically scoped area. This will hide any headers between `{{` and `---reveal---`, leaving only headers between `---reveal---` and the `}}` visible. Class: class:word | Namespace: global | Interface Layer: all sigil:! Data: ns- Addr: - Float: - Store a value into a variable. Interpret Time: Store a value into the named variable. Compile Time: Compile the code to store a value into a named variable. Class: class:macro | Namespace: sigil | Interface Layer: all sigil:# Data: s-n Addr: - Float: - Process token as a number. Interpret Time: Convert the string into a number and leave on the stack. Compile Time: Convert the string into a number and compile into the current definition as a literal. Class: class:macro | Namespace: sigil | Interface Layer: all sigil:$ Data: s-c Addr: - Float: - Process token as an ASCII character. Interpret Time: Fetch first character from string. Leave on stack. Compile Time: Fetch first character from the string. Compile into the current definition as literal. Class: class:macro | Namespace: sigil | Interface Layer: all sigil:& Data: s-a Addr: - Float: - Return a pointer to a named item. If name is not found, returns 0. Interpret Time: Lookup name in dictionary, return contents of the xt field on the stack. Compile Time: Lookup name in dictionary, compile code to push the contents of the xt field into the current definition. Class: class:macro | Namespace: sigil | Interface Layer: all sigil:' Data: s-s Addr: - Float: - Process token as a string. Interpret Time: Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space. Compile Time: Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space. Then compile the string into the current definition. Class: class:macro | Namespace: sigil | Interface Layer: all sigil:( Data: s- Addr: - Float: - Process token as a comment. Interpret Time: Discard the string. Compile Time: Discard the string. Class: class:macro | Namespace: sigil | Interface Layer: all sigil:: Data: s- Addr: - Float: - Hook. Process token as a new definition. Interpret Time: Create a header pointing to `here` with the provided string as the name. Sets class to `class:word`. Class: class:macro | Namespace: sigil | Interface Layer: all sigil:@ Data: s-n Addr: - Float: - Fetch from a stored variable. Interpret Time: Fetch a value from a named variable. Compile Time: Compile the code to fetch a value from a named variable into the current definition. Class: class:macro | Namespace: sigil | Interface Layer: all sigil:| Data: s- Addr: - Float: - POSTPONE equivalent. Interpret Time: Discard the string. Compile Time: Convert the string to a number and use `,` to inline it into the current definition. Class: class:macro | Namespace: sigil | Interface Layer: all