Skip to content

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 ​

ChapterUse
1. First sessionPower on, find files, run supplied SAMPLE and the card's other programs and preserve work
2. Make a small programEnter, save, build, change and run a banner
3. Build a BASIC programCompile and run TIMES.BAS with BAZA and build it from TED
4. Work with filesRead, copy, rename and erase files and control long listings
5. Drives and user areasLocate programs, select volumes, use resident services and run MON-3 programs
6. Cards on the PCCopy, check, recover and prepare card images
7. Choose a consoleSelect a display or serial terminal and its settings
8. Commands at startupSet up a startup file and bypass it when necessary

Writing programs ​

ChapterUse
9. Call TEC-OSRead keys and print through the BDOS
10. Read and write a fileUse file control blocks and record buffers
11. Memory for programsAllocate program space and stacks and use raw BIOS calls
12. Use the board's devicesCall hardware services and share the display
13. Results and command chainsReport a result and start the next command
14. Write a resident serviceInstall a hook, publish routines and remove the service

Inside TEC-OS ​

ChapterMechanism
15. State and memoryWorkspace, banks, stacks and state lifetimes
16. Reset and bootReset recognition, cold boot and warm boot
17. Console pathsBIOS routing, keyboard, serial and terminal code
18. Card blocks and volumesCard commands, container checks and record mapping
19. Cache and persistenceRead reuse, write ordering and failed writes
20. A file through the BDOSDirectory entries, allocation and file operations
21. From prompt to programParsing, lookup and program launch
22. Chains across a warm bootRetained command text and conditional continuation
23. The history ringBounded storage and recall of command lines
24. Numbered-service dispatchRegister handling and device routines
25. Loading and removing servicesRelocation, publication and rollback
26. Startup inside the CCPReading lines and handling absent displays
27. Build the ROM and mediaSource, generated data and qualified artifacts
28. Diagnose the machineCard errors and the board diagnostics loaded by MON-3
29. The host model as evidenceHost machine, captures, tests and their limits

Reference ​

AppendixLookup
A. BDOS functionsRegisters, effects and errors by function number
B. ROM interfacesNumbered services, the PICO record and font
C. Memory mapAddresses and the state cleared at each boot
D. Messages and recoveryCauses, partial results and next actions
E. Container formatHeader, descriptors, checks and geometries
F. tecvolHost commands and options
G. Hardware preparationRequired setup, ports and hardware constraints
H. Service formatHeader fields, dependencies and relocation data
I. Web pageControls, input, saved cards and imports
J. Command referenceExact syntax, names, wildcards and search rules

TEC-OS and Thorium documentation