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://php.svjatoslav.eu/gitweb/?p=fifth.git;a=snapshot;h=HEAD;sf=tgz">Download</a>
13 <a href="http://svjatoslav.eu/static/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 instructionset. It is mutch like
28 Charles Chunk Moore's Forth, it also uses stack architecture,
29 and many commands are similar. Basically I got famailiar 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 <a
39 href="http://svjatoslav.eu/static/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>
65 Software: MS-DOS 6.22, with HIMEM.SYS loaded.
66 Mouse driver if you have a mouse.
67 Does work only when CPU is in real mode.
68 To recompile ASM sources I used FASM (Flat Assembler).
69 I ran QBasic utilites on QB 4.5 .
70 VESA support by BIOS, or external driver (UNIVBE).
72 Hardware: Minimum CPU 386.
73 Recommended CPU Pentium 133.
74 64 KB free RAM below 640KB,
76 VESA compatible video card.
78 Human: Beginner level Forth knowledge is recommended.
83 <h2>Numbers representation</h2>
85 <img src="numbers.png">
87 Fifth uses hexdecimal number representation as primary.
88 Numbers shape is formed by dividing a square into four parts.
89 And manipulating their color (black or white).
93 <h2>Disk file map, and it's data structures</h2>
96 Core & highlevel boot code is stored outside of the filesystem to allow
97 easy access to it, at early booting time, when filesystem is not yet
102 offset length description
105 4 Kb ~32Kb highlevel boot code
107 101Kb ~16MB filesystem data area
113 0 -- .. pointer to next block
117 offset length description
123 28 4 last modification time
127 <h2>Core architecture</h2>
130 Fifth core is simply some amount of already compiled into machine code
131 and linked together modules (entries in other words). In compilation
132 process modules is compiled one by one and simply stored on top of
133 already existing and growing core. Separately from core is kept
134 dictionary, this is special list that contain names of compiled modules,
135 variables etc. and they locations in core. Constants use dictionary space
136 only. Random word can be removed from dictionary at any time. Currently
137 dictionary can contain at most 1000 entries.
140 dictionary entry format
142 offset length description
144 0 4 0 < previous entry
147 4 15 module name string
151 Core headers as linked list of module names make up something like dictionary.
152 When some entry address is needed compiler can quickly run through headers
153 backwards and find needed entry.
155 Possible module types
157 type description "execute" action
159 0 data compile "num" instruction
160 with address to module
161 1 submodule compile "call" instruction
162 with address to module
163 2 imm. submodule immideately call to module
166 Memory map: (average)
170 1500000 ~32000 highlevel Fifth boot code
171 200000h core startup messages area
172 5200000 end of dynamic memory space
176 <h2>Fifth source format</h2>
179 Fifth uses a different character table and codes than ASCII.
180 I call it FSCII (Fifth Standard Code for Information Interchange)
181 for example space character is not 32 but 255 instead.
182 I plan to use mainly HEX numbers, and create new characters
183 to represent numeric values. So typical nemric characters "0123..."
184 is treated like ordinary letters.
190 0 - 15 0 - F HEX numbers
192 253 FD tabulator (TAB)
193 254 FE carriage return (CR)
196 else ordinary characters, like in ASCII.