HTL80186 Instruction Set Simulator
The ISS186 is an Instruction Set Simulator (ISS) for the HTL186C PC/XT embedded controller. The controller consist of the HTL80186 16bits processor and a number of standard peripherals such as a dual Programmable Interrupt Controller (HTL8259), Programmable Timer Unit (HTL8254), Real Time Clock (HTL146818), a Watchdog Timer and two 16450 compatible UARTs. The ISS186 provides an easy software development platform for the above IP cores. The simulator is not (yet) cycle accurate.
Note: the system does not have a video controller, all communication is done over the serial ports! The BIOS redirects the standard Input/Output calls to one of the serial ports. In effect this headless system behaves like a DOS machine after executing "CTTY COM2". If you want to simulate a full IBM XT/PC then the ISS186 is not the right choice, Dioscure, PCE, VMware, QEMU, Boch etc is what you are after.
Download ISS186 and Boot Images
- Download ISS186 executable
ISS186 version 0.1 (98KByte zipped): First Release 08/08/09, Tested on Windows XP only. -
Download FreeDOS 16MByte Flash image
FreeDOS 1.0 + some extra utilities (1.37MB zipped, FreeDOS kernel 2038) -
Optional 1.44MB Floppy Disk Images (kernel and command.com only)
MSDOS 6.22 (168KB, zipped)
DR-DOS 6 (112KB zipped)
ELKS (....KB zipped)
Command Line Options
ISS186 [options] [filename]
| Option | Function |
| -q | Quiet mode, suppresses the ISS186 messages. |
| -lf filename | Load filename into Flash memory (16MByte or 1.44MByte image) |
| -nwb | Do not write flash memory image back to disk (like CTRL-Break) |
| -nf | No Flash, do load the default flash image. |
| -com1 port | Connect ISS186 virtual com1 to port, default speed is 9600,N,8,1 |
| -com2 port | Connect ISS186 virtual com2 (default console) to port. |
| -wcp x | Write x to the configuration port, defaults to 0x11 (Boot from 16MByte flash) |
Quick Usage
Unzip the ISS186 and FreeDOS file to a suitable directory, open a DOS/CMD/Cygwin box and invoke ISS186.exe, the output should look something like:
H:\iss186\webversion>iss186
*** HTL80186 Instruction Set Simulator ***
*** Ver 0.1 (c)2008-2009 HT-LAB ***
*** www.ht-lab.com\freeutils\iss186 ***
Initialising Flash image from freedos.bin (16128 Kbytes)
Config Port50 set to 0x81
Press CTRL-X to exit
Jumping to address 0xF000:0xE000 (abs=0xFE000)......
BIOS186 80188/80186 Bios ver 1.0c
(c)HT-LAB 2005-2009
All rights reserved.
Config IO Port : 0x81
Memory in Kbyte : 640
Flash Image C,H,S : 32,16,63
Booting......
FreeDOS kernel build 2038 [version Mar 9 2008 compiled Feb 08 2009]
Kernel compatibility 6.22 - WATCOMC
(C) Copyright 1995-2006 Pasquale J. Villani and The FreeDOS Project.
All Rights Reserved. This is free software and comes with ABSOLUTELY NO
WARRANTY; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation;
either version 2, or (at your option) any later version.
C: HD1, Pri[ 4], CHS= 0-1-1, start= 0 MB, size= 15 MB
FreeCom version 0.82 pl 3 [Feb 14 2009 11:48:00]
ISS186 C:\>
Make sure that the FreeDOS image is located in the same directory as the ISS186 executable otherwise the serial Intel hex bootloader will run. Once finished press CTRL-x or CTRL-Break to terminate the simulator. The difference between CTRL-x and CTRL-Break is that CTRL-x will write the flash memory image back to disk. If you don't want this to happen add the -nwb option when invoking ISS186.EXE or use CTRL-Break.
Executed 4307227 Instructions in 6 seconds [717 KIPS]
Writing 16128 Kbytes back to freedos.bin
If you downloaded one of the floppy images then you have to use the -wcp and -lf command line options:
H:\iss186\webversion>iss186 -wcp 01 -lf drdos6.img
*** HTL80186 Instruction Set Simulator ***
*** Ver 0.1 (c)2008-2009 HT-LAB ***
*** www.ht-lab.com\freeutils\iss186 ***
BIOS186 80188/80186 Bios ver 1.0c
(c)HT-LAB 2005-2009
All rights reserved.
Config IO Port : 0x01
Memory in Kbyte : 640
Flash Image C,H,S : 80,02,18
Booting......
Loading...
DR DOS Release 6.0
Copyright (c) 1976,1982,1988,1990,1991 Digital Research Inc.
All rights reserved.
Kompas Computers International Ltd.
Date: Sat 8-15-2009
Enter date (mm-dd-yy):
Time: 17:03:30.43
Enter time:
A>
How to Modify the Boot Image
The ISS186 boots by default from an image located at 0xE0000-0xEFFFF (64KByte bank-switched). There are 2 ways to modify this Flash/Floppy image. You can connect the ISS186 virtual COM1 (COM2 is used for the console) to one of your serial ports and use one of the standard serial protocols such as Kermit/Xmodem to transfer files to and from the image. This method is used on a Prototype board. The second and easier method is to simply modify the Flash/Floppy image directly. This can be done using a disk image processing tool such as the excellent WinImage.

Figure: Using WinImage to update the Flash Image
HTL186C Configuration Port
The HTL186C embedded BIOS186 read a configuration byte from an 8bits input port located at I/O address 0x50. This configuration port can be used to change the default bootloader and the flash image size as shown below. On a prototype board this port is normally connected to an 8-bits DIP switch or hardwired in the RTL code. For the ISS186 this port can be set using the -wcp command line argument.
Configuration Port
bit7 : 0=1.4MByte Floppy Image, 1=16MByte Harddisk Image (default)
bit6..3 : Unused
bit3 : 0=Boot from Flash Image at 0xE0000-0xEFFFF(default), 1=Boot from SDRAM Image at 0xD0000-0xDFFFF.
bit2 : 0=Disable reporting unsupported BIOS calls (default), 1=enable.
bit1..0 : 00=Serial Intel Hex loader, 01=Boot from Flash (default), 1x=Boot from Compact Flash
Bit7 is used to distinguish between a Floppy and a Harddisk/Flash image. Both the Floppy and Flash image must be 1.44MByte and 16Mbyte respectively, you cannot load an arbitrary size image. The Compact Flash and SDRAM options are not implemented on the ISS186.
Example : Boot using the serial Intel Hex bootloader (9600,N,8,1):
H:\iss186\webversion>iss186 -nf -wcp 0 -com2 com1
*** HTL80186 Instruction Set Simulator ***
*** Ver 0.1 (c)2008-2009 HT-LAB ***
*** www.ht-lab.com\freeutils\iss186 ***
ISS186 COM1 redirected to com1
com1 Initialised OK
Config Port50 set to 0x00
Press CTRL-X to exit
Jumping to address 0xF000:0xE000 (abs=0xFE000)......
BIOS186 80188/80186 Bios ver 1.0c
(c)HT-LAB 2005-2009
All rights reserved.
Config IO Port : 0x00
Memory in Kbyte : 640
Starting serial Intel Hex loader....
>
The bootloader now waits for valid Intel hex frames on COM1. To upload a file one can either use:
- A PC with 2 comports (or two USB_to_RS232 cables) and connect them via a NULL modem crossover cable
- A second PC
- com0com to create 2 virtual comports (one for the terminal and one for iss186.exe), then use a bridge such as hub4com to virtually connect the 2 comports. Note: I have not yet tried this method.
HTL186C Memory Map
The memory map is shown in the figure below. The top 4KByte and the bottom 2.5KByte of the memory map are used by the BIOS. The Flash memory image consist of 256 pages each 64Kbyte in size. Each 64KByte page can be bank-switched into 0xE0000-0xEFFFF region by writing to I/O register 0x55. By default the Flash image is under control of the BIOS. The remainder of the memory is free for user applications.

ISS186 CONSOLE I/O
As mentioned in the beginning all console communications is done over one of the comports, namely COM2. The BIOS186 will redirect some, but not all of the INT10 and INT16 calls to COM2. BIOS calls that are not implemented are silently ignored unless you enable bit2 in the configuration port.
Example: (note only part of the screen output is shown below)
H:\iss186\webversion>iss186 -wcp 0x85
...
All Rights Reserved. This is free software and comes with ABSOLUTELY NO
WARRANTY; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation;
either version 2, or (at your option) any later version.
C: HD1, Pri[ 4], CHS= 0-1-1, start= 0 MB, size= 15 MB
*** BIOS Error INT,AH=10,0F
*** BIOS Error INT,AH=10,0F
*** BIOS Error INT,AH=10,12
*** BIOS Error INT,AH=10,08
FreeCom version 0.82 pl 3 [Feb 14 2009 11:48:00]
ISS186 C:\>
The ISS186 will read from COM2 and displays the received characters on the screen, similarly anything you type on the keyboard will be transmitted to COM2. You can redirect the ISS186 COM2 to one of the real comports or you can use the DOS CTTY function, both will give similar results. Note that there is also no cursor control, this can however be added using ANSI ESC sequences.
The ISS186 will detect and issue a warning if software is trying to read/write to video memory (0xA0000-0xC0000) and or one of the standard 6845 video controller registers (0x3B0-0x3BF for MDA, 0x3D0-0x3DF for CGA).
Loading ELKS kernel
.........................................................................
Starting ...
Warning: trying to access non-supported 6845 Video Controller
ISS186 Performance
To give a performance figure, on a 2.66GHz Core 2 PC the system runs at about 650KIPS (650000 Instructions Per Second). Assuming an average of 8 clock cycles per instruction this translate roughly to about the same speed as an original IBM PC (4.7MHz). The reason for the relative poor performance is that the ISS186 simulates at the clock level, that is, a clock variable is updated and fed to all peripherals. The memory is modeled with a single access point. This means that an instruction like XCHG AL,[SI] will require a minimum of 2 clock cycles (1 Read and 1 Write cycle). All this was done to enable the peripherals/processor to be used on an RTL simulator (with a SystemC wrapper) like Modelsim.
The HTL80186 support unknown instruction trapping via interrupt 6. A large number of DOS application available on the web require as a minimum a 386 processor. When you execute such a program on the ISS186 you either get a polite message:
ISS186 C:\>fasm test.asm
flat assembler version 1.67.38
error: required 80386 or better.
or the FreeDOS int6 will trap it or you get an ISS186 crash/hang.
Known Issues
- Kermit (Freedos Image, kerlite.exe) takes a long time to invoke and seems to hang after each command, it does work though.
- chkdsk seems to hang.
FAQ
- Is the source code available?
Sorry not at this time. However most of the listed simulators above are supplied in full source. - Why didn't you add as a minimum a CGA controller?
The HTL80186 is an embedded controller targeted so called headless (no screen/keyboard/mouse) systems. - Can I load a different BIOS
I might add that in later release. On the current HTL80186 the BIOS is ROM based. - Can I use a 360Kbyte image?
No, unfortunately the BIOS can not (yet) work out the CHS value of an image.
Useful links
- FreeDOS Project
- DRDOS Home Page
- OpenDOS unofficial homepage
- Borland C++ 1.01 Compiler Download Page
Contact HT-LAB for more info.
