tags:

views:

297

answers:

3

I'm writing a chunk of assembly that will register a tsr and then exit.

I'm struggling to figure out how to properly assemble this to a format that I can execute in dos.

i'm have access to ubuntu 9.04 and windows xp. (linux method is preffered). If anyone can tell me how i go about assembling my code into a dos executable format, and then how i execute it in dos i'd greatly appreciate it!

+1  A: 

If it's for a .COM executable, you just need an "org 0x100" at the start and assemble with "nasm -f bin", using nasm built for any OS.

For an .EXE you need a DOS linker, ie. the one which comes with TASM/MASM. I'm not sure if there is a portable 16-bit DOS linker, most tend to link 32-bit programs which run under a DOS-Extender.

matja
okay i was able to assemble with nasm but i'm confused on the linking portion. i downloaded masm and am trying to figure out how to link it
Without Me It Just Aweso
+1  A: 

IF you are using masm, then there is a 16 bit linker available ...http://blogs.pcworld.com/communityvoices/archives/2007/10/using%5Fmasm32%5Fwi.html - should help you.

dante
A: 

Incase anyone else happens upon here with the same question I had here is the answer I finally found. Its a free development environment that allows for easily making dos programs:

http://www.winasm.net/

the dev environment does all the backend work using masm so that has to be installed also but it handles all of the assembly and linking.

Without Me It Just Aweso