Format/typo check 2006/toledo2

This commit is contained in:
Cody Boone Ferguson committed 2023-11-24 12:53:18 -08:00
1 parent d2daca0216
commit b358f3d053
1 file changed
+26 -26
+26 -26
View File
@@ -29,8 +29,7 @@ For more detailed information see [2006 toledo2 in bugs.md](/bugs.md#2006-toledo
To end execution press `ctrl-z`. As mentioned in the author's remarks and in the To end execution press `ctrl-z`. As mentioned in the author's remarks and in the
below section, it is supposed to crash on termination though some noted this below section, it is supposed to crash on termination though some noted this
does not seem to happen in macOS. He asks ironically: 'if it's supposed to crash does not seem to happen in macOS or linux in 2023.
and it does not crash is it actually a bug or is it a feature? :-)'
### Try: ### Try:
@@ -67,7 +66,7 @@ make alt
### Alternate use: ### Alternate use:
The author noted that for PC/DOS you will have to add `ANSI.SYS` to your The author noted that for PC/DOS you will have to add `ANSI.SYS` to your
`CONFIG.SYS` but this is also not something we can test. `CONFIG.SYS` but this is also something we can't test.
Use `toledeo2.alt` as you would `toledo2` above. Use `toledeo2.alt` as you would `toledo2` above.
@@ -86,11 +85,9 @@ of this size, it allows importing files from the host file
system (one by one, so you'll have to be patient). system (one by one, so you'll have to be patient).
Remember the good old days and play (or let your kids play) Remember the good old days and play (or let your kids play)
[Adventure](https://rickadams.org/adventure/) (in the directory `ADVENTUR` [Adventure](https://rickadams.org/adventure/) (in the directory `ADVENTUR`);
within the `KAYPROII.ZIP` walking in a maze of twisty little passages all alike is easier than
file referred in the author's remarks); walking in a maze of understanding the code!
twisty little passages all alike is easier than understanding
the code!
## Author's remarks: ## Author's remarks:
@@ -101,7 +98,7 @@ and a disk controller, just like at the start of the personal computers
revolution (circa 1975). revolution (circa 1975).
It needs an initial memory image to do something usable, so along with it you It needs an initial memory image to do something usable, so along with it you
will find two files ([C.BASIC](C.BASIC) and [C.BIOS](C.BIOS)). Rename will find two files: ([C.BASIC](C.BASIC) and [C.BIOS](C.BIOS)). Rename
[C.BASIC](C.BASIC) to `C` (NOTE from the judges: running `make` will do this for [C.BASIC](C.BASIC) to `C` (NOTE from the judges: running `make` will do this for
you), run the emulator, and et voila! you have the public domain Palo Alto [Tiny you), run the emulator, and et voila! you have the public domain Palo Alto [Tiny
BASIC](https://en.wikipedia.org/wiki/Tiny_BASIC) (by Li-Chen Wang), published in BASIC](https://en.wikipedia.org/wiki/Tiny_BASIC) (by Li-Chen Wang), published in
@@ -136,21 +133,17 @@ All good programmers started learning
[BASIC](https://en.wikipedia.org/wiki/BASIC), now, what about a [BASIC](https://en.wikipedia.org/wiki/BASIC), now, what about a
[CP/M](https://en.wikipedia.org/wiki/CP/M) emulator? [CP/M](https://en.wikipedia.org/wiki/CP/M) emulator?
Download the following file (not included because of possible
copyright and blah, blah):
> <http://www.retroarchive.org/cpm/os/KAYPROII.ZIP> Copy `CPM64.COM` from the `SOURCE` directory to files named `A` and `B` (these
will be the disk drives). Now rename the provided [C.BIOS](C.BIOS) to `C` and
Extract `CPM64.COM` from the `SOURCE` directory, and copy it to run the emulator.
files named `A` and `B` (these will be the disk drives). Now rename
the provided [C.BIOS](C.BIOS) to `C` and run the emulator.
Now you have a running [CP/M](https://en.wikipedia.org/wiki/CP/M) system!, with Now you have a running [CP/M](https://en.wikipedia.org/wiki/CP/M) system!, with
two files on A: drive, `HALT.COM` to stop the emulator (so it closes drives) and two files on A: drive, `HALT.COM` to stop the emulator (so it closes drives) and
`IMPORT.COM` to introduce new files. `IMPORT.COM` to introduce new files.
To get a complete [CP/M](https://en.wikipedia.org/wiki/CP/M) system, you will need the following files To get a complete [CP/M](https://en.wikipedia.org/wiki/CP/M) system, you will need the following files
from the `KAYPROII.ZIP` (in the `SOURCE` directory): from the `SOURCE` directory:
ASM.COM DDT.COM DUMP.COM ED.COM LOAD.COM ASM.COM DDT.COM DUMP.COM ED.COM LOAD.COM
PIP.COM STAT.COM SUBMIT.COM XSUB.COM PIP.COM STAT.COM SUBMIT.COM XSUB.COM
@@ -181,25 +174,29 @@ from <http://www.retroarchive.org>:
Some programs require installation to configure the terminal, Some programs require installation to configure the terminal,
locate ANSI or VT-100. locate ANSI or VT-100.
### What is an 8080? ### What is an 8080?
It is simply the little brother of the It is simply the little brother of the
[Z80](https://en.wikipedia.org/wiki/Zilog_Z80); it has no extended [Z80](https://en.wikipedia.org/wiki/Zilog_Z80); it has no extended
registers (`AF'`, `BC'`, `DE'`, `HL'`, `IX` or `IY`), no relative jumps, registers (`AF'`, `BC'`, `DE'`, `HL'`, `IX` or `IY`), no relative jumps,
and every instruction beginning with `CB`, `DD`, `ED` or `FD` doesn't and no instruction beginning with `CB`, `DD`, `ED` or `FD` exists.
exist.
The flags are only `S` (Sign, bit 7), `Z` (Zero, bit 6), `P` (Parity, The flags are only `S` (Sign, bit 7), `Z` (Zero, bit 6), `P` (Parity,
bit 2) and `C` (Carry, bit 0). bit 2) and `C` (Carry, bit 0).
### Porting it ### Porting it
It is easy if your platform has getch/kbhit and It is easy if your platform has `getch()`/`kbhit()` and
ANSI terminal: ANSI terminal:
```
read --> Z=kbhit()?getch():0 read --> Z=kbhit()?getch():0
write --> putchar(7[o]) write --> putchar(7[o])
system --> nothing system --> nothing
```
Notice that you'll have to do `#include <conio.h>` as well. Notice that you'll have to do `#include <conio.h>` as well.
@@ -221,11 +218,13 @@ it was not required.
### How it works (SPOILER) ### How it works (SPOILER)
The `l` array contains the 64K memory; it is initialized with a The `l` array contains the 64K memory; it is initialized with a boot image
boot image loaded from the `C` file. The program counter is the loaded from the `C` file. The [program
`c` pointer and registers are in `o[]`. The main loop reads every counter](https://en.wikipedia.org/wiki/Program_counter) is the `c` pointer and
opcode and separates them in one of three common forms. A lot [registers](https://en.wikipedia.org/wiki/Processor_register) are in `o[]`. The
of ternary operators selects the instruction. main loop reads every [opcode](https://en.wikipedia.org/wiki/Opcode) and
separates them in one of three common forms. A lot of ternary operators selects
the instruction.
``` ```
o[0] = B register o[1] = C register o[0] = B register o[1] = C register
@@ -259,6 +258,7 @@ Memory addresses:
The BIOS is tailor made for this emulator, and helps to simplify it. The BIOS is tailor made for this emulator, and helps to simplify it.
### Other notes ### Other notes
- The 8080 runs at your computer speed divided - The 8080 runs at your computer speed divided
@@ -274,7 +274,7 @@ The BIOS is tailor made for this emulator, and helps to simplify it.
- Also I discovered that braces are very useful - Also I discovered that braces are very useful
for commenting. for commenting.
- Why bother with prototypes? Every good C - Why bother with prototypes? Every good C
programmer can develop its C programs using programmer can develop their C programs using
only one function. only one function.