4

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!

Without Me It Just Aweso
  • 4,593
  • 10
  • 35
  • 53
  • TSR's? DOS? Suddenly it's 1985 all over again. Does XP even support TSR's? – S.Lott Nov 09 '09 at 14:25
  • http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/dosonly.mspx?mfr=true I guess you can still do this. Amazing. – S.Lott Nov 09 '09 at 14:27
  • Now I'm curious - what does your tsr do? Or is it just a learning experience? – Michael Kohne Nov 09 '09 at 14:31
  • 1
    its just for learning. i've been taking assembly classes at school and want to mess with actually using some of the knowledge. – Without Me It Just Aweso Nov 09 '09 at 14:52
  • @ZJR DOS is still somewhat common in some embedded x86 systems where you want the benefits of an operating system with the flexibility of bare-metal access to the hardware. – San Jacinto Nov 16 '09 at 01:52
  • be warned, while assembly programming may look somewhat easy, assembling a working TSR which actually works without crashing require a very extensive knowledge of DOS and its inner workings – Patonza Nov 16 '09 at 14:40

3 Answers3

2

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
  • 4,593
  • 10
  • 35
  • 53
1

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
  • 4,014
  • 3
  • 23
  • 29
1

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.

dante
  • 129
  • 7
  • (http://web.archive.org/web/20071013092543/http://blogs.pcworld.com:80/communityvoices/archives/2007/10/using_masm32_wi.html) – mwfearnley Jan 15 '19 at 12:23