Search (using Google):  Web Karig

 

Special Feature: ColorForth Commentary

ColorForth Overview

NOTICE: This is a work in progress. Parts of my commentary are still very rough. However, I have it up on the web because even in this rough form it may be useful to ColorForth enthusiasts. Expect the contents of these files to change frequently.

MASM Manual online

ColorForth has two parts: a kernel written in x86 assembly language, and a series of one-kilobyte blocks of pre-parsed words, which the compiler in the kernel can compile into machine language.

Startup process

-- boot sector switches to VESA video mode, turns off interrupts, moves itself to address 0, turns on protected mode (for the 32-bit code, NOT the memory protection), loads sectors -- [keep going up to point where tasks "god" and "main" are running]

The ColorForth virtual machine

The data stack

-- data stack is separate from the return stack -- top item on stack (TOS) is cached in the EAX register, while ESI points to the location of the next item on the stack (NOS) -- stack grows downward in memory, meaning the address in ESI gets lower as the stack gets fuller -- so dup decrements ESI, while drop increments ESI -- stack commands are thus implemented with instructions that manipulate EAX and ESI -- [list ColorForth words that manipulate the data stack]

The return stack

-- ESP points to return stack as you might expect -- return stack is separate from data stack so that return addresses are not mixed with data shared among routines -- however the return stack is often used to store data temporarily -- [list ColorForth words that manipulate the return stack]

The address register

-- EDX --

Tasks

ColorForth has exactly two tasks — "god," which updates the graphic output display, and "main," which handles commands from the keyboard.

Keyboard layout

The ColorForth keyboard is a variation on the Dvorak keyboard layout. It provides 27 keys — three keys for each of eight fingers and the right thumb.

Key Scan code Char. Code
Q 0x15 (25o) p 22o
W 0x1D (35o) y 13o
E 0x24 (44o) f 16o
R 0x2D (55o) i 1
A 0x1C (34o) a 5
S 0x1B (33o) o 3
D 0x23 (43o) e 4
F 0x2B (53o) u 26o
Z 0x1A (32o) q 27o
X 0x22 (42o) k 30o
C 0x21 (41o) x 25o
V 0x2A (52o) d 20o
U 0x3C (74o) g 15o
I 0x43 (103o) c 12o
O 0x44 (104o) r 1
P 0x4D (115o) l 14o
J 0x3B (73o) h 24o
K 0x42 (102o) t 2
L 0x4B (113o) n 6
; 0x4C (114o) s 10o
M 0x3A (72o) b 23o
, 0x41 (101o) m 11o
. 0x49 (111o) w 17o
/ 0x4A (112o) v 21o
N 0x31 (61o)
Space 0x29 (51o)
Alt 0x11 (21o)

NOTE: The left Alt key scan code (Set 2) is 0x11; the right Alt key scan code is 0xE0 followed by 0x11.

Sorted by scan code:

Key Scan code Char. Code
Alt 0x11 (21o)
Q 0x15 (25o) p 22o
Z 0x1A (32o) q 27o
S 0x1B (33o) o 3
A 0x1C (34o) a 5
W 0x1D (35o) y 13o
C 0x21 (41o) x 25o
X 0x22 (42o) k 30o
D 0x23 (43o) e 4
E 0x24 (44o) f 16o
Space 0x29 (51o)
V 0x2A (52o) d 20o
F 0x2B (53o) u 26o
R 0x2D (55o) i 1
N 0x31 (61o)
M 0x3A (72o) b 23o
J 0x3B (73o) h 24o
U 0x3C (74o) g 15o
, 0x41 (101o) m 11o
K 0x42 (102o) t 2
I 0x43 (103o) c 12o
O 0x44 (104o) r 1
. 0x49 (111o) w 17o
/ 0x4A (112o) v 21o
L 0x4B (113o) n 6
; 0x4C (114o) s 10o
P 0x4D (115o) l 14o

Links

Others have provided an overview of the software:

  • Introducing ColorForth. Chuck Moore's own overview.
  • Philosophy. Chuck Moore gives some reasons for some of the design decisions he took.
  • Download. Notes on "bulletproof look-back optimization" and "How ColorForth boots."
  • Pre-parsed Word Format. Meaning of the bits in a pre-parsed word, and the meaning of each color.
  • 48 Characters. The bit strings used in pre-parsed words to represent letters and other characters.

Check the index for other entries.