pairofstrings said:
How to write assembly language program in DOS mode? I want to type my assembly language program in some interface and compile and link and execute it. How do I do that?
Hey pair of strings and welcome to the forums.
I wrote DOS based assembly a long time ago (when DOS was the only thing for games), so I can give you some pointers.
If you want to write DOS based code, one thing you need to know is the DOS "interface" and by interface I mean the interrupt calls.
The interrupt calls are used for everything from opening files, to setting your video mode, to playing CD audio, to allocating memory, to basically everything!
Also you have to be aware of segmented memory model vs the flat memory model. When I did DOS programming back then, segments were the model over flat. Segments in my view are really stupid since segments actually overlap, where as with the flat model memory addresses are unique: don't ask me why they did the segmented model the way they did, but yeah that's just the way it is.
I can't help you out any more unless you be more specific about it is that you want to do. If you want to write library code for some platform like say BASIC (with CALL ABSOLUTE), then you just have to basically restore the state before you leave your call.
If you want to write an entire program in complete assembler, you will need to really get a good grasp of the DOS dev environment (i.e, the interrupts). You will probably have to implement some custom interrupt code for the keyboard and that requires writing an ISR and getting DOS to use that ISR when you're code is running.
If you want to do things like write a joystick or sound driver (to play wave files) you need to get specs for IO port calls and the like. Same if you want to do graphics stuff in 256 color mode.
Then on top of your code that deals with files, memory, input and so on, you need your program specific code.
Maybe you can tell me what you want to do so I can give you some specific advice. Also I'm wondering why you want to want to code in DOS: you can write code in assembly using something like windows, but I guess if you want the kind of low level control that the DOS environments offers (no protected memory!) then I can understand.