This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This is a reference to the words and their | |
| usage. It includes stack comments, a brief | |
| description, and some examples. | |
| -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- | |
| - | |
| nm-o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # See: a Better Disassembler | |
| ```` | |
| {{ | |
| ```` | |
| The decompiler is an important tool in the process of debugging and gaining insight into code. | |
| Output will be structured like this: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 6.30 | |
| clear lf onscreen-lines ' copy$ place count " ?negate ?dup ;code bytes c, :code codeX here pop push stack: array pick chars char+ cells cell+ align allot pad char-size cell-size -- ++ +! on off \ ( | |
| 7.6 | |
| .version version# $, ." " st0 | zt-free zt-make words >pad clear del tab space cr << 0; fill alias execute ' 2swap 2over cells cell+ align allot pad /mod octal binary decimal hex 2drop 2dup over tuck -rot rot constant variable, variable here mod / - negate * + c! c@ ! @ not >> xor or and nip dup drop swap base h0 last cmove reset parse type . macro forth : compile ] (create) create 3, 2, 1, , eval >number find mfind syscall bye key emit | |
| 8.2.5 | |
| edit v new include load w r blocks use \f \ ia i s e el eb x d n p (line) block (block) offset #blks blk home clear ? version .s words zt | ( exit ui octal binary decimal hex u. . cr space ." { s" $, " >pad pad place move fill ;loc loc: list devector is alias :: allot -! +! constant variable: variable create literal, create: execute 0; later 2dup tuck over -rot rot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :get-mime-type (s-s) | |
| [ $. s:index-of ] sip + | |
| '.ez [ 'application/andrew-inset ] s:case | |
| '.anx [ 'application/annodex ] s:case | |
| '.atomcat [ 'application/atomcat+xml ] s:case | |
| '.atomsrv [ 'application/atomserv+xml ] s:case | |
| '.atom [ 'application/atom+xml ] s:case | |
| '.lin [ 'application/bbolin ] s:case | |
| '.cu [ 'application/cu-seeme ] s:case | |
| '.davmount [ 'application/davmount+xml ] s:case |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RETRO: An Overview | |
| ----------------------------------------------------- | |
| RETRO is a Forth, but it's far from traditional takes | |
| on the language. This document attempts to describe | |
| the basics of the language, contrasting with standard | |
| Forth. | |
| ----------------------------------------------------- | |
| General Structure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ```` | |
| {{ | |
| :char (c-) | |
| $n [ ASCII:LF buffer:add ] case | |
| $t [ ASCII:HT buffer:add ] case | |
| buffer:add ; | |
| :string (a-a) | |
| repeat fetch-next 0; buffer:add again ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # AS | |
| Assembler for Nga | |
| This is an assembler for the Nga virtual machine that Retro runs on. It's intended to make it possible to develop tighter code than the standard Retro compiler can generate. | |
| Nga allows for packing up to four instructions per cell. This is limited by a single aspect, which is that instructions that modify the IP prevent later instructions from executing. So you can't pack anything after a jump, call, or conditional return. | |
| As a reference, here's the Nga instruction set: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {{ | |
| :mask #255 and ; | |
| :next #8 shift ; | |
| :unpack (n-dcba) | |
| dup mask swap next | |
| dup mask swap next | |
| dup mask swap next | |
| 'abcd 'dcba reorder ; | |
| ---reveal--- | |
| :bad:fetch (a-n) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| crc@debian:~/scratch$ gforth p | |
| in file included from *OS command line*:-1 | |
| p:3: Undefined word | |
| : >>>anonymous-pointer<<< here cell allot ; | |
| Backtrace: | |
| $7F6883F90A68 throw | |
| $7F6883FA6C68 no.extensions | |
| $7F6883F943A0 compiler-notfound1 | |
| crc@debian:~/scratch$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {{ | |
| 'Needle d:create | |
| #501 allot | |
| :in-namespace? (s-sf) | |
| d:name #0 &Needle s:length s:substr &Needle s:eq? ; | |
| :extract-name (s-s) | |
| d:name &Needle s:length + ; | |
| ---reveal--- | |
| :words<in-namespace> (s-) | |
| &Needle over s:length n:inc copy |