开发者

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 开发者_C百科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!


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜