Question

I need to create an executable from the next assembly code:

.MODEL SMALL
.DATA
TEXT DB 'Hello world!$'

.CODE
.STACK 20
.STARTUP
MOV AX, @DATA
MOV DS, AX
MOV AH, 9
MOV BL, 02H
INT 10H
MOV Dx, OFFSET TEXT
INT 21H
MOV AH, 4CH
INT 21H
END

It works with Turbo Assembler (tasm.exe), but I don't want to continue working with it, because it doesn't run in Windows 7.

Thanks.

Was it helpful?

Solution

If there is an ongoing need to develop MSDOS programs, run a 16-bit environment like DOSBOX. That way tasm.exe—one of the finest assemblers of its day—can also run, along with your program, and the tools that go with tasm—Turbo Debugger, Turbo Linker, and Turbo C.

You could also install Windows XP or Windows 98 over Windows 7, as a multi-boot alongside it, or in a virtual machine hosted by Windows 7. Either way, you'd then have the ability to run MSDOS programs without hassle.

As Greg Hewgill mentioned, major rearchitecting of the program is needed for it to run in a 32-bit (or greater) environment.

OTHER TIPS

use Microsoft macro assembler (MASM)

You could try NASM or MASM, but your source will likely need minor changes to work with those.

Your code as given is suitable for 16-bit DOS systems. To use a modern assembler, you will have to modify your code to work in a 32-bit environment, which may be a nontrivial process. All the code you've given so far will need to be rewritten.

I recommend NASM as it is an active, well supported project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top