Without Me It Just Aweso
Without Me It Just Aweso

Reputation: 4873

DOS execution of assembly code

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!

Upvotes: 4

Views: 1888

Answers (3)

Without Me It Just Aweso
Without Me It Just Aweso

Reputation: 4873

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.

Upvotes: 2

dante
dante

Reputation: 129

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

Upvotes: 1

matja
matja

Reputation: 4179

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.

Upvotes: 1

Related Questions