tnylpo Setup Guide¶
Overview¶
tnylpo is a CP/M 2.2 emulator for Unix/Linux that runs CP/M .COM executables. It's required for testing MBASIC programs compiled to CP/M format.
Important: tnylpo must be in your PATH for test scripts to work.
Installation¶
tnylpo must be built from source - there are no package manager installations available.
Prerequisites¶
Install ncurses development libraries:
Ubuntu/Debian¶
Fedora/RHEL/CentOS¶
macOS¶
Should be included with Xcode Command Line Tools:
Arch Linux¶
Building tnylpo¶
-
Clone the repository
-
Build tnylpo
-
Install Option A: System-wide (requires sudo)
-
Install Option B: User directory (no sudo needed)
-
Add to PATH (if using Option B)
Verification¶
Check Installation¶
Test with a CP/M Program¶
Usage¶
Basic Usage¶
With CP/M Command Line Arguments¶
Configuration¶
tnylpo can be configured via ~/.tnylpo/tnylpo.conf. Common settings:
# Terminal settings
set terminal_lines 24
set terminal_columns 80
# Disk configuration
mount a: /path/to/cpm/disk/a
mount b: /path/to/cpm/disk/b
# Printer output
printer /tmp/tnylpo-printer.txt
Features¶
- Full CP/M 2.2 BDOS/BIOS emulation
- Console I/O with ncurses
- File system access through Unix directories
- Printer support (output to file)
- Accurate Z80 CPU emulation
- Supports most CP/M programs
Troubleshooting¶
"tnylpo: command not found"¶
- tnylpo is not installed or not in PATH
- Run
echo $PATHto check your PATH - Run
find / -name tnylpo 2>/dev/nullto locate the binary
Build Errors¶
"curses.h: No such file or directory"¶
Install ncurses development package (see Prerequisites)
"make: command not found"¶
Install build tools:
- Ubuntu/Debian: sudo apt-get install build-essential
- Fedora/RHEL: sudo dnf group install "Development Tools"
- macOS: Install Xcode Command Line Tools
Runtime Issues¶
Screen corruption¶
- Try different terminal emulator (xterm, gnome-terminal, etc.)
- Check TERM environment variable:
echo $TERM - Try:
export TERM=xterm-256color
Program hangs¶
- Press Ctrl+C to interrupt
- Press Ctrl+Z to suspend, then
kill %1to terminate
Integration with MBASIC Compiler¶
The MBASIC compiler test scripts use /usr/bin/env tnylpo to find tnylpo in PATH. This approach is portable across different installation locations.
Complete Workflow Example¶
# 1. Write BASIC program
cat > hello.bas << 'EOF'
10 PRINT "Hello from CP/M!"
20 END
EOF
# 2. Compile to C
python3 test_compile.py hello.bas
# 3. Review generated C code
cat hello.c
# 4. Compile C to CP/M .COM file (done by test_compile.py)
# Uses: /usr/bin/env z88dk.zcc +cpm hello.c -create-app -o hello
# 5. Run on CP/M emulator
tnylpo hello.com
Alternative CP/M Emulators¶
If tnylpo doesn't work for your system, alternatives include:
- RunCPM: https://github.com/MockbaTheBorg/RunCPM
- z80pack: http://www.z80.info/z80pack.htm
- YAZE-AG: http://www.mathematik.uni-ulm.de/users/ag/yaze-ag/
However, test scripts are configured for tnylpo specifically.
References¶
- tnylpo GitHub: https://github.com/agn453/tnylpo
- CP/M 2.2 Manual: http://www.cpm.z80.de/manuals/cpm22-m.pdf
- Z80 Instruction Set: http://www.z80.info/z80ins.htm
Implementation Note¶
Test scripts use /usr/bin/env tnylpo to locate tnylpo in PATH. See:
- test_compile/test_compile.py - Test compilation and execution script
- utils/check_tnylpo.py - Installation verification utility