Compiling bsect.asm of X86 to create bsect.img

Published on March 18, 2010

Most of the programmers find it difficult to compile the bsect.asm file. This is because of 32 bit assembly controller and not defining the build.bat file properly. Here you will find simple steps to compile the bsect.asm.

To compile the bsect.asm we need 32bit assemble compiler. Microsoft provides MASM32, which is a 32 bit assembly compiler.

Download the 32bit assembly compiler from the following link “”

Install the MASM32 SDK in “C” drive.

Step 2:
Use Visual Studio command prompt for compiling, open the prompt and go to the bootsector location or the location where bsect.asm file available.

Step 3:
“The system cannot find the path specified” error will occur if the build.bat file is not changed.
Then change the build.bat file from

ml /Zm /c bsect.asm
c:\msvc\bin\link bsect.obj,,,,,
debug < getbsect.scr


C:\masm32\bin\ml /Zm /Flbsect.lst /c bsect.asm
C:\masm32\bin\link16 bsect.obj,,,,,
debug < getbsect.scr

Define the path correctly. It is the path of the drive in which MASM32 is installed.

Step 4:
Give build command in the Visual Studio command prompt to compile.
After compiling you can find the “BSECT.IMG” file in the bsect.asm folder.

Recently Published