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.
tnylpo must be built from source - there are no package manager installations available.
Install ncurses development libraries:
sudo apt-get install libncurses5-devsudo dnf install ncurses-devel
# or
sudo yum install ncurses-develShould be included with Xcode Command Line Tools:
xcode-select --installsudo pacman -S ncurses- Clone the repository
git clone https://gitlab.com/gbrein/tnylpo.git
cd tnylpo- Build tnylpo
make- Install Option A: System-wide (requires sudo)
sudo make install
# Installs to /usr/local/bin- Install Option B: User directory (no sudo needed)
mkdir -p ~/bin
cp tnylpo ~/bin/- Add to PATH (if using Option B)
# Add to current session
export PATH="$PATH:$HOME/bin"
# Make permanent - add to ~/.bashrc or ~/.profile
echo 'export PATH="$PATH:$HOME/bin"' >> ~/.bashrc
# Reload bashrc
source ~/.bashrc# Verify tnylpo is in PATH
which tnylpo
# Check with our utility
python3 utils/check_tnylpo.py# Compile a BASIC program
python3 test_compile.py test_loop.bas
# Run with tnylpo
tnylpo test.comtnylpo program.comtnylpo program.com arg1 arg2tnylpo 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- 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
- tnylpo is not installed or not in PATH
- Run
echo $PATHto check your PATH - Run
find / -name tnylpo 2>/dev/nullto locate the binary
Install ncurses development package (see Prerequisites)
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
- Try different terminal emulator (xterm, gnome-terminal, etc.)
- Check TERM environment variable:
echo $TERM - Try:
export TERM=xterm-256color
- Press Ctrl+C to interrupt
- Press Ctrl+Z to suspend, then
kill %1to terminate
The MBASIC compiler test scripts use /usr/bin/env tnylpo to find tnylpo in PATH. This approach is portable across different installation locations.
# 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.comIf tnylpo doesn't work for your system, alternatives include:
- RunCPM: https://github.com/MockbaTheBorg/RunCPM
- z80pack: https://github.com/udo-munk/z80pack
- YAZE-AG: http://www.mathematik.uni-ulm.de/users/ag/yaze-ag/
However, test scripts are configured for tnylpo specifically.
- tnylpo on GitLab: https://gitlab.com/gbrein/tnylpo
- CP/M 2.2 Manual: http://www.cpm.z80.de/manuals/cpm22-m.pdf
- Z80 Instruction Set: http://www.z80.info/z80ins.txt
Test scripts use /usr/bin/env tnylpo to locate tnylpo in PATH. See:
test_compile/test_compile.py- Test compilation and execution scriptutils/check_tnylpo.py- Installation verification utility