Adding background music to a 8086 assembly game

I'm creating a dosbox game using assembly 8086 as my programming language. I want to add some background music to the game. I'm using tasm/masm assembler.

How am I supposed to do that and what do I exactly need ?

I'm trying to play midi files while the game is running.


  • DOS doesn't have any abstractions for PCM or MIDI sound, so you need to program the hardware directly. How this is done depends on the hardware.

    Here's a manual I found online about SoundBlaster cards:

    And here is some information about AdLib cards:

    There are many more resources you can find on Google with search terms such as "AdLib Programming", including YouTube tutorials.