1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5 http-equiv="Content-Type"
6 content="text/html; charset=UTF-8">
10 <h1>FIFTH - virtual machine, operating system, programming language</h1>
11 <a href="http://www2.svjatoslav.eu/gitweb/?p=fifth.git;a=snapshot;h=HEAD;sf=tgz">Download</a>
13 <a href="http://www2.svjatoslav.eu/gitbrowse/fifth/doc/index.html">Online homepage</a>
15 <a href="http://svjatoslav.eu/programs.jsp">Other applications hosted on svjatoslav.eu</a>
17 <b>Program author:</b>
19 Homepage: <a href="http://svjatoslav.eu">http://svjatoslav.eu</a>
20 Email: <a href="mailto:svjatoslav@svjatoslav.eu">svjatoslav@svjatoslav.eu</a>
22 This software is distributed under <a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU GENERAL PUBLIC LICENSE Version 2</a>.
26 Fifth is programming lanquage & operating system, running on
27 <a href="emulator.html">virtual CPU</a>, with custom instruction set. It is much like
28 Charles Chunk Moore's Forth, it also uses stack architecture,
29 and many commands are similar. Basically I got familiar with
30 concepts of Forth, and being inspired created my own system.
34 Current implementation does not support object oriented programming.
35 While working on Fifth I got lots of cool new ideas that require reimplementation
38 Currently I try to implement those new ideas in the project called
39 <a href="http://www2.svjatoslav.eu/gitbrowse/sixth/doc/index.html">Sixth</a>.
42 <a href="shots/index.html">Screenshots</a>
45 <br> <a href="emulator.html">Virtual CPU</a>
46 <br> <a href="commands/index.html">Built-in commands</a>
47 <br> <a href="modules/index.html">Additional commands, realized as loadable modules</a>
48 <br> <a href="5TH_ET.txt">Example Fifth source file - text editor </a>
53 Just unpack all files, witout altering original directory structure,
54 somewhere in your hard disk. For example: C:\MISC\FIFTH\....
55 To run fifth you need minimally just 2 files.
56 emulator itself ( EMULATOR.EXE or EMULATOR.COM ), and
57 virtual disk file ( DISK.RAW ).
58 Read more about <a href="files.txt">distribution directory layout</a>.
62 <h2>Software/Hardware/Human requirements</h2>
66 MS-DOS 6.22, with HIMEM.SYS loaded.
67 Mouse driver if you have a mouse.
68 Does work only when CPU is in real mode.
69 To recompile ASM sources I used FASM (Flat Assembler).
70 I ran QBasic utilities on QB 4.5 .
71 VESA support by BIOS, or external driver (UNIVBE).
75 64 KB free RAM below 640KB,
77 VESA compatible video card.
80 Beginner level Forth knowledge is recommended.
85 <h2>Numbers representation</h2>
87 <img src="numbers.png">
89 Fifth uses hexdecimal number representation as primary.
90 Numbers shape is formed by dividing a square into four parts.
91 And manipulating their color (black or white).
95 <h2>Disk file map, and it's data structures</h2>
98 Core and high-level boot code is stored outside of the filesystem to allow
99 easy access to it, at early booting time, when filesystem is not yet
104 offset length description
107 4 Kb ~32Kb high-level boot code
109 101Kb ~16MB filesystem data area
115 0 -- .. pointer to next block
119 offset length description
125 28 4 last modification time
129 <h2>Core architecture</h2>
132 Fifth core is simply some amount of already compiled into machine code
133 and linked together modules (entries in other words). In compilation
134 process modules is compiled one by one and simply stored on top of
135 already existing and growing core. Separately from core is kept
136 dictionary, this is special list that contain names of compiled modules,
137 variables etc. and they locations in core. Constants use dictionary space
138 only. Random word can be removed from dictionary at any time. Currently
139 dictionary can contain at most 1000 entries.
142 dictionary entry format
144 offset length description
146 0 4 0 < previous entry
149 4 15 module name string
153 Core headers as linked list of module names make up something like dictionary.
154 When some entry address is needed compiler can quickly run through headers
155 backwards and find needed entry.
157 Possible module types
159 type description "execute" action
161 0 data compile "num" instruction
162 with address to module
163 1 submodule compile "call" instruction
164 with address to module
165 2 imm. submodule immediately call to module
168 Memory map: (average)
172 1500000 ~32000 highlevel Fifth boot code
173 200000h core startup messages area
174 5200000 end of dynamic memory space
178 <h2>Fifth source format</h2>
181 Fifth uses a different character table and codes than ASCII.
182 I call it FSCII (Fifth Standard Code for Information Interchange)
183 for example space character is not 32 but 255 instead.
184 I plan to use mainly HEX numbers, and create new characters
185 to represent numeric values. So typical nemric characters "0123..."
186 is treated like ordinary letters.
192 0 - 15 0 - F HEX numbers
194 253 FD tabulator (TAB)
195 254 FE carriage return (CR)
198 else ordinary characters, like in ASCII.