I/O ports and Hardware Interrupts


Emulator supports user-created virtual devices that can be accessed from assembly language program using in and out instructions. Devices that can be created by anyone with basic programming experience in any high or low level programming language.



Input / Output ports

emu8086 supports additional devices that can be created by anyone with basic programming experience in any language device can be written in any language, such as: java, visual basic, vc++, delphi, c#, .net or in any other programming language that allow to directly read and write files. for more information and sample source code look inside this folder: c:\emu8086\DEVICES\DEVELOPER\

The latest version of the emulator has no reserved or fixed I/O ports, input / output addresses for custom devices are from 0000 to 0FFFFh (0 to 65535), but it is important that two devices that use the same ports do not run simultaneously to avoid hardware conflict.

Port 100 corresponds to byte 100 in this file: c:\emu8086.io , port 0 to byte 0, port 101 to byte 101, etc...




Emulation of Hardware Interrupts

External hardware interrupts can be triggered by external peripheral devices and microcontrollers or by the 8087 mathematical coprocessor.

Hardware interrupts are disabled when interrupt flag (IF) is set to 0. when interrupt flag is set to 1, the emulator continually checks first 256 bytes of this file c:\emu8086.hw if any of the bytes is none-zero the microprocessor transfers control to an interrupt handler that matches the triggering byte offset in emu8086.hw file (0 to 255) according to the interrupt vector table (memory 0000-0400h) and resets the byte in emu8086.hw to 00.

These instructions can be used to disable and enable hardware interrupts:

cli - clear interrupt flag (disable hardware interrupts).
sti - set interrupt flag (enable hardware interrupts).

By default hardware interrupts are enabled and are disabled automatically when software or hardware interrupt is in the middle of the execution.

Examples of Custom I/O Devices

Ready devices are available from virtual devices menu of the emulator.