Exotic programming languages for DOS: NBASM.
NBASM (NewBasic Assembly) is a x86 assembler/disassembler mostly compatible with MASM 5.1 and distributed by Forever Young Software. It actually exists for DOS 16-bit, DOS 32-bit (DPMI), Windows 32-bit, and Windows 64-bit. The software may be seen as being in pre-beta form, as there are several functionalities that are missing (and will be added in future releases). The download file includes the assemblers, the disassemblers, a linker, a nice library (with several useful functions concerning, for example, screen input/output and file access), documentation, and example programs. It also contains a 32-bit C-compiler.
NBASM is freeware, except for commercial use. It also includes free support by the author of the software.
This tutorial shows how to install and run NBASM v00.24.95 (16-bit version) and NBASM v00.27.16 (32-bit version) on MS-DOS 7.10. It should apply to MS-DOS 6.22 and FreeDOS, too.
NBASM can be downloaded from fysnet.net. Go to the bottom of the page and download the file nbasm.zip. It includes everything that you need on DOS, except for the linker, normally not needed, and available in the download file nbl.zip. The download archives contains the program’s folder structure. I extracted them on my Windows 10 and burned them onto a CDROM, aka created a CD ISO. On my MS-DOS 7.10 machine, I created the directories C:\NBASM and C:\NBASM\EXAMPLES and copied the corresponding files from the nbasm.zip download to there. If you get an "Overwrite nbdisasm.exe?" message, answer it with "no"; this is actually for the copy of the file nbdisasmw.exe (file with 9 characters name, truncated to 8 characters when copying it; is this MS-DOS 7.10 specific?). Several files in the C:\NBASM directory are not needed (they are files for Windows), and you should delete them: nbasm32.exe, nbasm64,exe, and nbdisasmw.exe (if it should have been copied). If you intend to use the linker (I did not test it), copy the files from the nbl.zip archive to C:\NBASM, renaming readme.txt and whatsnew.txt in order not to overwrite the corresponding files related to the assembler.
The screenshot shows the content of C:\NBASM. The files nbl_rdme.txt and nbl_wnew.txt are the renamed linker related files.
![]() |
The included sample program demo2.asm is intended to be assembled using the 16-bit assembler. Being in C:\NBASM, run the command
nbasm16 demo2.asm
The screenshot on the left shows the output of the assembler and the directory listing with the executable created. The screenshot on the right shows the output of demo2.exe.
![]() |
![]() |
The included sample program demo1.asm is intended to be assembled using a 32-bit assembler. Being in C:\NBASM, run the command
nbasm32d demo1.asm
This will (unless you have a DPMI server installed and it is your PATH) result in the error message Load error - no DPMI. You can download CWSDPMI from delorie.com. Among others, the archive contains a file called cwsdpmi.exe. The easiest way to use it, is to copy it to the C:\NBASM directory. For details about CWSDPMI, you might want to have a look at my Running 32-bit applications on DOS tutorial.
With the DPMI server installed, the assembly of demo1.asm is successful, and the resulting executable demo1.exe runs fine (it's obvious that you can only run it on a system with DPMI installed). The screenshot shows the program output, the last line scrolling horizontally from right to left (to terminate the program, hit the ESC key).
![]() |
The following code, intended for the 16-bit assembler, displays a "Hello World" message onto the screen, using DOS interrupt 21h for screen output and program termination (cf. my tutorial 16-bit assembly programming using NASM). On the left, we have the code for NBASM; on the right (as comparison) the corresponding code for NASM.
.model tiny .code org 100h mov dx, offset hello mov ah, 09h int 21h mov ax, 4c00h int 21h hello db 'Hello, World!', 13, 10, '$' .end |
org 100h section .text start: mov dx, hello mov ah, 09h int 21h mov ax, 4c00h int 21h section .data hello db 'Hello, World!', 13, 10, '$' |
I placed the NBASM file (hello1.asm) in the newly created directory C:\NBASM\MYPROGS. To start nbasm16.exe from this directory, the NBASM installation directory
has to be added to the PATH environment variable:
set path=%path%;c:\nbasm
And here is the code for the same program, code intended for the 32-bit DPMI assembler. Screen output is done by a call to the function "prtstring" of the NBASMC library (that awaits the string, as in C, with a 00h terminator); the program is terminated with a RET instruction, that here returns us to the DOS command line.
.model tiny
.external prtstring
.186
.stack 64
.code
mov ax, offset hello
push ax
call prtstring
ret
hello db 'Hello World from BASM 32-bit!', 13, 10, 0
.end
I placed the file (hello2.asm) in the directory C:\NBASM\MYPROGS. To start nbasm32d.exe from this directory the NBASM installation directory has to be added to the PATH environment variable (cf. above). Also, you must ensure that the assembler finds the library. This may be done by setting the corresponding assembler command line option. A simpler way is to copy nbasmc.lib to C:\NBASM\MYPROGS.
My thanks to Benjamin David Lunt, the author of NBASM, for sharing his programming passion ... for free!
If you find this text helpful, please, support me and this website by signing my guestbook.