Commit af861867 authored by Peter Fidelman's avatar Peter Fidelman
Browse files

Extra polish

parent 77e6bc98
......@@ -773,7 +773,6 @@ Some machines use memory mapped IO where certain memory addresses are
routed to hardware devices instead of main memory. This machine already
has the full 64K of memory connected so no address space is readily
available for hardware devices.
Instead we define a separate input-output space of 65536 possible
locations. Each of these possible locations is called an IO
......@@ -788,7 +787,7 @@ transmitter that sends data to a computer terminal, or just an
output pin controller that is wired to a light bulb.
This is a fake software CPU so I am going to hook it up to
stdin and stdout.
[stdin and stdout](
use std::io;
......@@ -821,7 +820,6 @@ a software emulation.
/* Dump CPU status.
* Like the front panel with the blinking lights that Chuck
* talked about. */
println!("{:?} {:?}", x.ip, x.dstack);
let _ = io::stdout().flush();
......@@ -830,6 +828,8 @@ a software emulation.
That's all the CPU instructions we'll need.
......@@ -861,7 +861,7 @@ Forth family. If you want to learn how to implement a full featured Forth,
please read
and Brad Rodriguez' series of articles
["Moving Forth"](
"[Moving Forth](".
The small Forth I write below will probably help you understand
those Forths a little better.
......@@ -1068,7 +1068,7 @@ fn build_dictionary(c: &mut Core) {
let mut d = Dict {
dp: 0, /* Nothing in the dictionary yet */
here: 2, /* Reserve address 0 as an "entry point", i.e. where the
here: 2, /* Reserve address 0 as the "reset vector", i.e. where the
CPU will jump to start running Forth. We don't have a
Forth interpreter yet so we'll leave address 0 alone for
now and start the dictionary at address 2 instead. */
......@@ -2633,11 +2633,11 @@ Start out in interpreting mode., 0xffff);
```rust, quit);
Put a call to the outer interpreter at the CPU's
[reset vector](
```rust, quit);
......@@ -2649,7 +2649,7 @@ fn main() {
/* Put the dictionary into memory */
build_dictionary(&mut c);
/* Run Forth */
/* Start running the CPU from the reset vector */
c.ip = 0;
loop {
......@@ -2704,6 +2704,7 @@ There is a shell script supplied that will do all of the above for you.
Please read frustration.4th if you want to learn more about how to
use Forth.
Please read
if you want to learn more about how to use Forth.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment