TEC-OS on the TEC-1G
With TEC-OS in its ROM the TEC-1G starts at a command prompt. You can list files on an SD card and run a supplied program before using the editor, the assembler or the BASIC compiler to make one of your own. TEC-OS provides the CP/M 2.2 programming interface and calls for the board's devices.
Starting with a prepared machine
The first session uses a 40-column PICO9918 display and the matrix keyboard, with the Matrix switch enabled. The board needs a 32,768-byte RAM chip in U9, the 4 MHz FAST setting, the TEC-OS ROM and a prepared starter card. The keypad non-maskable interrupt (NMI) jumper is off. SYSTEM is on drive A and WORK is on drive B. Hardware preparation is described in Appendix G.
First session begins with that preparation complete. Make a small program continues with a short banner entered in TED. You save it, build it with TAS, change its text and run it again. Build a BASIC program compiles the supplied TIMES.BAS with BAZA and builds it from TED with the same keys. These sessions introduce the keys and commands they use without requiring an earlier CP/M, BASIC or assembly course.
The banner is a guided copy-and-change exercise. Its instructions and data are explained beside the listing. The later programming chapters assume you can read a short Z80 listing with labels, registers and branches. They explain the TEC-OS call, buffer and stack contracts before examples depend on them.
Serial terminals, the graphics LCD and other display widths have their own configuration chapter. The web page is an optional way to use the software machine, with its controls and card-saving rules in Appendix I.
Runs and source
The demonstrations and measurements are from the Debug80 TEC-1G host model, a software implementation of the machine. They are not physical-board runs. The diagnostics chapter separates what a test establishes in software from what a board report can establish about that board.
Each chapter records the source revision used to check its claims. A retained historical capture also records the revision and inputs that produced it. Source references name the file and lines for the stated revision. A source change may move those lines even when the assembled program is unchanged. When the prose and its stated source disagree, the source is the authority and the prose needs correction.
A transcript includes the prompt and the command typed after it, followed by the output. It may begin at an already-running prompt. Any other omitted output is identified with the example. Control keys are written with a caret: ^C means Ctrl and C together. Reproducing the runs on a PC requires the setup and tools in The host model as evidence.
Addresses and bytes use hexadecimal with a trailing h, as in 0100h. Sizes in bytes are decimal. A KiB is 1,024 bytes and a MiB is 1,024 KiB.
Using the machine
| Chapter | Use |
|---|---|
| 1. First session | Power on, find files, run supplied SAMPLE and the card's other programs and preserve work |
| 2. Make a small program | Enter, save, build, change and run a banner |
| 3. Build a BASIC program | Compile and run TIMES.BAS with BAZA and build it from TED |
| 4. Work with files | Read, copy, rename and erase files and control long listings |
| 5. Drives and user areas | Locate programs, select volumes, use resident services and run MON-3 programs |
| 6. Cards on the PC | Copy, check, recover and prepare card images |
| 7. Choose a console | Select a display or serial terminal and its settings |
| 8. Commands at startup | Set up a startup file and bypass it when necessary |
Writing programs
| Chapter | Use |
|---|---|
| 9. Call TEC-OS | Read keys and print through the BDOS |
| 10. Read and write a file | Use file control blocks and record buffers |
| 11. Memory for programs | Allocate program space and stacks and use raw BIOS calls |
| 12. Use the board's devices | Call hardware services and share the display |
| 13. Results and command chains | Report a result and start the next command |
| 14. Write a resident service | Install a hook, publish routines and remove the service |
Inside TEC-OS
| Chapter | Mechanism |
|---|---|
| 15. State and memory | Workspace, banks, stacks and state lifetimes |
| 16. Reset and boot | Reset recognition, cold boot and warm boot |
| 17. Console paths | BIOS routing, keyboard, serial and terminal code |
| 18. Card blocks and volumes | Card commands, container checks and record mapping |
| 19. Cache and persistence | Read reuse, write ordering and failed writes |
| 20. A file through the BDOS | Directory entries, allocation and file operations |
| 21. From prompt to program | Parsing, lookup and program launch |
| 22. Chains across a warm boot | Retained command text and conditional continuation |
| 23. The history ring | Bounded storage and recall of command lines |
| 24. Numbered-service dispatch | Register handling and device routines |
| 25. Loading and removing services | Relocation, publication and rollback |
| 26. Startup inside the CCP | Reading lines and handling absent displays |
| 27. Build the ROM and media | Source, generated data and qualified artifacts |
| 28. Diagnose the machine | Card errors and the board diagnostics loaded by MON-3 |
| 29. The host model as evidence | Host machine, captures, tests and their limits |
Reference
| Appendix | Lookup |
|---|---|
| A. BDOS functions | Registers, effects and errors by function number |
| B. ROM interfaces | Numbered services, the PICO record and font |
| C. Memory map | Addresses and the state cleared at each boot |
| D. Messages and recovery | Causes, partial results and next actions |
| E. Container format | Header, descriptors, checks and geometries |
| F. tecvol | Host commands and options |
| G. Hardware preparation | Required setup, ports and hardware constraints |
| H. Service format | Header fields, dependencies and relocation data |
| I. Web page | Controls, input, saved cards and imports |
| J. Command reference | Exact syntax, names, wildcards and search rules |