Intel 8086 monitor program that fits in a single boot sector
Go to file
Nero d1cc870337 Import work 2021-01-29 00:44:26 +00:00
Makefile Import work 2021-01-29 00:44:26 +00:00 Import work 2021-01-29 00:44:26 +00:00
mon8086.asm Import work 2021-01-29 00:44:26 +00:00

A control monitor program for the Intel 8086 in a single sector (512 bytes)

Its main use it to help me debugging disk i/o and boot issues on IBM PC compatibles.


Run make. Requires the NASM assembler.

How to get it running

You can run make qemu to make it run in qemu.

If you want to run it on a real machine, you need to write it to the boot sector first:

dd of=/dev/sdb1.

Input commands

There is no real line editing - key presses have instant effect.

  • D: Dump the memory at the memory pointer. The pointer is advanced by the dumped bytes.
  • E: Edit bytes at the memory pointer. You can cancel the editing by pressing space.
  • S: Edit the segment of the memory pointer.
  • O: Edit the offset of the memory pointer.
  • R: Show the register set and next instruction bytes.
  • V: This command expects a two-character argument naming the register to be changed. It allows then to edit the register value.
  • G: Start execution at CS:IP address
  • T: Single-step a single instruction at CS-IP

Several commands allow the user to edit a value. While editing, pressing space results in the value being discarded. The monitor will then return to the prompt. This is useful for the inspection of values.

Sample inputs

Hexdump the bios data area

S 0040
O 0000

Query drive parameters

E B4 08 B2 80 CD 13 CC

Replace the 80 with the bios drive number (00, 01 and 80 are common values). The results are spread over the CX and DX registers, check Ralf Browns Interrupt List or your BIOS documentation for INT 13h/AH=8 on how to interpret the results.

Boot arbitrary drive

O 7BF2
E B8 01 02 B9 01 00 BA 80 00 BB 00 7C CD 13

Replace the 80 with the bios drive number (00, 01 and 80 are common values).

Reboot the machine

V IP 0000