-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
+<!doctype html>
+<html lang="en">
<head>
-<meta
- http-equiv="Content-Type"
- content="text/html; charset=UTF-8">
-<title>FIFTH</title>
+<title>Fifth - virtual machine, operating system, programming language</title>
+<!-- 2017-01-21 Sat 22:20 -->
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<meta name="generator" content="Org-mode">
+<meta name="author" content="Svjatoslav Agejenko">
+<link href="https://bootswatch.com/darkly/bootstrap.min.css" rel="stylesheet">
+<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>"
+<style type="text/css">
+footer {background-color: #111 !important;}
+pre {background-color: #111; color: #ccc;}
+</style>
+<style type="text/css">
+/* org mode styles on top of twbs */
+
+html {
+ position: relative;
+ min-height: 100%;
+}
+
+body {
+ font-size: 18px;
+ margin-bottom: 105px;
+}
+
+footer {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ height: 101px;
+ background-color: #f5f5f5;
+}
+
+footer > div {
+ padding: 10px;
+}
+
+footer p {
+ margin: 0 0 5px;
+ text-align: center;
+ font-size: 16px;
+}
+
+#table-of-contents {
+ margin-top: 20px;
+ margin-bottom: 20px;
+}
+
+blockquote p {
+ font-size: 18px;
+}
+
+pre {
+ font-size: 16px;
+}
+
+.footpara {
+ display: inline-block;
+}
+
+figcaption {
+ font-size: 16px;
+ color: #666;
+ font-style: italic;
+ padding-bottom: 15px;
+}
+
+/* from twbs docs */
+
+.bs-docs-sidebar.affix {
+ position: static;
+}
+@media (min-width: 768px) {
+ .bs-docs-sidebar {
+ padding-left: 20px;
+ }
+}
+
+/* All levels of nav */
+.bs-docs-sidebar .nav > li > a {
+ display: block;
+ padding: 4px 20px;
+ font-size: 14px;
+ font-weight: 500;
+ color: #999;
+}
+.bs-docs-sidebar .nav > li > a:hover,
+.bs-docs-sidebar .nav > li > a:focus {
+ padding-left: 19px;
+ color: #A1283B;
+ text-decoration: none;
+ background-color: transparent;
+ border-left: 1px solid #A1283B;
+}
+.bs-docs-sidebar .nav > .active > a,
+.bs-docs-sidebar .nav > .active:hover > a,
+.bs-docs-sidebar .nav > .active:focus > a {
+ padding-left: 18px;
+ font-weight: bold;
+ color: #A1283B;
+ background-color: transparent;
+ border-left: 2px solid #A1283B;
+}
+
+/* Nav: second level (shown on .active) */
+.bs-docs-sidebar .nav .nav {
+ display: none; /* Hide by default, but at >768px, show it */
+ padding-bottom: 10px;
+}
+.bs-docs-sidebar .nav .nav > li > a {
+ padding-top: 1px;
+ padding-bottom: 1px;
+ padding-left: 30px;
+ font-size: 12px;
+ font-weight: normal;
+}
+.bs-docs-sidebar .nav .nav > li > a:hover,
+.bs-docs-sidebar .nav .nav > li > a:focus {
+ padding-left: 29px;
+}
+.bs-docs-sidebar .nav .nav > .active > a,
+.bs-docs-sidebar .nav .nav > .active:hover > a,
+.bs-docs-sidebar .nav .nav > .active:focus > a {
+ padding-left: 28px;
+ font-weight: 500;
+}
+
+/* Nav: third level (shown on .active) */
+.bs-docs-sidebar .nav .nav .nav {
+ padding-bottom: 10px;
+}
+.bs-docs-sidebar .nav .nav .nav > li > a {
+ padding-top: 1px;
+ padding-bottom: 1px;
+ padding-left: 40px;
+ font-size: 12px;
+ font-weight: normal;
+}
+.bs-docs-sidebar .nav .nav .nav > li > a:hover,
+.bs-docs-sidebar .nav .nav .nav > li > a:focus {
+ padding-left: 39px;
+}
+.bs-docs-sidebar .nav .nav .nav > .active > a,
+.bs-docs-sidebar .nav .nav .nav > .active:hover > a,
+.bs-docs-sidebar .nav .nav .nav > .active:focus > a {
+ padding-left: 38px;
+ font-weight: 500;
+}
+
+/* Show and affix the side nav when space allows it */
+@media (min-width: 992px) {
+ .bs-docs-sidebar .nav > .active > ul {
+ display: block;
+ }
+ /* Widen the fixed sidebar */
+ .bs-docs-sidebar.affix,
+ .bs-docs-sidebar.affix-bottom {
+ width: 213px;
+ }
+ .bs-docs-sidebar.affix {
+ position: fixed; /* Undo the static from mobile first approach */
+ top: 20px;
+ }
+ .bs-docs-sidebar.affix-bottom {
+ position: absolute; /* Undo the static from mobile first approach */
+ }
+ .bs-docs-sidebar.affix .bs-docs-sidenav,.bs-docs-sidebar.affix-bottom .bs-docs-sidenav {
+ margin-top: 0;
+ margin-bottom: 0
+ }
+}
+@media (min-width: 1200px) {
+ /* Widen the fixed sidebar again */
+ .bs-docs-sidebar.affix-bottom,
+ .bs-docs-sidebar.affix {
+ width: 263px;
+ }
+}
+</style>
+<script type="text/javascript">
+$(function() {
+ 'use strict';
+
+ $('.bs-docs-sidebar li').first().addClass('active');
+
+ $(document.body).scrollspy({target: '.bs-docs-sidebar'});
+
+ $('.bs-docs-sidebar').affix();
+});
+</script>
+
+<script type="text/x-mathjax-config">
+MathJax.Hub.Config({
+ displayAlign: "center",
+ displayIndent: "2em",
+ messageStyle: "none",
+ "HTML-CSS": {
+ scale: 100,
+ styles: {
+ ".MathJax_Display": {
+ "font-size": "100%"
+ }
+ }
+ },
+ "SVG": {
+ scale: 100,
+ styles: {
+ ".MathJax_SVG_Display": {
+ "font-size": "100%",
+ "margin-left": "-2.281em"
+ }
+ }
+ }
+});
+</script>
+<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_SVG"></script>
</head>
<body>
- <h1>FIFTH - virtual machine, operating system, programming language</h1>
- <a href="http://www2.svjatoslav.eu/gitweb/?p=fifth.git;a=snapshot;h=HEAD;sf=tgz">Download</a>
-
- <a href="http://www2.svjatoslav.eu/gitbrowse/fifth/doc/index.html">Online homepage</a>
-
- <a href="http://svjatoslav.eu/programs.jsp">Other applications hosted on svjatoslav.eu</a>
- <pre>
-<b>Program author:</b>
- Svjatoslav Agejenko
- Homepage: <a href="http://svjatoslav.eu">http://svjatoslav.eu</a>
- Email: <a href="mailto:svjatoslav@svjatoslav.eu">svjatoslav@svjatoslav.eu</a>
-
-This software is distributed under <a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU GENERAL PUBLIC LICENSE Version 2</a>.
-
-<h2>Introduction</h2>
-
-Fifth is programming lanquage & operating system, running on
-<a href="emulator.html">virtual CPU</a>, with custom instruction set. It is much like
-Charles Chunk Moore's Forth, it also uses stack architecture,
-and many commands are similar. Basically I got familiar with
-concepts of Forth, and being inspired created my own system.
-<p />
-Note:
-<i>
-Current implementation does not support object oriented programming.
-While working on Fifth I got lots of cool new ideas that require reimplementation
-of everything.
-
+<div id="content" class="container">
+<div class="row"><div class="col-md-9"><h1 class="title">Fifth - virtual machine, operating system, programming language</h1>
+<hr >
+<ul class="org-ul">
+<li><a href="http://www2.svjatoslav.eu/gitweb/?p=sixth.git;a=snapshot;h=HEAD;sf=tgz">download latest snapshot</a>
+</li>
+
+<li>This program is free software; you can redistribute it and/or modify it under
+the terms of version 3 of the <a href="https://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License</a> or later as
+published by the Free Software Foundation.
+</li>
+
+<li>Program author:
+<ul class="org-ul">
+<li>Svjatoslav Agejenko
+</li>
+<li>Homepage: <a href="http://svjatoslav.eu">http://svjatoslav.eu</a>
+</li>
+<li>Email: <a href="mailto://svjatoslav@svjatoslav.eu">mailto://svjatoslav@svjatoslav.eu</a>
+</li>
+</ul>
+</li>
+
+<li><a href="http://svjatoslav.eu/programs.jsp">other applications hosted at svjatoslav.eu</a>
+</li>
+</ul>
+
+<div id="outline-container-sec-1" class="outline-2">
+<h2 id="sec-1"><span class="section-number-2">1</span> !Project deprecated!</h2>
+<div class="outline-text-2" id="text-1">
+<p>
+Current implementation does not support object oriented
+programming. While working on Fifth I got lots of cool new ideas that
+require reimplementation of everything.
+</p>
+
+<p>
Currently I try to implement those new ideas in the project called
- <a href="http://www2.svjatoslav.eu/gitbrowse/sixth/doc/index.html">Sixth</a>.
-</i>
-<br />
-<a href="shots/index.html">Screenshots</a>
-
+<a href="http://www2.svjatoslav.eu/gitbrowse/sixth/doc/index.html">Sixth</a>
+</p>
+
+<p>
+System is built many years ago when I was still using DOS as a primary
+operating system.
+</p>
+</div>
+</div>
+<div id="outline-container-sec-2" class="outline-2">
+<h2 id="sec-2"><span class="section-number-2">2</span> Introduction</h2>
+<div class="outline-text-2" id="text-2">
+<p>
+Fifth is programming lanquage & operating system, running on <i>virtual
+CPU</i>, with custom instruction set. It is much like Charles Chunk
+Moore's Forth, it also uses stack architecture, and many commands are
+similar. Basically I got familiar with concepts of Forth, and being
+inspired created my own system.
+</p>
+
+
+
+<p>
+<i>Screenshots</i>
+</p>
+
+<p>
Read more about:
-<br> <a href="emulator.html">Virtual CPU</a>
-<br> <a href="commands/index.html">Built-in commands</a>
-<br> <a href="modules/index.html">Additional commands, realized as loadable modules</a>
-<br> <a href="5TH_ET.txt">Example Fifth source file - text editor </a>
-
-
- <h2>Installation</h2>
-
+</p>
+<ul class="org-ul">
+<li><a href="emulator.html">Virtual CPU</a>
+</li>
+<li><a href="commands/index.html">Built-in commands</a>
+</li>
+<li><a href="modules/index.html">Additional commands, realized as loadable modules</a>
+</li>
+<li><a href="5TH_ET.txt">Example Fifth source file - text editor</a>
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3" class="outline-2">
+<h2 id="sec-3"><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: C:\MISC\FIFTH\....
-To run fifth you need minimally just 2 files.
-emulator itself ( EMULATOR.EXE or EMULATOR.COM ), and
-virtual disk file ( DISK.RAW ).
-Read more about <a href="files.txt">distribution directory layout</a>.
-
-
-
- <h2>Software/Hardware/Human requirements</h2>
-
-
-Software:
- MS-DOS 6.22, with HIMEM.SYS loaded.
- Mouse driver if you have a mouse.
- Does work only when CPU is in real mode.
- To recompile ASM sources I used FASM (Flat Assembler).
- I ran QBasic utilities on QB 4.5 .
- VESA support by BIOS, or external driver (UNIVBE).
-
-Hardware:
- Minimum CPU 386.
- 64 KB free RAM below 640KB,
- 2 MB of free XMS.
- VESA compatible video card.
-
-Human:
- Beginner level Forth knowledge is recommended.
- Enthusiasm.
-
-
-
- <h2>Numbers representation</h2>
-
-<img src="numbers.png">
-
-Fifth uses hexdecimal number representation as primary.
-Numbers shape is formed by dividing a square into four parts.
-And manipulating their color (black or white).
-
-
-
- <h2>Disk file map, and it's data structures</h2>
-
-
-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.
-
- disk allocation:
-
-offset length description
-
-0 ~4 Kb Fifth core
-4 Kb ~32Kb high-level boot code
-37 Kb ~65Kb FAT
-101Kb ~16MB filesystem data area
-
- FAT entry format:
-
--2 last sector
--1 empty sector
-0 -- .. pointer to next block
-
- file entry format
-
-offset length description
-
-0 4 extension
-4 16 name
-20 4 entry point
-24 4 size
-28 4 last modification time
-
-
-
- <h2>Core architecture</h2>
-
-
+somewhere in your hard disk. For example: C:\MISC\FIFTH\…. To run
+fifth you need minimally just 2 files. emulator itself ( EMULATOR.EXE
+or EMULATOR.COM ), and virtual disk file ( DISK.RAW ).
+</p>
+
+<p>
+Read more about <i>distribution directory layout</i>
+</p>
+</div>
+</div>
+<div id="outline-container-sec-4" class="outline-2">
+<h2 id="sec-4"><span class="section-number-2">4</span> Software/Hardware/Human requirements</h2>
+<div class="outline-text-2" id="text-4">
+</div><div id="outline-container-sec-4-1" class="outline-3">
+<h3 id="sec-4-1"><span class="section-number-3">4.1</span> Software:</h3>
+<div class="outline-text-3" id="text-4-1">
+<ul class="org-ul">
+<li>MS-DOS 6.22, with HIMEM.SYS loaded.
+</li>
+<li>Mouse driver if you have a mouse.
+</li>
+<li>Does work only when CPU is in real mode.
+</li>
+<li>To recompile ASM sources I used FASM (Flat Assembler).
+</li>
+<li>I ran QBasic utilities on QB 4.5 .
+</li>
+<li>VESA support by BIOS, or external driver (UNIVBE).
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-4-2" class="outline-3">
+<h3 id="sec-4-2"><span class="section-number-3">4.2</span> Hardware:</h3>
+<div class="outline-text-3" id="text-4-2">
+<ul class="org-ul">
+<li>Minimum CPU 386.
+</li>
+<li>64 KB free RAM below 640KB,
+</li>
+<li>2 MB of free XMS.
+</li>
+<li>VESA compatible video card.
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-4-3" class="outline-3">
+<h3 id="sec-4-3"><span class="section-number-3">4.3</span> Human:</h3>
+<div class="outline-text-3" id="text-4-3">
+<ul class="org-ul">
+<li>Beginner level Forth knowledge is recommended.
+</li>
+<li>Lots of enthusiasm.
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div id="outline-container-sec-5" class="outline-2">
+<h2 id="sec-5"><span class="section-number-2">5</span> Numbers representation</h2>
+<div class="outline-text-2" id="text-5">
+
+<figure>
+<p><a href="numbers.png"><img src="numbers.png" class="img-responsive" alt="numbers.png"></a>
+</p>
+</figure>
+
+<p>
+Because I can define everything, starting from CPU, why not try also
+alternative and unique number representation ?
+</p>
+
+<p>
+Fifth uses its hexdecimal number representation as primary. Numbers
+shape is formed by dividing a square into four parts. And manipulating
+their color (black or white).
+</p>
+</div>
+</div>
+<div id="outline-container-sec-6" class="outline-2">
+<h2 id="sec-6"><span class="section-number-2">6</span> Disk file map, and it's data structures</h2>
+<div class="outline-text-2" id="text-6">
+<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-sec-6-1" class="outline-3">
+<h3 id="sec-6-1"><span class="section-number-3">6.1</span> disk allocation</h3>
+<div class="outline-text-3" id="text-6-1">
+<table class="table table-striped table-bordered table-hover table-condensed">
+
+
+<colgroup>
+<col class="left">
+
+<col class="left">
+
+<col class="left">
+</colgroup>
+<thead>
+<tr>
+<th scope="col" class="text-left">offset</th>
+<th scope="col" class="text-left">length</th>
+<th scope="col" class="text-left">description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="text-left">0</td>
+<td class="text-left">~4 Kb</td>
+<td class="text-left">Fifth core</td>
+</tr>
+
+<tr>
+<td class="text-left">4 Kb</td>
+<td class="text-left">~32Kb</td>
+<td class="text-left">high-level boot code</td>
+</tr>
+
+<tr>
+<td class="text-left">37 Kb</td>
+<td class="text-left">~65Kb</td>
+<td class="text-left">FAT</td>
+</tr>
+
+<tr>
+<td class="text-left">101Kb</td>
+<td class="text-left">~16MB</td>
+<td class="text-left">filesystem data area</td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<div id="outline-container-sec-6-2" class="outline-3">
+<h3 id="sec-6-2"><span class="section-number-3">6.2</span> FAT entry format:</h3>
+<div class="outline-text-3" id="text-6-2">
+<table class="table table-striped table-bordered table-hover table-condensed">
+
+
+<colgroup>
+<col class="right">
+
+<col class="left">
+</colgroup>
+<thead>
+<tr>
+<th scope="col" class="text-right">code</th>
+<th scope="col" class="text-left">meaning</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="text-right">-2</td>
+<td class="text-left">last sector</td>
+</tr>
+
+<tr>
+<td class="text-right">-1</td>
+<td class="text-left">empty sector</td>
+</tr>
+
+<tr>
+<td class="text-right">0 --</td>
+<td class="text-left">.. pointer to next block</td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<div id="outline-container-sec-6-3" class="outline-3">
+<h3 id="sec-6-3"><span class="section-number-3">6.3</span> file entry format</h3>
+<div class="outline-text-3" id="text-6-3">
+<table class="table table-striped table-bordered table-hover table-condensed">
+
+
+<colgroup>
+<col class="right">
+
+<col class="right">
+
+<col class="left">
+</colgroup>
+<thead>
+<tr>
+<th scope="col" class="text-right">offset</th>
+<th scope="col" class="text-right">length</th>
+<th scope="col" class="text-left">description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="text-right">0</td>
+<td class="text-right">4</td>
+<td class="text-left">extension</td>
+</tr>
+
+<tr>
+<td class="text-right">4</td>
+<td class="text-right">16</td>
+<td class="text-left">name</td>
+</tr>
+
+<tr>
+<td class="text-right">20</td>
+<td class="text-right">4</td>
+<td class="text-left">entry point</td>
+</tr>
+
+<tr>
+<td class="text-right">24</td>
+<td class="text-right">4</td>
+<td class="text-left">size</td>
+</tr>
+
+<tr>
+<td class="text-right">28</td>
+<td class="text-right">4</td>
+<td class="text-left">last modification time</td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+</div>
+<div id="outline-container-sec-7" class="outline-2">
+<h2 id="sec-7"><span class="section-number-2">7</span> Core architecture</h2>
+<div class="outline-text-2" id="text-7">
+<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.
-
-
- dictionary entry format
-
-offset length description
-
-0 4 0 < previous entry
- 0 = last
- -1 = empty
-4 15 module name string
-19 1 entry type
-20 4 entry data
-
-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.
-
- Possible module types
-
-type description "execute" action
-
-0 data compile "num" instruction
- with address to module
-1 submodule compile "call" instruction
- with address to module
-2 imm. submodule immediately call to module
-
-
- Memory map: (average)
-
-<loc> <size> <desc>
-0 ~4096 core
-1500000 ~32000 highlevel Fifth boot code
-200000h core startup messages area
-5200000 end of dynamic memory space
-
-
-
- <h2>Fifth source format</h2>
-
-
-Fifth uses a different character table and codes than ASCII.
-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.
-
- FSCII:
-
-DEC HEX function
-
-0 - 15 0 - F HEX numbers
-252 FC backspace
-253 FD tabulator (TAB)
-254 FE carriage return (CR)
-255 FF space
-
-else ordinary characters, like in ASCII.
-
-
-
-
-
- </pre>
+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-sec-7-1" class="outline-3">
+<h3 id="sec-7-1"><span class="section-number-3">7.1</span> dictionary entry format</h3>
+<div class="outline-text-3" id="text-7-1">
+<table class="table table-striped table-bordered table-hover table-condensed">
+
+
+<colgroup>
+<col class="right">
+
+<col class="right">
+
+<col class="left">
+</colgroup>
+<thead>
+<tr>
+<th scope="col" class="text-right">offset</th>
+<th scope="col" class="text-right">length</th>
+<th scope="col" class="text-left">description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="text-right">0</td>
+<td class="text-right">4</td>
+<td class="text-left">0 &lt; previous entry</td>
+</tr>
+
+<tr>
+<td class="text-right"> </td>
+<td class="text-right"> </td>
+<td class="text-left">0 = last</td>
+</tr>
+
+<tr>
+<td class="text-right"> </td>
+<td class="text-right"> </td>
+<td class="text-left">-1 = empty</td>
+</tr>
+</tbody>
+<tbody>
+<tr>
+<td class="text-right">4</td>
+<td class="text-right">15</td>
+<td class="text-left">module name string</td>
+</tr>
+</tbody>
+<tbody>
+<tr>
+<td class="text-right">19</td>
+<td class="text-right">1</td>
+<td class="text-left">entry type</td>
+</tr>
+</tbody>
+<tbody>
+<tr>
+<td class="text-right">20</td>
+<td class="text-right">4</td>
+<td class="text-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-sec-7-2" class="outline-3">
+<h3 id="sec-7-2"><span class="section-number-3">7.2</span> Possible module types</h3>
+<div class="outline-text-3" id="text-7-2">
+<table class="table table-striped table-bordered table-hover table-condensed">
+
+
+<colgroup>
+<col class="right">
+
+<col class="left">
+
+<col class="left">
+</colgroup>
+<thead>
+<tr>
+<th scope="col" class="text-right">type</th>
+<th scope="col" class="text-left">description</th>
+<th scope="col" class="text-left">"execute" action</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="text-right">0</td>
+<td class="text-left">data</td>
+<td class="text-left">compile "num" instruction</td>
+</tr>
+
+<tr>
+<td class="text-right"> </td>
+<td class="text-left"> </td>
+<td class="text-left">with address to module</td>
+</tr>
+</tbody>
+<tbody>
+<tr>
+<td class="text-right">1</td>
+<td class="text-left">submodule</td>
+<td class="text-left">compile "call" instruction</td>
+</tr>
+
+<tr>
+<td class="text-right"> </td>
+<td class="text-left"> </td>
+<td class="text-left">with address to module</td>
+</tr>
+</tbody>
+<tbody>
+<tr>
+<td class="text-right">2</td>
+<td class="text-left">imm. submodule</td>
+<td class="text-left">immediately call to module</td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<div id="outline-container-sec-7-3" class="outline-3">
+<h3 id="sec-7-3"><span class="section-number-3">7.3</span> Memory map: (average)</h3>
+<div class="outline-text-3" id="text-7-3">
+<table class="table table-striped table-bordered table-hover table-condensed">
+
+
+<colgroup>
+<col class="right">
+
+<col class="left">
+
+<col class="left">
+</colgroup>
+<thead>
+<tr>
+<th scope="col" class="text-right"><loc></th>
+<th scope="col" class="text-left"><size></th>
+<th scope="col" class="text-left"><desc></th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="text-right">0</td>
+<td class="text-left">~4096</td>
+<td class="text-left">core</td>
+</tr>
+
+<tr>
+<td class="text-right">1500000</td>
+<td class="text-left">~32000</td>
+<td class="text-left">highlevel Fifth boot code</td>
+</tr>
+
+<tr>
+<td class="text-right">200000h</td>
+<td class="text-left"> </td>
+<td class="text-left">core startup messages area</td>
+</tr>
+
+<tr>
+<td class="text-right">5200000</td>
+<td class="text-left"> </td>
+<td class="text-left">end of dynamic memory space</td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+</div>
+<div id="outline-container-sec-8" class="outline-2">
+<h2 id="sec-8"><span class="section-number-2">8</span> Fifth source format</h2>
+<div class="outline-text-2" id="text-8">
+<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-sec-8-1" class="outline-3">
+<h3 id="sec-8-1"><span class="section-number-3">8.1</span> FSCII:</h3>
+<div class="outline-text-3" id="text-8-1">
+<table class="table table-striped table-bordered table-hover table-condensed">
+
+
+<colgroup>
+<col class="right">
+
+<col class="left">
+
+<col class="left">
+</colgroup>
+<thead>
+<tr>
+<th scope="col" class="text-right">DEC</th>
+<th scope="col" class="text-left">HEX</th>
+<th scope="col" class="text-left">function</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="text-right">0 - 15</td>
+<td class="text-left">0 - F</td>
+<td class="text-left">HEX numbers</td>
+</tr>
+
+<tr>
+<td class="text-right">252</td>
+<td class="text-left">FC</td>
+<td class="text-left">backspace</td>
+</tr>
+
+<tr>
+<td class="text-right">253</td>
+<td class="text-left">FD</td>
+<td class="text-left">tabulator (TAB)</td>
+</tr>
+
+<tr>
+<td class="text-right">254</td>
+<td class="text-left">FE</td>
+<td class="text-left">carriage return (CR)</td>
+</tr>
+
+<tr>
+<td class="text-right">255</td>
+<td class="text-left">FF</td>
+<td class="text-left">space</td>
+</tr>
+
+<tr>
+<td class="text-right">else</td>
+<td class="text-left"> </td>
+<td class="text-left">ordinary characters, same as in ASCII.</td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+</div>
+</div><div class="col-md-3"><nav id="table-of-contents">
+<div id="text-table-of-contents" class="bs-docs-sidebar">
+<ul class="nav">
+<li><a href="#sec-1">1. !Project deprecated!</a></li>
+<li><a href="#sec-2">2. Introduction</a></li>
+<li><a href="#sec-3">3. Installation</a></li>
+<li><a href="#sec-4">4. Software/Hardware/Human requirements</a>
+<ul class="nav">
+<li><a href="#sec-4-1">4.1. Software:</a></li>
+<li><a href="#sec-4-2">4.2. Hardware:</a></li>
+<li><a href="#sec-4-3">4.3. Human:</a></li>
+</ul>
+</li>
+<li><a href="#sec-5">5. Numbers representation</a></li>
+<li><a href="#sec-6">6. Disk file map, and it's data structures</a>
+<ul class="nav">
+<li><a href="#sec-6-1">6.1. disk allocation</a></li>
+<li><a href="#sec-6-2">6.2. FAT entry format:</a></li>
+<li><a href="#sec-6-3">6.3. file entry format</a></li>
+</ul>
+</li>
+<li><a href="#sec-7">7. Core architecture</a>
+<ul class="nav">
+<li><a href="#sec-7-1">7.1. dictionary entry format</a></li>
+<li><a href="#sec-7-2">7.2. Possible module types</a></li>
+<li><a href="#sec-7-3">7.3. Memory map: (average)</a></li>
+</ul>
+</li>
+<li><a href="#sec-8">8. Fifth source format</a>
+<ul class="nav">
+<li><a href="#sec-8-1">8.1. FSCII:</a></li>
+</ul>
+</li>
+</ul>
+</div>
+</nav>
+</div></div></div>
+<footer id="postamble" class="">
+<div><p class="author">Author: Svjatoslav Agejenko</p>
+<p class="date">Created: 2017-01-21 Sat 22:20</p>
+<p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 24.4.1 (<a href="http://orgmode.org">Org-mode</a> 8.2.10)</p>
+</div>
+</footer>
</body>
-</html>
\ No newline at end of file
+</html>
--- /dev/null
+#+TITLE: Fifth - virtual machine, operating system, programming language
+
+-----
+- [[http://www2.svjatoslav.eu/gitweb/?p=sixth.git;a=snapshot;h=HEAD;sf=tgz][download latest snapshot]]
+
+- This program is free software; you can redistribute it and/or modify it under
+ the terms of version 3 of the [[https://www.gnu.org/licenses/lgpl.html][GNU Lesser General Public License]] or later as
+ published by the Free Software Foundation.
+
+- Program author:
+ - Svjatoslav Agejenko
+ - Homepage: http://svjatoslav.eu
+ - Email: mailto://svjatoslav@svjatoslav.eu
+
+- [[http://svjatoslav.eu/programs.jsp][other applications hosted at svjatoslav.eu]]
+
+* (document settings) :noexport:
+** use dark style for TWBS-HTML exporter
+#+HTML_HEAD: <link href="https://bootswatch.com/darkly/bootstrap.min.css" rel="stylesheet">
+#+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
+#+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>"
+#+HTML_HEAD: <style type="text/css">
+#+HTML_HEAD: footer {background-color: #111 !important;}
+#+HTML_HEAD: pre {background-color: #111; color: #ccc;}
+#+HTML_HEAD: </style>
+* !Project deprecated!
+Current implementation does not support object oriented
+programming. While working on Fifth I got lots of cool new ideas that
+require reimplementation of everything.
+
+Currently I try to implement those new ideas in the project called
+[[http://www2.svjatoslav.eu/gitbrowse/sixth/doc/index.html][Sixth]]
+
+System is built many years ago when I was still using DOS as a primary
+operating system.
+* Introduction
+Fifth is programming lanquage & operating system, running on [[emulator.html][virtual
+CPU]], with custom instruction set. It is much like Charles Chunk
+Moore's Forth, it also uses stack architecture, and many commands are
+similar. Basically I got familiar with concepts of Forth, and being
+inspired created my own system.
+
+
+
+[[shots/index.html][Screenshots]]
+
+Read more about:
+- [[file:emulator.html][Virtual CPU]]
+- [[file:commands/index.html][Built-in commands]]
+- [[file:modules/index.html][Additional commands, realized as loadable modules]]
+- [[file:5TH_ET.txt][Example Fifth source file - text editor]]
+* Installation
+Just unpack all files, witout altering original directory structure,
+somewhere in your hard disk. For example: C:\MISC\FIFTH\.... To run
+fifth you need minimally just 2 files. emulator itself ( EMULATOR.EXE
+or EMULATOR.COM ), and virtual disk file ( DISK.RAW ).
+
+Read more about [[files.txt][distribution directory layout]]
+* Software/Hardware/Human requirements
+** Software:
+- MS-DOS 6.22, with HIMEM.SYS loaded.
+- Mouse driver if you have a mouse.
+- Does work only when CPU is in real mode.
+- To recompile ASM sources I used FASM (Flat Assembler).
+- I ran QBasic utilities on QB 4.5 .
+- VESA support by BIOS, or external driver (UNIVBE).
+** Hardware:
+- Minimum CPU 386.
+- 64 KB free RAM below 640KB,
+- 2 MB of free XMS.
+- VESA compatible video card.
+** Human:
+- Beginner level Forth knowledge is recommended.
+- Lots of enthusiasm.
+* Numbers representation
+
+[[file:numbers.png][file:numbers.png]]
+
+Because I can define everything, starting from CPU, why not try also
+alternative and unique number representation ?
+
+Fifth uses its hexdecimal number representation as primary. Numbers
+shape is formed by dividing a square into four parts. And manipulating
+their color (black or white).
+* Disk file map, and it's data structures
+
+
+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.
+** disk allocation
+| offset | length | description |
+|--------+--------+----------------------|
+| 0 | ~4 Kb | Fifth core |
+| 4 Kb | ~32Kb | high-level boot code |
+| 37 Kb | ~65Kb | FAT |
+| 101Kb | ~16MB | filesystem data area |
+** FAT entry format:
+| code | meaning |
+|------+--------------------------|
+| -2 | last sector |
+| -1 | empty sector |
+| 0 -- | .. pointer to next block |
+** file entry format
+| offset | length | description |
+|--------+--------+------------------------|
+| 0 | 4 | extension |
+| 4 | 16 | name |
+| 20 | 4 | entry point |
+| 24 | 4 | size |
+| 28 | 4 | last modification time |
+* Core architecture
+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.
+** dictionary entry format
+| offset | length | description |
+|--------+--------+-----------------------|
+| 0 | 4 | 0 < previous entry |
+| | | 0 = last |
+| | | -1 = empty |
+|--------+--------+-----------------------|
+| 4 | 15 | module name string |
+|--------+--------+-----------------------|
+| 19 | 1 | entry type |
+|--------+--------+-----------------------|
+| 20 | 4 | entry data |
+
+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.
+** Possible module types
+| type | description | "execute" action |
+|------+----------------+----------------------------|
+| 0 | data | compile "num" instruction |
+| | | with address to module |
+|------+----------------+----------------------------|
+| 1 | submodule | compile "call" instruction |
+| | | with address to module |
+|------+----------------+----------------------------|
+| 2 | imm. submodule | immediately call to module |
+** Memory map: (average)
+| <loc> | <size> | <desc> |
+|---------+--------+-----------------------------|
+| 0 | ~4096 | core |
+| 1500000 | ~32000 | highlevel Fifth boot code |
+| 200000h | | core startup messages area |
+| 5200000 | | end of dynamic memory space |
+* Fifth source format
+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.
+** FSCII:
+
+| DEC | HEX | function |
+|--------+-------+----------------------------------------|
+| 0 - 15 | 0 - F | HEX numbers |
+| 252 | FC | backspace |
+| 253 | FD | tabulator (TAB) |
+| 254 | FE | carriage return (CR) |
+| 255 | FF | space |
+| else | | ordinary characters, same as in ASCII. |