Introduction
Welcome to the Intel 8088 DOS Environment on the Emulator.ca BBS---a DOS-shaped clean-room demo environment built around an Intel 8088 instruction emulator.
On August 12, 1981, IBM unveiled the IBM Personal Computer Model 5150. At its heart was the Intel 8088, an 8-bit external bus variant of the 16-bit 8086 processor. Paired with Microsoft's MS-DOS operating system, this machine defined a computing standard that would dominate the industry for over a decade and whose influence echoes in every x86 system running today.
The 8088 was a pragmatic choice. Intel's full 16-bit 8086 required expensive 16-bit memory and support chips. The 8088 kept the same internal 16-bit architecture---the same registers, the same instruction set, the same megabyte address space---but communicated with the outside world through an 8-bit data bus, allowing IBM to use cheaper, widely available components. This engineering compromise brought genuine 16-bit computing within reach of ordinary people and small businesses.
MS-DOS (Microsoft Disk Operating System) provided the historical software layer. Its INT 21h interface became the standard way programs requested services from the operating system: printing characters, reading keyboard input, opening files, and terminating gracefully. The .COM executable format---a flat binary loaded at offset 100h with no headers, no relocation, no complexity---was the simplest way to write a program for this platform. Emulator.ca does not ship MS-DOS; it provides a small clean-room INT 21h service subset for bundled demonstration fixtures.
This emulator runs bundled clean-room .COM demo images and one synthetic MZ/EXE fixture on an Intel 8088 instruction emulator sufficient for those fixtures, with project BIOS initialization, interrupt vector table setup, and a small INT 21h service subset. It does not ship Microsoft MS-DOS, IBM PC ROMs, proprietary disk images, or third-party software, and general user-supplied DOS software compatibility is not implied. Select a program from the menu, watch the CPU execute it instruction by instruction, and experience a DOS-shaped early-1980s computing model.
This emulator provides an Intel 8088 instruction emulator with clean-room BIOS initialization, PSP (Program Segment Prefix) setup, UART I/O, and INT 21h demo-service support sufficient for the bundled examples. Bundled .COM programs and one clean-room synthetic MZ fixture execute with instruction-level stepping at 10,000 cycles per tick; proprietary ROM, OS, arbitrary EXE, and disk-image compatibility are outside this public demo boundary.
Quick Start
Connect to the DOS environment and try running your first program:
ATDT555-0367
CONNECT 1200
╔════════════════════════════════════════╗
║ Intel 8088 DOS Environment v1.0 ║
║ Run .COM files with INT 21h ║
╚════════════════════════════════════════╝
Available Programs:
1. HELLO.COM - Hello World demo
2. ECHO.COM - Echo input program
3. FATHELLO.COM - Hello via synthetic FAT12 host load
4. MZDEMO.EXE - Synthetic MZ execution fixture
5. FIB.COM - First 10 Fibonacci numbers
Q. Quit
Select a program (1-5) or Q to quit: 1
Loading HELLO.COM...
--- Running HELLO.COM ---
Hello, World!
--- Program Ended ---
Available Programs:
...
Key steps:
- Dial
ATDT555-0367to connect - Choose a program by number from the menu
- Watch the output appear as the 8088 executes the .COM file
- After the program ends, you return to the menu
- Press Q to quit and disconnect
Running Programs
Selecting a Program
Upon connection, the DOS environment presents a numbered list of bundled .COM demo executables. Type the number of the program you wish to run and press Enter. The system will load the clean-room BIOS, initialize the CPU, set up the Program Segment Prefix, and begin execution.
During Execution
Once a program is running:
- Interactive programs (such as ECHO.COM) accept keyboard input. Type your text and press Enter to submit it.
- Backspace and Delete work for correcting input before you press Enter.
- Output from the program appears on your terminal as the CPU executes instructions.
- When the program terminates (via INT 21h AH=4Ch or HLT), you are returned to the program menu automatically.
Returning to the Menu
After a program finishes, the menu reappears. You may run another program or press Q to disconnect.
Characters you type while a program is running are fed directly to the emulated UART. The program receives them exactly as if you were typing on an original IBM PC keyboard connected through a serial port.
Available Programs
1. HELLO.COM --- Hello World Demo
The classic first program. HELLO.COM prints "Hello, World!" to the screen and exits. It demonstrates basic INT 21h output services and proper .COM program termination.
This is a good program to run first---it confirms that the CPU emulation, BIOS initialization, and DOS services are all functioning correctly.
--- Running HELLO.COM ---
Hello, World!
--- Program Ended ---
2. ECHO.COM --- Echo Input Program
ECHO.COM reads characters from the keyboard and echoes them back to the screen. It demonstrates interactive INT 21h input and output services.
Type any text and press Enter. The program reads your input through the UART and repeats it back. This program runs in a loop until it encounters a termination condition.
--- Running ECHO.COM ---
Hello there
Hello there
Testing 1 2 3
Testing 1 2 3
--- Program Ended ---
3. FATHELLO.COM --- FAT12 Loader Fixture
FATHELLO.COM contains the same clean-room hello program as HELLO.COM, but it is loaded through a synthetic single-file FAT12 image first. This demonstrates the host-side FAT12 parser and root-directory lookup without claiming general DOS disk compatibility.
4. MZDEMO.EXE --- Synthetic MZ Execution Fixture
MZDEMO.EXE is a clean-room synthetic MZ executable fixture. The backend parses its header and relocation plan, creates a PSP below the loaded image, applies the MZ CS:IP and SS:SP registers, prints a short message through INT 21h AH=09h, and exits through INT 21h AH=4Ch. This proves the bundled fixture path only; it is not a claim that arbitrary DOS EXE software will run.
5. FIB.COM --- Fibonacci Arithmetic Demo
FIB.COM computes and prints the first ten Fibonacci numbers using 8088 arithmetic instructions and the supported INT 21h console-output services.
--- Running FIB.COM ---
Fibonacci sequence:
0 1 1 2 3 5 8 13 21 34
--- Program Ended ---
Technical Details
The Intel 8088 Processor
The Intel 8088 is a 16-bit processor with an 8-bit external data bus. It can address up to 1 megabyte of memory through its 20-bit segmented address scheme (segment:offset). Key characteristics of this emulation:
- Full instruction set with instruction-accurate stepping
- Segmented memory model using CS, DS, ES, and SS registers
- BIOS initialization with interrupt vector table (IVT) setup
- 10,000 cycles per tick execution rate
- UART I/O for serial communication with your terminal
Memory Layout
.COM files use the simplest possible memory model. All segment registers point to the same segment, and the entire program---code, data, and stack---lives within a single 64KB segment:
Segment 0800h
+------------------+ 0xFFFE <-- SP (Stack Pointer)
| |
| Stack |
| (grows down) |
| |
+------------------+
| |
| Program Code |
| and Data |
| |
+------------------+ 0x0100 <-- CS:IP (Entry Point)
| |
| PSP |
| (256 bytes) |
| |
+------------------+ 0x0000
- PSP (Program Segment Prefix): 256 bytes at offset 0000h containing program metadata, the INT 20h termination vector, and the command tail
- Program Code: Loaded at offset 0100h---the standard .COM entry point
- Stack: Begins at 0FFFEh and grows downward toward the program
All four segment registers (CS, DS, ES, SS) are set to the same value (0800h), giving the program a flat view of its 64KB segment.
Program Segment Prefix (PSP)
The PSP is a 256-byte data structure that DOS creates at the base of the program's segment before loading the .COM file. It contains:
| Offset | Size | Contents |
|---|---|---|
| 00h | 2 | INT 20h instruction (program termination) |
| 02h-03h | 2 | Segment of first byte beyond allocated memory |
| 05h | 1 | FAR CALL to DOS dispatcher |
| 2Ch-2Dh | 2 | Environment segment (0 = none) |
| 80h | 1 | Command tail length |
| 81h | 127 | Command tail (CR-terminated) |
The PSP is a holdover from CP/M, the operating system MS-DOS was designed to be compatible with. CP/M had a similar structure called the "zero page" at the base of the transient program area. This compatibility made it straightforward to port CP/M software to MS-DOS.
INT 21h DOS Services
INT 21h is the primary DOS service interrupt. Programs request services by loading a function number into the AH register and executing INT 21h. This emulation supports the following functions:
| AH Value | Function | Description |
|---|---|---|
| 01h | Character Input | Read a character from standard input with echo |
| 02h | Character Output | Write a character to standard output |
| 09h | String Output | Display a $-terminated string |
| 4Ch | Terminate Program | Exit with return code in AL |
This is a minimal DOS-like implementation for the bundled demos. File operations, directory services, proprietary DOS kernels, and advanced DOS functions are not available. Programs that rely on services beyond basic I/O and termination will not function correctly.
BIOS and Interrupt Vector Table
Before your .COM file executes, the system performs BIOS initialization:
- The project clean-room BIOS binary is loaded and executed for up to 5,000 instructions
- The Interrupt Vector Table (IVT) is populated at address 0000:0000
- Basic hardware services (keyboard, display, timer) are configured
- The BIOS banner output is suppressed in favour of the DOS environment's own interface
The IVT occupies the first 1,024 bytes of memory (256 vectors x 4 bytes each). Each vector is a FAR pointer (segment:offset) to an interrupt service routine.
Execution Model
Programs execute in a tick-based loop:
- Each tick, the CPU executes up to 10,000 instructions
- After each tick, UART output is collected and sent to your terminal
- Keyboard input is fed to the UART in real time
- If the CPU halts (HLT instruction or INT 21h AH=4Ch), execution stops
- LF characters in output are converted to CR+LF for proper terminal display
Ticks occur every 10 milliseconds, giving an effective execution rate of approximately 1,000,000 instructions per second.
Command Reference
Menu Commands
| Command | Description |
|---|---|
1 |
Run program 1 (HELLO.COM) |
2 |
Run program 2 (ECHO.COM) |
3 |
Run program 3 (FATHELLO.COM) |
4 |
Run program 4 (MZDEMO.EXE synthetic MZ fixture) |
5 |
Run program 5 (FIB.COM) |
Q |
Quit and disconnect |
| Backspace | Delete last character of input |
| Enter | Submit selection |
During Program Execution
| Action | Description |
|---|---|
| Type characters | Input is sent to the running program via UART |
| Enter | Submit input line to program |
| Backspace/Delete | Edit input before submitting |
There is no way to interrupt a running program. Programs run until they terminate naturally via INT 21h AH=4Ch or the HLT instruction. If a program enters an infinite loop, you may need to disconnect and redial.
Quick Reference Card
+------------------------------------------------------------------+
| INTEL 8088 DOS ENVIRONMENT - QUICK REFERENCE |
+------------------------------------------------------------------+
| CONNECTION | PROGRAMS |
| ATDT555-0367 | 1. HELLO.COM - Hello World demo |
| | 2. ECHO.COM - Echo input program |
| | 3. FATHELLO.COM - FAT12 loader fixture |
| | 4. MZDEMO.EXE - Synthetic MZ fixture |
| | 5. FIB.COM - Fibonacci arithmetic demo |
| MENU COMMANDS | |
| 1-5 Select program | MEMORY LAYOUT |
| Q Quit | PSP at segment:0000 (256 bytes) |
| | Code at segment:0100 (entry point) |
| DURING EXECUTION | Stack at segment:FFFE (grows down) |
| Type Send input | |
| Enter Submit line | INT 21h SERVICES |
| BS Edit input | AH=01h Read character |
| | AH=02h Write character |
| PROCESSOR | AH=09h Write $-terminated string |
| Intel 8088 (16-bit) | AH=4Ch Terminate program |
| 1MB address space | |
| Segmented memory | .COM FORMAT |
| 10,000 cycles/tick | Flat binary, no headers |
| | Loaded at offset 100h |
| | Max size: 65,280 bytes |
+------------------------------------------------------------------+
Troubleshooting
Problem: Program does not produce any output
The BIOS may have failed to load. Verify your connection is stable and try selecting the program again. If the issue persists, disconnect with Q and redial ATDT555-0367.
Problem: "Initialization error" message on connection
The WASM module for the Intel 8088 emulator failed to load. This can happen if your browser does not support WebAssembly or if network conditions prevented the module from downloading. Refresh the page and try again.
Problem: Characters appear garbled or duplicated
Your terminal may be set to local echo mode, causing characters to appear twice---once from your terminal and once from the UART echo. Disable local echo in your terminal settings.
Problem: Program appears to hang
Some programs wait for input. Try typing something and pressing Enter. If the program is genuinely stuck in an infinite loop, there is no break mechanism---disconnect and redial to start fresh.
Problem: "Error: Failed to load BIOS" message
The BIOS binary (bios-full.bin) could not be fetched. This is typically a server-side issue. Wait a moment and try again, or contact the system operator.
Problem: Output appears on a single long line
Line endings may not be converting correctly. The emulator converts LF to CR+LF for terminal display. If your terminal requires different line endings, check your terminal emulation settings.
Glossary
.COM file --- The simplest DOS executable format. A flat binary image loaded at offset 100h within a single 64KB segment. No headers, no relocation tables, no complexity. Maximum size is 65,280 bytes (64KB minus 256 bytes for the PSP). emulator.ca ships only small clean-room demo .COM fixtures.
BIOS (Basic Input/Output System) --- Firmware that initializes hardware and provides low-level services through software interrupts. The clean-room demo BIOS sets up the Interrupt Vector Table and configures basic I/O before the bundled .COM fixture runs.
Cycles per tick --- The number of CPU instructions executed between checks for I/O. Set to 10,000 in this emulation, balancing responsiveness with execution speed.
INT 21h --- The primary DOS service interrupt. Programs request operating system services by loading a function number into AH and executing INT 21h. The DOS kernel handles the request and returns control to the program.
IVT (Interrupt Vector Table) --- A table of 256 FAR pointers (4 bytes each) at address 0000:0000 in memory. Each entry points to an interrupt service routine. Hardware and software interrupts use this table to locate their handlers.
PSP (Program Segment Prefix) --- A 256-byte data structure DOS creates at the base of a program's memory segment. Contains the INT 20h termination vector, memory size information, and the command tail.
Segment:Offset --- The 8088's memory addressing scheme. A 20-bit physical address is formed by shifting the 16-bit segment left by 4 bits and adding the 16-bit offset: physical = (segment x 16) + offset. This allows a 16-bit processor to address 1MB of memory.
UART (Universal Asynchronous Receiver-Transmitter) --- The serial communication hardware that connects the emulated CPU to your terminal. Characters written to the UART appear on your screen; characters you type are received by the UART.
See Also
- SLP-8008 (555-8008) --- Intel 8008 emulator, the 8088's ancestor
- SLP-8088 Test (555-8088) --- Intel 8088 CPU test and demonstration
- SLP-Z80 (555-4355) --- Zilog Z80 microprocessor emulator
- SLP-BASIC (555-0300) --- High-level BASIC programming environment
- SLP-FORTH (555-0400) --- Stack-based Forth language interpreter
- x86 Test (555-0086) --- x86 assembly language test environment
INTEL 8088 DOS ENVIRONMENT v1.0 Emulator.ca Systems Dial 555-0367 to connect