+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
-<!-- 2026-02-03 Tue 01:12 -->
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<meta name="viewport" content="width=device-width, initial-scale=1" />
-<title>Fifth - virtual machine, operating system, programming language</title>
-<meta name="author" content="Svjatoslav Agejenko" />
-<meta name="generator" content="Org Mode" />
-<style type="text/css">
- #content { max-width: 60em; margin: auto; }
- .title { text-align: center;
- margin-bottom: .2em; }
- .subtitle { text-align: center;
- font-size: medium;
- font-weight: bold;
- margin-top:0; }
- .todo { font-family: monospace; color: red; }
- .done { font-family: monospace; color: green; }
- .priority { font-family: monospace; color: orange; }
- .tag { background-color: #eee; font-family: monospace;
- padding: 2px; font-size: 80%; font-weight: normal; }
- .timestamp { color: #bebebe; }
- .timestamp-kwd { color: #5f9ea0; }
- .org-right { margin-left: auto; margin-right: 0px; text-align: right; }
- .org-left { margin-left: 0px; margin-right: auto; text-align: left; }
- .org-center { margin-left: auto; margin-right: auto; text-align: center; }
- .underline { text-decoration: underline; }
- #postamble p, #preamble p { font-size: 90%; margin: .2em; }
- p.verse { margin-left: 3%; }
- pre {
- border: 1px solid #e6e6e6;
- border-radius: 3px;
- background-color: #f2f2f2;
- padding: 8pt;
- font-family: monospace;
- overflow: auto;
- margin: 1.2em;
- }
- pre.src {
- position: relative;
- overflow: auto;
- }
- pre.src:before {
- display: none;
- position: absolute;
- top: -8px;
- right: 12px;
- padding: 3px;
- color: #555;
- background-color: #f2f2f299;
- }
- pre.src:hover:before { display: inline; margin-top: 14px;}
- /* Languages per Org manual */
- pre.src-asymptote:before { content: 'Asymptote'; }
- pre.src-awk:before { content: 'Awk'; }
- pre.src-authinfo::before { content: 'Authinfo'; }
- pre.src-C:before { content: 'C'; }
- /* pre.src-C++ doesn't work in CSS */
- pre.src-clojure:before { content: 'Clojure'; }
- pre.src-css:before { content: 'CSS'; }
- pre.src-D:before { content: 'D'; }
- pre.src-ditaa:before { content: 'ditaa'; }
- pre.src-dot:before { content: 'Graphviz'; }
- pre.src-calc:before { content: 'Emacs Calc'; }
- pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
- pre.src-fortran:before { content: 'Fortran'; }
- pre.src-gnuplot:before { content: 'gnuplot'; }
- pre.src-haskell:before { content: 'Haskell'; }
- pre.src-hledger:before { content: 'hledger'; }
- pre.src-java:before { content: 'Java'; }
- pre.src-js:before { content: 'Javascript'; }
- pre.src-latex:before { content: 'LaTeX'; }
- pre.src-ledger:before { content: 'Ledger'; }
- pre.src-lisp:before { content: 'Lisp'; }
- pre.src-lilypond:before { content: 'Lilypond'; }
- pre.src-lua:before { content: 'Lua'; }
- pre.src-matlab:before { content: 'MATLAB'; }
- pre.src-mscgen:before { content: 'Mscgen'; }
- pre.src-ocaml:before { content: 'Objective Caml'; }
- pre.src-octave:before { content: 'Octave'; }
- pre.src-org:before { content: 'Org mode'; }
- pre.src-oz:before { content: 'OZ'; }
- pre.src-plantuml:before { content: 'Plantuml'; }
- pre.src-processing:before { content: 'Processing.js'; }
- pre.src-python:before { content: 'Python'; }
- pre.src-R:before { content: 'R'; }
- pre.src-ruby:before { content: 'Ruby'; }
- pre.src-sass:before { content: 'Sass'; }
- pre.src-scheme:before { content: 'Scheme'; }
- pre.src-screen:before { content: 'Gnu Screen'; }
- pre.src-sed:before { content: 'Sed'; }
- pre.src-sh:before { content: 'shell'; }
- pre.src-sql:before { content: 'SQL'; }
- pre.src-sqlite:before { content: 'SQLite'; }
- /* additional languages in org.el's org-babel-load-languages alist */
- pre.src-forth:before { content: 'Forth'; }
- pre.src-io:before { content: 'IO'; }
- pre.src-J:before { content: 'J'; }
- pre.src-makefile:before { content: 'Makefile'; }
- pre.src-maxima:before { content: 'Maxima'; }
- pre.src-perl:before { content: 'Perl'; }
- pre.src-picolisp:before { content: 'Pico Lisp'; }
- pre.src-scala:before { content: 'Scala'; }
- pre.src-shell:before { content: 'Shell Script'; }
- pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
- /* additional language identifiers per "defun org-babel-execute"
- in ob-*.el */
- pre.src-cpp:before { content: 'C++'; }
- pre.src-abc:before { content: 'ABC'; }
- pre.src-coq:before { content: 'Coq'; }
- pre.src-groovy:before { content: 'Groovy'; }
- /* additional language identifiers from org-babel-shell-names in
- ob-shell.el: ob-shell is the only babel language using a lambda to put
- the execution function name together. */
- pre.src-bash:before { content: 'bash'; }
- pre.src-csh:before { content: 'csh'; }
- pre.src-ash:before { content: 'ash'; }
- pre.src-dash:before { content: 'dash'; }
- pre.src-ksh:before { content: 'ksh'; }
- pre.src-mksh:before { content: 'mksh'; }
- pre.src-posh:before { content: 'posh'; }
- /* Additional Emacs modes also supported by the LaTeX listings package */
- pre.src-ada:before { content: 'Ada'; }
- pre.src-asm:before { content: 'Assembler'; }
- pre.src-caml:before { content: 'Caml'; }
- pre.src-delphi:before { content: 'Delphi'; }
- pre.src-html:before { content: 'HTML'; }
- pre.src-idl:before { content: 'IDL'; }
- pre.src-mercury:before { content: 'Mercury'; }
- pre.src-metapost:before { content: 'MetaPost'; }
- pre.src-modula-2:before { content: 'Modula-2'; }
- pre.src-pascal:before { content: 'Pascal'; }
- pre.src-ps:before { content: 'PostScript'; }
- pre.src-prolog:before { content: 'Prolog'; }
- pre.src-simula:before { content: 'Simula'; }
- pre.src-tcl:before { content: 'tcl'; }
- pre.src-tex:before { content: 'TeX'; }
- pre.src-plain-tex:before { content: 'Plain TeX'; }
- pre.src-verilog:before { content: 'Verilog'; }
- pre.src-vhdl:before { content: 'VHDL'; }
- pre.src-xml:before { content: 'XML'; }
- pre.src-nxml:before { content: 'XML'; }
- /* add a generic configuration mode; LaTeX export needs an additional
- (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
- pre.src-conf:before { content: 'Configuration File'; }
-
- table { border-collapse:collapse; }
- caption.t-above { caption-side: top; }
- caption.t-bottom { caption-side: bottom; }
- td, th { vertical-align:top; }
- th.org-right { text-align: center; }
- th.org-left { text-align: center; }
- th.org-center { text-align: center; }
- td.org-right { text-align: right; }
- td.org-left { text-align: left; }
- td.org-center { text-align: center; }
- dt { font-weight: bold; }
- .footpara { display: inline; }
- .footdef { margin-bottom: 1em; }
- .figure { padding: 1em; }
- .figure p { text-align: center; }
- .equation-container {
- display: table;
- text-align: center;
- width: 100%;
- }
- .equation {
- vertical-align: middle;
- }
- .equation-label {
- display: table-cell;
- text-align: right;
- vertical-align: middle;
- }
- .inlinetask {
- padding: 10px;
- border: 2px solid gray;
- margin: 10px;
- background: #ffffcc;
- }
- #org-div-home-and-up
- { text-align: right; font-size: 70%; white-space: nowrap; }
- textarea { overflow-x: auto; }
- .linenr { font-size: smaller }
- .code-highlighted { background-color: #ffff00; }
- .org-info-js_info-navigation { border-style: none; }
- #org-info-js_console-label
- { font-size: 10px; font-weight: bold; white-space: nowrap; }
- .org-info-js_search-highlight
- { background-color: #ffff00; color: #000000; font-weight: bold; }
- .org-svg { }
-</style>
-<style type="text/css">
- body {
- max-width: 35cm !important;
- }
- #content {
- max-width: 80em !important;
- width: 90%;
- }
- </style>
-<link rel="stylesheet" type="text/css" href="https://thomasf.github.io/solarized-css/solarized-dark.min.css" />
-</head>
-<body>
-<div id="content" class="content">
-<h1 class="title">Fifth - virtual machine, operating system, programming language</h1>
-<div id="table-of-contents" role="doc-toc">
-<h2>Table of Contents</h2>
-<div id="text-table-of-contents" role="doc-toc">
-<ul>
-<li><a href="#org4486738">1. General</a>
-<ul>
-<li><a href="#org9d6f5ec">1.1. Source code</a></li>
-</ul>
-</li>
-<li><a href="#orgdd79f1d">2. Introduction</a>
-<ul>
-<li><a href="#org4936051">2.1. Screenshots</a></li>
-</ul>
-</li>
-<li><a href="#org5f58cdf">3. Installation</a></li>
-<li><a href="#org8b9c975">4. Fifth distribution directory tree description</a></li>
-<li><a href="#org29ce6a9">5. Requirements</a>
-<ul>
-<li><a href="#org47eaa46">5.1. Software</a></li>
-<li><a href="#org20e4d36">5.2. Hardware</a></li>
-</ul>
-</li>
-<li><a href="#org821d5fa">6. Numbers representation within Fifth</a></li>
-<li><a href="#org0d5f6fa">7. Disk file map, and it's data structures</a>
-<ul>
-<li><a href="#orgff8ee3e">7.1. Disk allocation</a></li>
-<li><a href="#org224e86d">7.2. FAT entry format:</a></li>
-<li><a href="#org9c30d43">7.3. File entry format</a></li>
-</ul>
-</li>
-<li><a href="#org58ab957">8. Core architecture</a>
-<ul>
-<li><a href="#org82b895c">8.1. Dictionary entry format</a></li>
-<li><a href="#org91e150c">8.2. Possible module types</a></li>
-<li><a href="#org5d75a57">8.3. Memory map</a></li>
-</ul>
-</li>
-<li><a href="#org5ba62b5">9. Dynamically loadable modules</a>
-<ul>
-<li><a href="#org9d420f3">9.1. Keyboard driver</a></li>
-<li><a href="#org4587bc8">9.2. Mouse driver</a></li>
-<li><a href="#orgdde086c">9.3. 2D graphic library</a></li>
-<li><a href="#org14b7791">9.4. Trigonometry functions</a>
-<ul>
-<li><a href="#orgb989427">9.4.1. sin ( a – result )</a></li>
-<li><a href="#orgb14ae13">9.4.2. cos ( a – result )</a></li>
-</ul>
-</li>
-</ul>
-</li>
-</ul>
-</div>
-</div>
-<div id="outline-container-org4486738" class="outline-2">
-<h2 id="org4486738"><span class="section-number-2">1.</span> General</h2>
-<div class="outline-text-2" id="text-1">
-<ul class="org-ul">
-<li>This program is free software: released under Creative Commons Zero
-(CC0) license</li>
-
-<li>Program author:
-<ul class="org-ul">
-<li>Svjatoslav Agejenko</li>
-<li>Homepage: <a href="https://svjatoslav.eu">https://svjatoslav.eu</a></li>
-<li>Email: <a href="mailto://svjatoslav@svjatoslav.eu">mailto://svjatoslav@svjatoslav.eu</a></li>
-</ul></li>
-
-<li><a href="https://www.svjatoslav.eu/projects/">Other software projects hosted at svjatoslav.eu</a></li>
-</ul>
-</div>
-<div id="outline-container-org9d6f5ec" class="outline-3">
-<h3 id="org9d6f5ec"><span class="section-number-3">1.1.</span> Source code</h3>
-<div class="outline-text-3" id="text-1-1">
-<ul class="org-ul">
-<li><a href="https://www2.svjatoslav.eu/gitweb/?p=fifth.git;a=snapshot;h=HEAD;sf=tgz">Download latest snapshot in TAR GZ format</a></li>
-
-<li><a href="https://www2.svjatoslav.eu/gitweb/?p=fifth.git;a=summary">Browse Git repository online</a></li>
-
-<li><p>
-Clone Git repository using command:
-</p>
-<pre class="example">
-git clone https://www3.svjatoslav.eu/git/fifth.git
-</pre></li>
-</ul>
-</div>
-</div>
-</div>
-<div id="outline-container-orgdd79f1d" class="outline-2">
-<h2 id="orgdd79f1d"><span class="section-number-2">2.</span> Introduction</h2>
-<div class="outline-text-2" id="text-2">
-<p>
-Fifth is self-hosting computing environment that integrates a <a href="virtual machine.html#ID-9b251eb9-aff6-4025-94bf-25e89e26d54a">custom
-virtual machine</a>, a <a href="language.html#ID-da7fff9b-0b67-4843-828a-52a404d7f401">Forth-inspired programming language</a>, and operating
-system.
-</p>
-
-<p>
-At its core lies a stack-based virtual CPU with two stacks (data and
-return), approximately 50 instructions, and a 4GB flat address
-space. This virtual machine executes the Fifth language — a concise,
-interactive, and extensible environment where every operation is a
-command that can be defined, redefined, or extended by the user. The
-language uses a custom character encoding (FSCII) with unique
-representations for control characters (e.g., space as FF instead of
-20 in ASCII) and features an innovative hexadecimal number system
-visualized as squares split into four triangles, each representing a
-single bit—similar to Bibi-binary.
-</p>
-
-<p>
-It includes a disk-based filesystem, a built-in text editor, 2D
-graphics capabilities, mouse and keyboard drivers, and tools for file
-management and memory allocation.
-</p>
-
-<p>
-Released under the CC0 public domain license, Fifth is free for anyone
-to use, study, and modify. Whether you're a retro computing
-enthusiast, a systems programming student, or a curious developer.
-</p>
-</div>
-<div id="outline-container-org4936051" class="outline-3">
-<h3 id="org4936051"><span class="section-number-3">2.1.</span> Screenshots</h3>
-<div class="outline-text-3" id="text-2-1">
-
-<div id="orga0fc3b9" class="figure">
-<p><img src="screenshots/start.png" alt="start.png" />
-</p>
-</div>
-
-<p>
-Startup screen diplaying Fifth logo and full file list.
-</p>
-
-
-<div id="org413f6ca" class="figure">
-<p><img src="screenshots/dictionary.png" alt="dictionary.png" />
-</p>
-</div>
-
-<p>
-Sample words defined. Most of the words are commands that can be
-executed interactively from the command line or from a file. When
-executed, they can be selectively compiled or interpreted.
-</p>
-
-
-
-<div id="org1834fc6" class="figure">
-<p><img src="screenshots/text editor.png" alt="text editor.png" />
-</p>
-</div>
-
-<p>
-Built in text editor.
-</p>
-</div>
-</div>
-</div>
-<div id="outline-container-org5f58cdf" class="outline-2">
-<h2 id="org5f58cdf"><span class="section-number-2">3.</span> Installation</h2>
-<div class="outline-text-2" id="text-3">
-<p>
-Just unpack all files, witout altering original directory structure,
-somewhere in your hard disk. For example:
-</p>
-
-<pre class="example">
-C:\MISC\FIFTH\
-</pre>
-
-
-<p>
-To run fifth you need minimally just 2 files:
-</p>
-<dl class="org-dl">
-<dt>EMULATOR.COM</dt><dd>Virtual CPU emulator</dd>
-<dt>DISK.RAW</dt><dd>Virtual disk file</dd>
-</dl>
-
-<p>
-For more information, please refer to <a href="#org8b9c975">Fifth distribution directory
-tree description</a>.
-</p>
-</div>
-</div>
-<div id="outline-container-org8b9c975" class="outline-2">
-<h2 id="org8b9c975"><span class="section-number-2">4.</span> Fifth distribution directory tree description</h2>
-<div class="outline-text-2" id="text-4">
-<p>
-After downloading and unpacking the ZIP file you shoud get directory
-tree similar to this:
-</p>
-
-<p class="verse">
-<b>DOC</b> - Fifth documentation<br />
-  <b>commands</b> - documentation on Fifth built-in commands<br />
-  <b>modules</b> - documentation on additional commands, realized as loadable modules<br />
-  <b>shots</b> - Fifth screenshots<br />
-<br />
-<b>imageFile</b> - files contained within 'disk.raw', just an extracted form.<br />
-<br />
-<b>source</b> - source files<br />
-  <b>emulator</b> - emulator source<br />
-  <b>util</b> - utilites<br />
-<br />
-<b>disk.raw</b> - Virtual disk file, has filesystem inside.<br />
-<b>emulator.com</b> - main executable.<br />
-</p>
-</div>
-</div>
-<div id="outline-container-org29ce6a9" class="outline-2">
-<h2 id="org29ce6a9"><span class="section-number-2">5.</span> Requirements</h2>
-<div class="outline-text-2" id="text-5">
-</div>
-<div id="outline-container-org47eaa46" class="outline-3">
-<h3 id="org47eaa46"><span class="section-number-3">5.1.</span> Software</h3>
-<div class="outline-text-3" id="text-5-1">
-<ul class="org-ul">
-<li>MS-DOS 6.22 with HIMEM.SYS loaded.</li>
-<li>Mouse driver (optional, if you have a mouse).</li>
-<li>CPU is initialized into <a href="https://en.wikipedia.org/wiki/Unreal_mode">Unreal Mode</a> during operation.</li>
-<li>To recompile ASM sources, you can use FASM (Flat Assembler).</li>
-<li>To run Quick Basic utilities, use Microsoft Quick Basic 4.5.</li>
-<li>VESA support through BIOS or external driver (UNIVBE).</li>
-</ul>
-</div>
-</div>
-<div id="outline-container-org20e4d36" class="outline-3">
-<h3 id="org20e4d36"><span class="section-number-3">5.2.</span> Hardware</h3>
-<div class="outline-text-3" id="text-5-2">
-<ul class="org-ul">
-<li>A minimum of a i386 CPU.</li>
-<li>64 KB of free RAM below 640KB.</li>
-<li>2 MB of free <a href="https://en.wikipedia.org/wiki/Extended_memory">extended memory</a>.</li>
-<li>A VESA-compatible video card.</li>
-</ul>
-</div>
-</div>
-</div>
-<div id="outline-container-org821d5fa" class="outline-2">
-<h2 id="org821d5fa"><span class="section-number-2">6.</span> Numbers representation within Fifth</h2>
-<div class="outline-text-2" id="text-6">
-<p>
-Because we are in full experimentation mode here (no regard for
-compatibility whatsoever), why not to try also alternative number
-representation ?
-</p>
-
-<p>
-Here alternative hexadecimal number representation format is devised:
-</p>
-
-
-<div id="org26a21b0" class="figure">
-<p><a href="numbers.png"><img src="numbers.png" alt="numbers.png" /></a>
-</p>
-</div>
-
-<p>
-Essentially square is split into 4 triangles. Each triangle represents
-one bit.
-</p>
-
-<p>
-Fifth uses this hexadecimal format as primary throughout entire
-system.
-</p>
-
-<p>
-See also: <a href="https://en.wikipedia.org/wiki/Bibi-binary">Bibi-binary</a>.
-</p>
-</div>
-</div>
-<div id="outline-container-org0d5f6fa" class="outline-2">
-<h2 id="org0d5f6fa"><span class="section-number-2">7.</span> Disk file map, and it's data structures</h2>
-<div class="outline-text-2" id="text-7">
-<p>
-Core and high-level boot code is stored outside of the filesystem to
-allow easy access to it, at early booting time, when filesystem is not
-yet initialized.
-</p>
-</div>
-<div id="outline-container-orgff8ee3e" class="outline-3">
-<h3 id="orgff8ee3e"><span class="section-number-3">7.1.</span> Disk allocation</h3>
-<div class="outline-text-3" id="text-7-1">
-<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
-
-
-<colgroup>
-<col class="org-left" />
-
-<col class="org-left" />
-
-<col class="org-left" />
-</colgroup>
-<thead>
-<tr>
-<th scope="col" class="org-left">offset</th>
-<th scope="col" class="org-left">length</th>
-<th scope="col" class="org-left">description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td class="org-left">0</td>
-<td class="org-left">~4 Kb</td>
-<td class="org-left">Fifth core</td>
-</tr>
-
-<tr>
-<td class="org-left">4 Kb</td>
-<td class="org-left">~32 Kb</td>
-<td class="org-left">high-level boot code</td>
-</tr>
-
-<tr>
-<td class="org-left">37 Kb</td>
-<td class="org-left">~65 Kb</td>
-<td class="org-left">FAT</td>
-</tr>
-
-<tr>
-<td class="org-left">101 Kb</td>
-<td class="org-left">~16 MB</td>
-<td class="org-left">filesystem data area</td>
-</tr>
-</tbody>
-</table>
-</div>
-</div>
-<div id="outline-container-org224e86d" class="outline-3">
-<h3 id="org224e86d"><span class="section-number-3">7.2.</span> FAT entry format:</h3>
-<div class="outline-text-3" id="text-7-2">
-<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
-
-
-<colgroup>
-<col class="org-right" />
-
-<col class="org-left" />
-</colgroup>
-<thead>
-<tr>
-<th scope="col" class="org-right">code</th>
-<th scope="col" class="org-left">meaning</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td class="org-right">-2</td>
-<td class="org-left">last sector</td>
-</tr>
-
-<tr>
-<td class="org-right">-1</td>
-<td class="org-left">empty sector</td>
-</tr>
-
-<tr>
-<td class="org-right">0 --</td>
-<td class="org-left">.. pointer to next block</td>
-</tr>
-</tbody>
-</table>
-</div>
-</div>
-<div id="outline-container-org9c30d43" class="outline-3">
-<h3 id="org9c30d43"><span class="section-number-3">7.3.</span> File entry format</h3>
-<div class="outline-text-3" id="text-7-3">
-<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
-
-
-<colgroup>
-<col class="org-right" />
-
-<col class="org-right" />
-
-<col class="org-left" />
-</colgroup>
-<thead>
-<tr>
-<th scope="col" class="org-right">offset</th>
-<th scope="col" class="org-right">length</th>
-<th scope="col" class="org-left">description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td class="org-right">0</td>
-<td class="org-right">4</td>
-<td class="org-left">extension</td>
-</tr>
-
-<tr>
-<td class="org-right">4</td>
-<td class="org-right">16</td>
-<td class="org-left">name</td>
-</tr>
-
-<tr>
-<td class="org-right">20</td>
-<td class="org-right">4</td>
-<td class="org-left">entry point</td>
-</tr>
-
-<tr>
-<td class="org-right">24</td>
-<td class="org-right">4</td>
-<td class="org-left">size</td>
-</tr>
-
-<tr>
-<td class="org-right">28</td>
-<td class="org-right">4</td>
-<td class="org-left">last modification time</td>
-</tr>
-</tbody>
-</table>
-</div>
-</div>
-</div>
-<div id="outline-container-org58ab957" class="outline-2">
-<h2 id="org58ab957"><span class="section-number-2">8.</span> Core architecture</h2>
-<div class="outline-text-2" id="text-8">
-<p>
-Fifth core is simply some amount of already compiled into machine code
-and linked together modules (entries in other words). In compilation
-process modules is compiled one by one and simply stored on top of
-already existing and growing core. Separately from core is kept
-dictionary, this is special list that contain names of compiled
-modules, variables etc. and they locations in core. Constants use
-dictionary space only. Random word can be removed from dictionary at
-any time. Currently dictionary can contain at most 1000 entries.
-</p>
-</div>
-<div id="outline-container-org82b895c" class="outline-3">
-<h3 id="org82b895c"><span class="section-number-3">8.1.</span> Dictionary entry format</h3>
-<div class="outline-text-3" id="text-8-1">
-<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
-
-
-<colgroup>
-<col class="org-right" />
-
-<col class="org-right" />
-
-<col class="org-left" />
-</colgroup>
-<thead>
-<tr>
-<th scope="col" class="org-right">offset</th>
-<th scope="col" class="org-right">length</th>
-<th scope="col" class="org-left">description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td class="org-right">0</td>
-<td class="org-right">4</td>
-<td class="org-left">0 &lt; previous entry</td>
-</tr>
-
-<tr>
-<td class="org-right"> </td>
-<td class="org-right"> </td>
-<td class="org-left">0 = last</td>
-</tr>
-
-<tr>
-<td class="org-right"> </td>
-<td class="org-right"> </td>
-<td class="org-left">-1 = empty</td>
-</tr>
-</tbody>
-<tbody>
-<tr>
-<td class="org-right">4</td>
-<td class="org-right">15</td>
-<td class="org-left">module name string</td>
-</tr>
-</tbody>
-<tbody>
-<tr>
-<td class="org-right">19</td>
-<td class="org-right">1</td>
-<td class="org-left">entry type</td>
-</tr>
-</tbody>
-<tbody>
-<tr>
-<td class="org-right">20</td>
-<td class="org-right">4</td>
-<td class="org-left">entry data</td>
-</tr>
-</tbody>
-</table>
-
-<p>
-Core headers as linked list of module names make up something like
-dictionary. When some entry address is needed compiler can quickly
-run through headers backwards and find needed entry.
-</p>
-</div>
-</div>
-<div id="outline-container-org91e150c" class="outline-3">
-<h3 id="org91e150c"><span class="section-number-3">8.2.</span> Possible module types</h3>
-<div class="outline-text-3" id="text-8-2">
-<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
-
-
-<colgroup>
-<col class="org-right" />
-
-<col class="org-left" />
-
-<col class="org-left" />
-</colgroup>
-<thead>
-<tr>
-<th scope="col" class="org-right">type</th>
-<th scope="col" class="org-left">description</th>
-<th scope="col" class="org-left">"execute" action</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td class="org-right">0</td>
-<td class="org-left">data</td>
-<td class="org-left">compile "num" instruction</td>
-</tr>
-
-<tr>
-<td class="org-right"> </td>
-<td class="org-left"> </td>
-<td class="org-left">with address to module</td>
-</tr>
-</tbody>
-<tbody>
-<tr>
-<td class="org-right">1</td>
-<td class="org-left">submodule</td>
-<td class="org-left">compile "call" instruction</td>
-</tr>
-
-<tr>
-<td class="org-right"> </td>
-<td class="org-left"> </td>
-<td class="org-left">with address to module</td>
-</tr>
-</tbody>
-<tbody>
-<tr>
-<td class="org-right">2</td>
-<td class="org-left">imm. submodule</td>
-<td class="org-left">immediately call to module</td>
-</tr>
-</tbody>
-</table>
-</div>
-</div>
-<div id="outline-container-org5d75a57" class="outline-3">
-<h3 id="org5d75a57"><span class="section-number-3">8.3.</span> Memory map</h3>
-<div class="outline-text-3" id="text-8-3">
-<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
-
-
-<colgroup>
-<col class="org-right" />
-
-<col class="org-left" />
-
-<col class="org-left" />
-</colgroup>
-<thead>
-<tr>
-<th scope="col" class="org-right">location</th>
-<th scope="col" class="org-left">size</th>
-<th scope="col" class="org-left">description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td class="org-right">0</td>
-<td class="org-left">~4096</td>
-<td class="org-left">core</td>
-</tr>
-
-<tr>
-<td class="org-right">1500000</td>
-<td class="org-left">~32000</td>
-<td class="org-left">highlevel Fifth boot code</td>
-</tr>
-
-<tr>
-<td class="org-right">200000h</td>
-<td class="org-left"> </td>
-<td class="org-left">core startup messages area</td>
-</tr>
-
-<tr>
-<td class="org-right">5200000</td>
-<td class="org-left"> </td>
-<td class="org-left">end of dynamic memory space</td>
-</tr>
-</tbody>
-</table>
-</div>
-</div>
-</div>
-<div id="outline-container-org5ba62b5" class="outline-2">
-<h2 id="org5ba62b5"><span class="section-number-2">9.</span> Dynamically loadable modules</h2>
-<div class="outline-text-2" id="text-9">
-</div>
-<div id="outline-container-org9d420f3" class="outline-3">
-<h3 id="org9d420f3"><span class="section-number-3">9.1.</span> Keyboard driver</h3>
-<div class="outline-text-3" id="text-9-1">
-<p class="verse">
-<br />
-KBD_@ ( – code ) get scancodes for pressed keys from keyboard.<br />
-KBD_down? ( key – result ) check is key with specified scancode<br />
-                currently pressed down.<br />
-KBD_SC2FSCII ( code – FSCII ) convert key scancode into FSCII code,<br />
-                or in FSK (Fifth standard keycode).<br />
-KBD_F@ ( – FSCII ) read pressed key FSCII or FSK, returns -1 if no<br />
-                keys are pressed.<br />
-KBD_FW@ ( – FSCII ) read pressed key FSCII or FSK, if no keys is<br />
-                are pressed then waits until there is.<br />
-<br />
-                FSK<br />
-                —<br />
-In HEX.<br />
-<br />
-FC backspace<br />
-FD TAB<br />
-FE enter<br />
-FF space<br />
-<br />
-400 ESC<br />
-401 … F1 …<br />
-410 up<br />
-411 right<br />
-412 down<br />
-413 left<br />
-414 INS<br />
-415 DEL<br />
-416 home<br />
-417 end<br />
-418 PG/UP<br />
-419 PG/DN<br />
-</p>
-</div>
-</div>
-<div id="outline-container-org4587bc8" class="outline-3">
-<h3 id="org4587bc8"><span class="section-number-3">9.2.</span> Mouse driver</h3>
-<div class="outline-text-3" id="text-9-2">
-<p class="verse">
-mousex var Mouse x coordinate.<br />
-mousey var Mouse y coordinate.<br />
-mousekeyl var Mouse left key.<br />
-mousekeym var Mouse middle key.<br />
-mousekeyr var Mouse right key.<br />
-mousec var Display current mouse coordinates in top left part of screen,<br />
-                if true. (good for debugging)<br />
-mousepointer var Image buffer, holding current mouse pointer.<br />
-mouseadd ( ModuleAddr x1 x2 y1 y2 – ) Add specified area on screen,<br />
-                into mause click buffer. If any mouse button is clicked on<br />
-                that area, module at "ModuleAddr" will be executed.<br />
-mousebe var Amount of buffer elements.<br />
-mousedo ( – ) Updates mouse coordinates and keys. Parse mouse<br />
-                click buffer, and draw mouse cursor to "screen".<br />
-</p>
-</div>
-</div>
-<div id="outline-container-orgdde086c" class="outline-3">
-<h3 id="orgdde086c"><span class="section-number-3">9.3.</span> 2D graphic library</h3>
-<div class="outline-text-3" id="text-9-3">
-<dl class="org-dl">
-<dt>lineh ( color len x y imgbuf – )</dt><dd>draws horisontal line from X,Y
-coordinates to right, with specified length.</dd>
-
-<dt>linev ( color len x y imgbuf – )</dt><dd>draws vertical line down, from
-coordinates X,Y, with specified length.</dd>
-
-<dt>box ( color x2 x1 y2 y1 imgbuf – )</dt><dd><p>
-draws rectangular box. x2
-bust be >= x1, y2 must be >= y1.
-</p>
-
-<pre class="example" id="org8b1fce2">
-x1,y1-----------+
- | |
- | |
- +-----------x2,y2
-</pre></dd>
-
-<dt>flipv ( imgbuf – )</dt><dd>flip image vertically.</dd>
-
-<dt>imgcoltrans ( ImgBuf Color ToColor – )</dt><dd>Translate all pixels in
-specified image with "Color" into "ToColor".</dd>
-
-<dt>imgfill ( color x y imgbuf – )</dt><dd>Fill image region starting at
-location X & Y with specified color.</dd>
-</dl>
-</div>
-</div>
-<div id="outline-container-org14b7791" class="outline-3">
-<h3 id="org14b7791"><span class="section-number-3">9.4.</span> Trigonometry functions</h3>
-<div class="outline-text-3" id="text-9-4">
-</div>
-<div id="outline-container-orgb989427" class="outline-4">
-<h4 id="orgb989427"><span class="section-number-4">9.4.1.</span> sin ( a – result )</h4>
-<div class="outline-text-4" id="text-9-4-1">
-<p>
-Return sinus from given angle "a", 360ø is 2000. So 1000 represents
-180ø angle. Result will be in range -10'000 to 10'000, instead of ñ1.
-</p>
-</div>
-</div>
-<div id="outline-container-orgb14ae13" class="outline-4">
-<h4 id="orgb14ae13"><span class="section-number-4">9.4.2.</span> cos ( a – result )</h4>
-<div class="outline-text-4" id="text-9-4-2">
-<p>
-Return cosinus from given angle. Parameters are like in <a href="#orgb989427">sin</a> function.
-</p>
-</div>
-</div>
-</div>
-</div>
-</div>
-<div id="postamble" class="status">
-<p class="author">Author: Svjatoslav Agejenko</p>
-<p class="date">Created: 2026-02-03 Tue 01:12</p>
-<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
-</div>
-</body>
-</html>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
-<!-- 2023-09-19 Tue 18:07 -->
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<meta name="viewport" content="width=device-width, initial-scale=1" />
-<title>Fifth - language</title>
-<meta name="author" content="Svjatoslav Agejenko" />
-<meta name="generator" content="Org Mode" />
-<style>
- #content { max-width: 60em; margin: auto; }
- .title { text-align: center;
- margin-bottom: .2em; }
- .subtitle { text-align: center;
- font-size: medium;
- font-weight: bold;
- margin-top:0; }
- .todo { font-family: monospace; color: red; }
- .done { font-family: monospace; color: green; }
- .priority { font-family: monospace; color: orange; }
- .tag { background-color: #eee; font-family: monospace;
- padding: 2px; font-size: 80%; font-weight: normal; }
- .timestamp { color: #bebebe; }
- .timestamp-kwd { color: #5f9ea0; }
- .org-right { margin-left: auto; margin-right: 0px; text-align: right; }
- .org-left { margin-left: 0px; margin-right: auto; text-align: left; }
- .org-center { margin-left: auto; margin-right: auto; text-align: center; }
- .underline { text-decoration: underline; }
- #postamble p, #preamble p { font-size: 90%; margin: .2em; }
- p.verse { margin-left: 3%; }
- pre {
- border: 1px solid #e6e6e6;
- border-radius: 3px;
- background-color: #f2f2f2;
- padding: 8pt;
- font-family: monospace;
- overflow: auto;
- margin: 1.2em;
- }
- pre.src {
- position: relative;
- overflow: auto;
- }
- pre.src:before {
- display: none;
- position: absolute;
- top: -8px;
- right: 12px;
- padding: 3px;
- color: #555;
- background-color: #f2f2f299;
- }
- pre.src:hover:before { display: inline; margin-top: 14px;}
- /* Languages per Org manual */
- pre.src-asymptote:before { content: 'Asymptote'; }
- pre.src-awk:before { content: 'Awk'; }
- pre.src-authinfo::before { content: 'Authinfo'; }
- pre.src-C:before { content: 'C'; }
- /* pre.src-C++ doesn't work in CSS */
- pre.src-clojure:before { content: 'Clojure'; }
- pre.src-css:before { content: 'CSS'; }
- pre.src-D:before { content: 'D'; }
- pre.src-ditaa:before { content: 'ditaa'; }
- pre.src-dot:before { content: 'Graphviz'; }
- pre.src-calc:before { content: 'Emacs Calc'; }
- pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
- pre.src-fortran:before { content: 'Fortran'; }
- pre.src-gnuplot:before { content: 'gnuplot'; }
- pre.src-haskell:before { content: 'Haskell'; }
- pre.src-hledger:before { content: 'hledger'; }
- pre.src-java:before { content: 'Java'; }
- pre.src-js:before { content: 'Javascript'; }
- pre.src-latex:before { content: 'LaTeX'; }
- pre.src-ledger:before { content: 'Ledger'; }
- pre.src-lisp:before { content: 'Lisp'; }
- pre.src-lilypond:before { content: 'Lilypond'; }
- pre.src-lua:before { content: 'Lua'; }
- pre.src-matlab:before { content: 'MATLAB'; }
- pre.src-mscgen:before { content: 'Mscgen'; }
- pre.src-ocaml:before { content: 'Objective Caml'; }
- pre.src-octave:before { content: 'Octave'; }
- pre.src-org:before { content: 'Org mode'; }
- pre.src-oz:before { content: 'OZ'; }
- pre.src-plantuml:before { content: 'Plantuml'; }
- pre.src-processing:before { content: 'Processing.js'; }
- pre.src-python:before { content: 'Python'; }
- pre.src-R:before { content: 'R'; }
- pre.src-ruby:before { content: 'Ruby'; }
- pre.src-sass:before { content: 'Sass'; }
- pre.src-scheme:before { content: 'Scheme'; }
- pre.src-screen:before { content: 'Gnu Screen'; }
- pre.src-sed:before { content: 'Sed'; }
- pre.src-sh:before { content: 'shell'; }
- pre.src-sql:before { content: 'SQL'; }
- pre.src-sqlite:before { content: 'SQLite'; }
- /* additional languages in org.el's org-babel-load-languages alist */
- pre.src-forth:before { content: 'Forth'; }
- pre.src-io:before { content: 'IO'; }
- pre.src-J:before { content: 'J'; }
- pre.src-makefile:before { content: 'Makefile'; }
- pre.src-maxima:before { content: 'Maxima'; }
- pre.src-perl:before { content: 'Perl'; }
- pre.src-picolisp:before { content: 'Pico Lisp'; }
- pre.src-scala:before { content: 'Scala'; }
- pre.src-shell:before { content: 'Shell Script'; }
- pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
- /* additional language identifiers per "defun org-babel-execute"
- in ob-*.el */
- pre.src-cpp:before { content: 'C++'; }
- pre.src-abc:before { content: 'ABC'; }
- pre.src-coq:before { content: 'Coq'; }
- pre.src-groovy:before { content: 'Groovy'; }
- /* additional language identifiers from org-babel-shell-names in
- ob-shell.el: ob-shell is the only babel language using a lambda to put
- the execution function name together. */
- pre.src-bash:before { content: 'bash'; }
- pre.src-csh:before { content: 'csh'; }
- pre.src-ash:before { content: 'ash'; }
- pre.src-dash:before { content: 'dash'; }
- pre.src-ksh:before { content: 'ksh'; }
- pre.src-mksh:before { content: 'mksh'; }
- pre.src-posh:before { content: 'posh'; }
- /* Additional Emacs modes also supported by the LaTeX listings package */
- pre.src-ada:before { content: 'Ada'; }
- pre.src-asm:before { content: 'Assembler'; }
- pre.src-caml:before { content: 'Caml'; }
- pre.src-delphi:before { content: 'Delphi'; }
- pre.src-html:before { content: 'HTML'; }
- pre.src-idl:before { content: 'IDL'; }
- pre.src-mercury:before { content: 'Mercury'; }
- pre.src-metapost:before { content: 'MetaPost'; }
- pre.src-modula-2:before { content: 'Modula-2'; }
- pre.src-pascal:before { content: 'Pascal'; }
- pre.src-ps:before { content: 'PostScript'; }
- pre.src-prolog:before { content: 'Prolog'; }
- pre.src-simula:before { content: 'Simula'; }
- pre.src-tcl:before { content: 'tcl'; }
- pre.src-tex:before { content: 'TeX'; }
- pre.src-plain-tex:before { content: 'Plain TeX'; }
- pre.src-verilog:before { content: 'Verilog'; }
- pre.src-vhdl:before { content: 'VHDL'; }
- pre.src-xml:before { content: 'XML'; }
- pre.src-nxml:before { content: 'XML'; }
- /* add a generic configuration mode; LaTeX export needs an additional
- (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
- pre.src-conf:before { content: 'Configuration File'; }
-
- table { border-collapse:collapse; }
- caption.t-above { caption-side: top; }
- caption.t-bottom { caption-side: bottom; }
- td, th { vertical-align:top; }
- th.org-right { text-align: center; }
- th.org-left { text-align: center; }
- th.org-center { text-align: center; }
- td.org-right { text-align: right; }
- td.org-left { text-align: left; }
- td.org-center { text-align: center; }
- dt { font-weight: bold; }
- .footpara { display: inline; }
- .footdef { margin-bottom: 1em; }
- .figure { padding: 1em; }
- .figure p { text-align: center; }
- .equation-container {
- display: table;
- text-align: center;
- width: 100%;
- }
- .equation {
- vertical-align: middle;
- }
- .equation-label {
- display: table-cell;
- text-align: right;
- vertical-align: middle;
- }
- .inlinetask {
- padding: 10px;
- border: 2px solid gray;
- margin: 10px;
- background: #ffffcc;
- }
- #org-div-home-and-up
- { text-align: right; font-size: 70%; white-space: nowrap; }
- textarea { overflow-x: auto; }
- .linenr { font-size: smaller }
- .code-highlighted { background-color: #ffff00; }
- .org-info-js_info-navigation { border-style: none; }
- #org-info-js_console-label
- { font-size: 10px; font-weight: bold; white-space: nowrap; }
- .org-info-js_search-highlight
- { background-color: #ffff00; color: #000000; font-weight: bold; }
- .org-svg { }
-</style>
-<link rel="stylesheet" type="text/css" href="https://thomasf.github.io/solarized-css/solarized-dark.min.css" />
-<script type="text/x-mathjax-config">
- MathJax.Hub.Config({
- displayAlign: "center",
- displayIndent: "0em",
-
- "HTML-CSS": { scale: 100,
- linebreaks: { automatic: "false" },
- webFont: "TeX"
- },
- SVG: {scale: 100,
- linebreaks: { automatic: "false" },
- font: "TeX"},
- NativeMML: {scale: 100},
- TeX: { equationNumbers: {autoNumber: "AMS"},
- MultLineWidth: "85%",
- TagSide: "right",
- TagIndent: ".8em"
- }
-});
-</script>
-<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></script>
-</head>
-<body>
-<div id="content" class="content">
-<h1 class="title">Fifth - language</h1>
-<div id="table-of-contents" role="doc-toc">
-<h2>Table of Contents</h2>
-<div id="text-table-of-contents" role="doc-toc">
-<ul>
-<li><a href="#orgfe5302c">1. Fifth source format</a>
-<ul>
-<li><a href="#orge4e9f7d">1.1. FSCII</a></li>
-</ul>
-</li>
-<li><a href="#orge63cf49">2. Fifth commands</a>
-<ul>
-<li><a href="#org25bc695">2.1. Compilation & miscellaneous</a></li>
-<li><a href="#orgc47a7bb">2.2. Conditionals & control flow</a></li>
-<li><a href="#org572f33f">2.3. Disk & file access</a></li>
-<li><a href="#org89deb72">2.4. Dynamic memory</a></li>
-<li><a href="#orgea457a7">2.5. Graphics and text</a></li>
-<li><a href="#orge721086">2.6. Math, memory & stack manipulation</a></li>
-<li><a href="#orgf17027f">2.7. Dynamic & static strings</a></li>
-</ul>
-</li>
-</ul>
-</div>
-</div>
-<ul class="org-ul">
-<li><a href="5TH_ET.txt">Example Fifth source file - text editor</a></li>
-</ul>
-
-<div id="outline-container-orgfe5302c" class="outline-2">
-<h2 id="orgfe5302c"><span class="section-number-2">1.</span> Fifth source format</h2>
-<div class="outline-text-2" id="text-1">
-<p>
-Fifth uses a different character table and codes than ASCII (still
-almost similar). I call it FSCII (Fifth Standard Code for Information
-Interchange) for example space character is not 32 but 255 instead. I
-plan to use mainly HEX numbers, and create new characters to represent
-numeric values. So typical nemric characters "0123…" is treated
-like ordinary letters.
-</p>
-</div>
-<div id="outline-container-orge4e9f7d" class="outline-3">
-<h3 id="orge4e9f7d"><span class="section-number-3">1.1.</span> FSCII</h3>
-<div class="outline-text-3" id="text-1-1">
-<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
-
-
-<colgroup>
-<col class="org-right" />
-
-<col class="org-left" />
-
-<col class="org-left" />
-</colgroup>
-<thead>
-<tr>
-<th scope="col" class="org-right">DEC</th>
-<th scope="col" class="org-left">HEX</th>
-<th scope="col" class="org-left">function</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td class="org-right">0 - 15</td>
-<td class="org-left">0 - F</td>
-<td class="org-left">HEX numbers</td>
-</tr>
-
-<tr>
-<td class="org-right">252</td>
-<td class="org-left">FC</td>
-<td class="org-left">backspace</td>
-</tr>
-
-<tr>
-<td class="org-right">253</td>
-<td class="org-left">FD</td>
-<td class="org-left">tabulator (TAB)</td>
-</tr>
-
-<tr>
-<td class="org-right">254</td>
-<td class="org-left">FE</td>
-<td class="org-left">carriage return (CR)</td>
-</tr>
-
-<tr>
-<td class="org-right">255</td>
-<td class="org-left">FF</td>
-<td class="org-left">space</td>
-</tr>
-
-<tr>
-<td class="org-right">else</td>
-<td class="org-left"> </td>
-<td class="org-left">ordinary characters, same as in ASCII.</td>
-</tr>
-</tbody>
-</table>
-</div>
-</div>
-</div>
-<div id="outline-container-orge63cf49" class="outline-2">
-<h2 id="orge63cf49"><span class="section-number-2">2.</span> Fifth commands</h2>
-<div class="outline-text-2" id="text-2">
-</div>
-<div id="outline-container-org25bc695" class="outline-3">
-<h3 id="org25bc695"><span class="section-number-3">2.1.</span> Compilation & miscellaneous</h3>
-<div class="outline-text-3" id="text-2-1">
-<p class="verse">
-init module ( – )<br />
-                First module, control is passed to on startup. Contains<br />
-                initialization routines. Also it is the last core module.<br />
-                All new modules on top of it comes as result of executing<br />
-                external source files.<br />
-<br />
-head <name> ( – ) compiles new dictionary entry without specifying<br />
-                new module type.<br />
-                ex: head myentry<br />
-<br />
-: <name> ( – ) creates new code module<br />
-; ( – ) ends module (immideate)<br />
-                ex: : hello ." hi there" ;<br />
-<br />
-const <name> ( n – ) defines new constant.<br />
-                ex: 2147483647 const max<br />
-<br />
-:i <name> ( – ) same as ":" but this module will be executed<br />
-                immideately even in compile mode.<br />
-                ex: :i ( 41 scan ;<br />
-<br />
-create <name> ( – ) same as "head" , but specify module type as data.<br />
-                ex: create LotoResults 5 , 13 , 52 , 12 , 11 , 3 ,<br />
-<br />
-allot ( n – ) allocate n bytes in dictionary.<br />
-                ex: create MyArray 100 allot<br />
-<br />
-" <string>" ( – ) compile string and its size into core.<br />
-                ex: create Mystring " This is it's contects"<br />
-<br />
-str <name> <string>" ( – ) just shorter way for defining strings.<br />
-                ex: str Mystring This is it's contenc"<br />
-<br />
-var <name> ( – ) define new 32 bit variable.<br />
-                ex: var result<br />
-<br />
-' <module> ( – n ) return memory address of given entry.<br />
-                ex: ' init<br />
-<br />
-forget <name> ( – ) erases from RAM given entry and all entries what was<br />
-                defined after it.<br />
-                ex: forget myprog<br />
-<br />
-[ ( – ) set interpret mode (immideate)<br />
-] ( n – ) set compile mode and compile top stack element<br />
-                in as literal. Together [ …. ] cobination provides good<br />
-                way to compute some values only once, at compile time,<br />
-                rather than every time while program is running.<br />
-                ex: : calculate - [ 4 MyConst1 + MyConst2 * ] ;<br />
-<br />
-defer <name> ( – ) creates new module, with jump instruction.<br />
-                Later address where to jump can be modified by "is" command.<br />
-                This provides method of foward referencing. So you can use<br />
-                modules what not jet exist.<br />
-is ( address1 address2 – ) address1 - where to jump, address2 -<br />
-                address of module created by defer command.<br />
-                ex: defer dispver<br />
-                        : run dispver ." running …" ;<br />
-                               … whatever …<br />
-                        : (dispver ." Version 9.99 " ;<br />
-                        ' (dispver ' dispver is<br />
-<br />
-                Now if I type "run" on the screen appears:<br />
-                        Version 9.99 running …<br />
-<br />
-asc <char> ( – ) reads char ascii code and treats it as literal.<br />
-                (immideate)<br />
-                ex: : BreakLine 30 do asc - emit loop ;<br />
-                                 same as:<br />
-                    : BreakLine 30 do 45 emit loop ;<br />
-<br />
-dyninc ( handle – ) execute code in dynamic memory handle.<br />
-                automatically deallocates it when done.<br />
-<br />
-include ( filenumber – ) execute code in specified file.<br />
-<br />
-words ( – ) display existing blocks in core.<br />
-<br />
-bye ( – ) exit from Fifth<br />
-<br />
-fkey ( – c )<br />
-                Read one byte from input stream.<br />
-<br />
-sadd ( c addr – )<br />
-                Add one byte "c" to string located at "addr" and updates<br />
-                string length.<br />
-<br />
-scan ( c – )<br />
-                Read input stream and store it to pad until it finds c .<br />
-                It ignores all "c" bytes until it finds any non "c" byte.<br />
-                in other words:<br />
-                                c is: "<br />
-                         input stream: """"This is test !"aoeu idh<br />
-                               result: This is test !<br />
-<br />
-                Is useful for breaking text lines into words.<br />
-<br />
-skey ( – c )<br />
-                So called safe "fkey". Reads data from input stream<br />
-                but converts characters with ASCII codes: 9 13 10<br />
-                to spaces.<br />
-<br />
-str=str? ( adr1 adr2 – result )<br />
-                Compares string at "adr1" with string at "adr2", returns<br />
-                true flag if they are equal or false if they are not.<br />
-                true = -1<br />
-                false = 0<br />
-<br />
-find ( – addr )<br />
-                Searches whole dictionary for word in "pad". If found,<br />
-                returns it address, if not, returns 0.<br />
-<br />
-execute ( – )<br />
-                Execute word located in "pad". Depending on "mode".<br />
-<br />
-dta ( addr – DataAddr )<br />
-                Calculates address of dictionary entry data area, from<br />
-                entry point.<br />
-<br />
-2num ( – num result )<br />
-                Attempt to convert string located in "pad" into numeric<br />
-                value. If succeed returns number and true as result.<br />
-                If not, returns whatever and false as result.<br />
-<br />
-dadd ( addr length – )<br />
-                Add to dictionary data located at "addr", with specified<br />
-                length.<br />
-<br />
-lit ( n – )<br />
-                Act with number depending on "mode". When interpreting,<br />
-                leaves it in stack.<br />
-<br />
-<br />
-incmod ( addr – )<br />
-                Add to dictionary data located at "addr"+1 , length is taken<br />
-                from "addr".<br />
-<br />
-here ( – n )<br />
-                return "h" contents.<br />
-<br />
-mode var 8 bit<br />
-                Holds input stream parser operation mode.<br />
-                0 = interpreting<br />
-                1 = compiling<br />
-<br />
-pad var 128 bytes<br />
-                Holds temprorary strings.<br />
-<br />
-h var 32 bit<br />
-                Pointer to free byte in memory, always at the end of the<br />
-                dictionary. Each time when something is stored<br />
-                by "c," command, pointer is incareased.<br />
-<br />
-lp var 32 bit<br />
-                Pointer to last dictionary word. Each time when new word is<br />
-                compiled or erased by "forget", this pointer is updated.<br />
-<br />
-modulechk ( Dstr<filename> – ) check if module is loaded, if not<br />
-                immideately load it.<br />
-<br />
-ne ( entrydata entrytype – ) Compile new dictionary entry.<br />
-                It's name must be in "pad".<br />
-</p>
-</div>
-</div>
-<div id="outline-container-orgc47a7bb" class="outline-3">
-<h3 id="orgc47a7bb"><span class="section-number-3">2.2.</span> Conditionals & control flow</h3>
-<div class="outline-text-3" id="text-2-2">
-<p class="verse">
-if ( flag – ) (immideate)<br />
-                "if 1.. else 2.. then" or<br />
-                "if 1.. then" construction. Conditional execution.<br />
-                Performs "1.." if "flag" was true,<br />
-                elseway performs "2.." if exist. Execution continues after<br />
-                word "then".<br />
-                ex: 1 if ." nonzero" else ." zero" then<br />
-<br />
->= ( n1 n2 – result ) true if (n1 = n2) or (n1 > n2)<br />
-                ex: 5 3 >= if ." first number is greater or equal" then<br />
-<br />
-<= ( n1 n2 – result ) true if (n1 = n2) or (n1 < n2)<br />
-= ( n1 n2 – result ) true if n1 = n2<br />
-<br />
-do ( count – ) (immideate)<br />
-                "do .. loop" construction. Performs ".." "count" times.<br />
-                In every step "count" is decareased until it is 0.<br />
-                ex: : test 5 do i .d loop ;<br />
-                result: 4 3 2 1 0<br />
-<br />
-doexit ( – ) exit from "do .. loop"<br />
-<br />
-for ( count top – ) (immideate)<br />
-                "for .. loop" construction. Performs ".." (top - count) times.<br />
-                In every step "count" is incareased until it reaches "top" .<br />
-                ex: : test 4 10 for i .d loop ;<br />
-                result: 4 5 6 7 8 9<br />
-<br />
-forexit ( – ) exit from "for .. loop"<br />
-<br />
-until ( – ) (immideate)<br />
-                "until .. loop" construction. Performs ".." until flag become<br />
-                true. False by default. Top of return stack holds flag.<br />
-<br />
-done ( – ) exit from "until .. loop"<br />
-<br />
-</p>
-</div>
-</div>
-<div id="outline-container-org572f33f" class="outline-3">
-<h3 id="org572f33f"><span class="section-number-3">2.3.</span> Disk & file access</h3>
-<div class="outline-text-3" id="text-2-3">
-<p class="verse">
-diskload ( FromDisk ToMem amount – )<br />
-                Load specified abount of bytes from disk into memory.<br />
-<br />
-disksave ( FromMem ToDisk amount – )<br />
-                save specified abount of bytes from memory into disk.<br />
-<br />
-format ( – ) Erase all files.<br />
-<br />
-fsDfilesize@ ( handle – size )<br />
-                Return size of opened file.<br />
-<br />
-fsDcurloc@ ( handle – location )<br />
-                Return current location in file.<br />
-<br />
-fsDupdated@ ( handle – updated? )<br />
-                Return true if file was updated,<br />
-                ie. write operations occured.<br />
-<br />
-fssave ( FromMem DestFileHandle amount – )<br />
-                Save data to file.<br />
-<br />
-fsload ( SrcFileHandle ToMem amount – )<br />
-                Load data from file.<br />
-<br />
-fseof ( handle – bytesLeft )<br />
-                Return amount of bytes left till end of file.<br />
-                Useful before read operation.<br />
-<br />
-fsls ( – ) List all files and lists (directories,folders)<br />
-                in current path.<br />
-<br />
-fslsr ( – ) Same as "fsls" but recursively scans also sub lists.<br />
-<br />
-fscl ( DynStrHand – )<br />
-                Change list (path)<br />
-<br />
-fscreate ( DynStrHand – DescPnt )<br />
-                Create new file or list. Can create multiple lists at once.<br />
-                ex: when creating:<br />
-                    "\listGAMES\listSTRATEGY\listSIMWORLD\5th-runme"<br />
-                and only "\listGAMES\" already exist, then<br />
-                "listSTRATEGY" and "listSIMWORLD" lists will be created,<br />
-                and empty file "5th-runme" placed in there.<br />
-<br />
-fsDsave ( DynHand<data> DynStrHand<filename> – )<br />
-                Create new file and save all data from dynamic memory<br />
-                block to it.<br />
-<br />
-fsDload ( DynStr<SrcFileName> DynHand<DataDest> – )<br />
-                Load whole file into dynamic memory block.<br />
-<br />
-fsDloadnew ( DynStr<SrcFileName> – DynHand<DataDest> )<br />
-                Load whole file into new dynamic memory block.<br />
-</p>
-</div>
-</div>
-<div id="outline-container-org89deb72" class="outline-3">
-<h3 id="org89deb72"><span class="section-number-3">2.4.</span> Dynamic memory</h3>
-<div class="outline-text-3" id="text-2-4">
-<p class="verse">
-dynal ( size – handle )<br />
-                Allocate dynamic memory block and return it's handle.<br />
-<br />
-dynde ( handle – )<br />
-                Deallocate dynamic memory block.<br />
-<br />
-dynp ( handle – addr )<br />
-                Returns pointer to memory where dynamic block<br />
-                data begins.<br />
-<br />
-dyns ( handle – size )<br />
-                Returns size of dynamic block.<br />
-<br />
-dynresize ( NewSize handle – )<br />
-                Nondestructively resize dynamic block.<br />
-<br />
-dync@ ( addr handle )<br />
-                Read one byte from dynamic block.<br />
-<br />
-dync! ( byte addr dynhandle )<br />
-                Write one byte to dynamic block.<br />
-<br />
-dyn@ ( addr handle )<br />
-                Read 32 bit number from dynamic block.<br />
-                Address will spacify, whitch number, not byte.<br />
-<br />
-dyn! ( 32BitNum addr dynhandle )<br />
-                Write 32 bit number to dynamic block.<br />
-                Address will spacify, whitch number, not byte.<br />
-<br />
-dyncon ( size "name" – )<br />
-                Allocate dynamic block with specified size, and<br />
-                create constant honding its handle.<br />
-                ex: 100 dyncon MyNewBlock<br />
-<br />
-dyn. ( handle – )<br />
-                Write contenc of dynamic memory block to screen.<br />
-</p>
-</div>
-</div>
-<div id="outline-container-orgea457a7" class="outline-3">
-<h3 id="orgea457a7"><span class="section-number-3">2.5.</span> Graphics and text</h3>
-<div class="outline-text-3" id="text-2-5">
-<p class="verse">
-. ( n – ) print number on screen<br />
-<br />
-d. ( n – ) print number on screen in decimal<br />
-<br />
-? ( addr – ) print 32 bit value located at addr.<br />
-<br />
-." <string>" ( – ) print string into screen. Immideately<br />
-                compiles.<br />
-                ex: : greeting ." Hello, World" ;<br />
-<br />
-tab. ( – ) print tabulator<br />
-<br />
-calccol ( b g r – c ) calculate color what best matches given<br />
-                Blue Green & Red values. Values must be in range 0 - 255.<br />
-<br />
-imgalloc ( xsize ysize – imgbuf ) allocate image buffer for<br />
-                specified size.<br />
-<br />
-imgsize ( imgbuf – ) print on the screen X & Y size of image<br />
-                buffer.<br />
-<br />
-point ( x y imgbuf – addr ) returns memory address for specified<br />
-                pixel.<br />
-<br />
-pset ( color x y imgbuf – ) set graphic point<br />
-<br />
-boxf ( x1 x2 y1 y2 imgbuf color – ) draw filled box<br />
-<br />
-cls ( imgbuf – ) clear image buffer<br />
-<br />
-setpal ( b g r color – ) set palette value for specified color.<br />
-                values bust be in size 0 - 63.<br />
-<br />
-putchar ( char color x y imgbuf – ) put graphic character in<br />
-                imagebuffer to specified (x & y) location.<br />
-<br />
-scroll ( x y imgbuf – ) scroll in imgbuf.<br />
-<br />
-scrollf ( color x y screen – ) scroll and fill empty space with<br />
-                given color.<br />
-<br />
-at! ( x y – ) set cursor location<br />
-curc! ( color – ) set text color<br />
-curb! ( solor – ) set backround color<br />
-<br />
-colnorm ( – ) set text color to normal<br />
-colneg ( – ) set text color to negative (selected)<br />
-<br />
-dyntype ( dynhandle – ) display contenc of dynamic memory on screen<br />
-fsdisp ( file – ) clear screen, display file, and wait for key<br />
-<br />
-type ( addr length – )<br />
-                Types on the screen string, from memory at addr and<br />
-                specified length.<br />
-<br />
-write ( addr – )<br />
-                Types on the screen string, from memory at "addr"+1<br />
-                length is taken from "addr" .<br />
-<br />
-screen const 32 bit<br />
-                Holds handle of screen buffer.<br />
-<br />
-copyscreen ( SrcImgHandle DestImgHandle – ) copy contenc of source<br />
-                image to destination image. Source and destination images<br />
-                must have same size.<br />
-</p>
-</div>
-</div>
-<div id="outline-container-orge721086" class="outline-3">
-<h3 id="orge721086"><span class="section-number-3">2.6.</span> Math, memory & stack manipulation</h3>
-<div class="outline-text-3" id="text-2-6">
-<p class="verse">
-off ( n – ) writes 0 to given address, good for zeroing variable.<br />
-                ex: MyVariable off<br />
-on ( n – ) writes -1 (true flag) to given address.<br />
-                ex: MyVariable on<br />
-<br />
-2dup ( n1 n2 – n1 n2 n1 n2 )<br />
-2drop ( n1 n2 – )<br />
-nip ( n1 n2 – n2 )<br />
-neg ( n1 – -n1 ) negotiate<br />
-bit@ ( n bit – result ) return specified bit from n.<br />
-                ex: 38 2 bit@ (result will be 1)<br />
-to32bit ( n1 n2 n3 n4 – n32 ) treat 4 last stack elements as bytes<br />
-                and unite them into 32 bit dword. Most significant byte<br />
-                on top.<br />
-                ex: 12 76 23 11 to32bit result: 186076172<br />
-<br />
-to8bit ( n32 – n1 n2 n3 n4 ) break 32 bit number into 4 bytes.<br />
-                Useful if you need to send 32 bit numbers thru 8 bit COM<br />
-                port.<br />
-                ex: 186076172 to8bit result: 12 76 23 11<br />
-<br />
-mod ( n1 n2 – reminder ) divide n1 by n2 and returns reminder.<br />
-                ex: 12 5 mod result: 2<br />
-<br />
-bound ( low n high – n ) check if n is in given bounds,<br />
-                if not then incarease/decarease it to match bounds.<br />
-                ex: 5 80 15 bound result: 15<br />
-                    5 10 15 bound result: 10<br />
-                    5 -10 15 bound result: 5<br />
-<br />
-bound? ( low n high – result ) returns true if n is in the<br />
-                given bounds.<br />
-<br />
-tab ( col – spaces) calculate amount of spaces to add<br />
-                ta reach next tabulation from given column.<br />
-<br />
-count ( addr – addr+1 n )<br />
-                Useful for returning bytes from constantly incareasing<br />
-                address. Module "type" is nice example.<br />
-<br />
-c, ( n – )<br />
-                store one byte at memory specified by "h". And incarease<br />
-                "h" by 1.<br />
-<br />
-, ( n – )<br />
-                store 32 bit number at memory specified by "h". And<br />
-                incarease "h" by 4.<br />
-<br />
-cmove ( addr1 addr2 n – )<br />
-                copy "n" amount of bytes from memory at "addr1" to memory<br />
-                at "addr2".<br />
-<br />
-rnd ( limit – result )<br />
-                generates random number in range 0 to "limit"-1.<br />
-<br />
-abs ( n – |n| )<br />
-                returns absolute value of "n"<br />
-</p>
-</div>
-</div>
-<div id="outline-container-orgf17027f" class="outline-3">
-<h3 id="orgf17027f"><span class="section-number-3">2.7.</span> Dynamic & static strings</h3>
-<div class="outline-text-3" id="text-2-7">
-<p>
-Fifth supports both static and dynamic strings. Static strings must
-have predefined space reserved, and string mustn't exceed this
-length. They manipulation is faster. But they use more memory. Static
-string memory address is used to refer to the string.
-</p>
-
-<p>
-Dynamic strings can have at any time length form 0 to 0FFh, They take
-up only memory they currently need. They are held in dynamic memory
-blocks, so dynamic block handle is used to refer to this string.
-</p>
-
-<p>
-Both types of strings are stored in the way, where first (0th) byte
-holds current string length, following bytes are string itself.
-</p>
-
-
-<p class="verse">
-Dynamic:<br />
-<br />
-Dstral ( – handle )<br />
-                Allocate new string.<br />
-<br />
-Dstrlen ( handle – length )<br />
-                Return string length.<br />
-<br />
-c+Dstr ( chr handle – )<br />
-                Add one byte to end of the string.<br />
-<br />
-c+lDstr ( chr handle – )<br />
-                Add one byte to left side (beginning) of the string.<br />
-<br />
-Dstr. ( handle – )<br />
-                Write contec of string into screen.<br />
-<br />
-Dstrsure ( size Dstr – )<br />
-                Makes sure that at least rquested<br />
-                "size" (amount of characters) is allocated for given<br />
-                dynamic string.<br />
-<br />
-Dstr2str ( handle address – )<br />
-                Copy dyamic string into static memory space.<br />
-<br />
-str2Dstr ( address handle – )<br />
-                Copy static string into dyamic string.<br />
-<br />
-Dstr+str ( Dstr addr – )<br />
-                Add contenc of dynamic string to static string.<br />
-<br />
-D" any string" ( – Dstr )<br />
-                Moves specified string into dynamic string called "defDstr".<br />
-<br />
-D> any_string ( – Dstr )<br />
-                Moves specified string into dynamic string called "defDstr".<br />
-                Space marks end of string!<br />
-<br />
-D>2 any_string ( – Dstr )<br />
-                Moves specified string into dynamic string called "defDstr2".<br />
-                Space marks end of string!<br />
-<br />
-Dstr+Dstr ( Dstr1 Dstr2 – )<br />
-                Adds "Dstr1" to "Dstr2" and places result into "Dstr2".<br />
-<br />
-Dstrclear ( Dstr – )<br />
-                Clears contenc of dynamic string.<br />
-<br />
-Dstr2Dstr ( Dstr1 Dstr2 – )<br />
-                Moves "Dstr1" to "Dstr2".<br />
-Dstr ( data" name – )<br />
-                Creates new dynamic string and moves specified data into it.<br />
-                Then creates new constant with given "name" holding created<br />
-                dynamic string handle.<br />
-<br />
-                ex: Dstr Hello, my name is Sven!" message \ creates it<br />
-                    message Dstr. \ tests it<br />
-<br />
-Dstrlscan ( char Dstr – loc )<br />
-                Searches dynamic string for "char", from left to right,<br />
-                returns first found "char" location in string, or 0,<br />
-                if not found.<br />
-<br />
-Dstrrscan ( char Dstr – loc )<br />
-                Searches dynamic string for "char", from right to left,<br />
-                returns first found "char" location in string, or 0,<br />
-                if not found.<br />
-<br />
-Dstrlscane ( char Dstr – loc )<br />
-                Same as "Dstrlscan" buf returns string length+1 as location.<br />
-ÿ<br />
-Dstrleft ( amo Dstr – )<br />
-                Only specified amount of characters from left remains<br />
-                in dynamic string. ie. cut right part out.<br />
-<br />
-Dstrright ( amo Dstr – )<br />
-                Only specified amount of characters from right remains<br />
-                in dynamic string. ie. cut left part out.<br />
-<br />
-Dstrcutl ( amo Dstr – )<br />
-                Cut specified amount of characters from left of dynamic<br />
-                string out.<br />
-<br />
-Dstrsp ( char Dstr1 Dstr2 – )<br />
-                Separate dynamic string in Dstr1 into two parts,<br />
-                using "char" as separator. First part will be stored in<br />
-                "Dstr2", second part in "Dstr1".<br />
-                ex: asc \ \ ..separator<br />
-                    D> listF\listLIB\5TH_DRVMOUSE \ ..separate from<br />
-                    defDstr2 \ ..place result in<br />
-                    Dstrsp \ separation command<br />
-                    defDstr Dstr. \ will be: listLIB\5TH_DRVMOUSE<br />
-                    defDstr2 Dstr. \ will be: listF<br />
-<br />
-Dv ( addr – )<br />
-                Allocates empty dynamic string, and places it's handle<br />
-                into given address.<br />
-<br />
-Df ( addr – )<br />
-                Reads dynamic string handle from given address and<br />
-                deallocates (frees) it.<br />
-<br />
-ex: var mystring1<br />
-        : testmodule<br />
-        mystring1 Dv \ allocates string<br />
-<br />
-                <whatever><br />
-<br />
-        mystring1 Df ; \ deallocates it again when no longer needed.<br />
-</p>
-</div>
-</div>
-</div>
-</div>
-<div id="postamble" class="status">
-<p class="author">Author: Svjatoslav Agejenko</p>
-<p class="date">Created: 2023-09-19 Tue 18:07</p>
-<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
-</div>
-</body>
-</html>