FASM (flat assembler) – “is a fast assembly language compiler for the x86 architecture processors, which does multiple passes to optimize the size of generated machine code. It is self-compilable and versions for different operating systems are provided. All the versions are designed to be used from the system command line and they should not differ in behavior.” (flat assembler 1.71 Programmer’s Manual. 1.1 Compiler Overview)
MS-DOS 6.22 (or later) or latest version DOSBox is already installed, configured and running.
1. Download the latest version of flat assembler for DOS. What you’ll get is a .zip file that contains all the files needed to use fasm. If you uncompressed the file, you will see something like below:
FASM requires a DOS Protected Mode Interface (DPMI) to run from DOS real mode environment, so make sure you download one as well. You can get the latest binary version for DOS from this site: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/cwsdpmi.html.
For MS-DOS running in VirtualBox, you need to convert these files first into a disk image with software like WinImage. Of course you may use any disk image creation software as long as you can have a 1.44 MB floppy image of the files so you can feed it in MS-DOS VirtualBox as floppy. Below is the step-by-step tutorial on how to do it with WinImage:
|B.||Click the “New” button. When the format dialog box appears, select the 1.44 MB Standard Format.
|C.||Drag all the files you want to save into the 1.44 MB Floppy Image, make sure they fit. Then click the “Save” button to save the image in the directory of your choice.
|D.||Run your MS-DOS virtual machine from VirtualBox, then mount the FASM image file you created above. The contents will be accessible via Drive A.
Once it’s mounted. you can install FASM from there by simply copying the binaries into the hard disk of your MS-DOS virtual machine. You may use the following steps to install fasm:1. Create FASM directory in your hard disk:
2. Go to drive A and unzip FASM into “C:\FASM”. You may download pkunzip program from the following site if you don’t have one: http://www.netogram.com/keliks/click.php?id=133
That’s because DPMI is not yet set. So the next step is to install DPMI.
3. Execute DPMI using the following command
|F.||Automate execution of DPMI and include fasm’s directory in the path. Edit autoexec.bat and add the following highlighted texts:
Reboot your computer. You should now be able to use FASM without error.NOTE: Another way to execute DPMI automatically is through CONFIG.SYS. Just add the following line:
INSTALL C:\UTILS\DPMI\BIN\CWSDPMI.EXE –p –s-
or if upper memory block (UMB) is available via EMM386.EXE, you may want to try INSTALLHIGH instead of INSTALL only.
3. How to Install FASM in DOSBox?
Since DOSBox uses your host operating system’s file system, all you have to do is extract the FASM files and DPMI files into the mounted directory used by DOSBox. Then edit the DOSBox configuration file (dosbox-0.74.conf) and add the following lines at the bottom:
C:\CSDPMI7b\CWSDPMI -p -s-
Of course, make sure that you use the right path. This will automatically execute CWSDPMI.EXE upon startup. As an added convenience, make sure you add the path of FASM directory so you can run it anywhere in DOS. If everything is correct, you should see something like below: