I noticed that there's quite a few asm. compilers/linkers out there. Being a beginner in this, I have no idea which is the one capable of coding the "old" DOS style programs and where it can be found. I know for a fact that for win32 programming everyone uses MASM32, but that's not something I'm looking for right now, I think it's easier to learn in DOS with no additional windows crap. So, help please.

gregd
[www.unpluggedsoftware.com]
Posted on 2002-01-19 23:18:08 by gregd
actually you'll find that DOS is much harder with it's segmented memory model. But you can use the MASM32 package, you just have to use another linker if I'm not mistaking. I think hutch has it at http://www.movsd.com
Posted on 2002-01-19 23:50:29 by Hiroshimator

... I think it's easier to learn in DOS with no additional windows crap...


Take Hiro's advice. There is more crap in DOS then you need to worry about! Besides the fact its rapidly going extinct...

But your intentions im sure are honest, and its wise to reduce the "confusion" in order to learn. But my advice is to likewise go with the MASM32.

If you want to "learn" asm with out the clutter, program console windows. They look just like DOS, yet you get all the freedoms of the 32 Bit Flat Memory model and more. As you feel better with asm, you can then start tinkering with MessageBox's and other bigger things.

Here's a Free Start :P . This is all that you need to do to get a console window to compile in MASM32.


.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc ; Windows stuff, (a must)
include \masm32\include\masm32.inc ; if you want Hutch's neto stuff
include \masm32\include\kernel32.inc ; a must!
include \masm32\include\user32.inc ; another must.
includelib \masm32\lib\kernel32.lib ; the lib's to go with includes
includelib \masm32\lib\user32.lib
includelib \masm32\lib\masm32.lib

.data ; defined data stuff (ie. A_Value DWORD 3 )

.data? ; undefined data stuff (ie. Another_Value DWORD ?)

.code ; Code starts here.
start:

[ Place your ASM tinkering here!]
[ remember to PRESERVE these if you use them ]
[ EBX, EDI, ESI, EBP ]
[ you can use em, just save/restore their info! or you'll get ]
[ program error type crash when program ends ~ everyone forgets at some point ]

call ExitProcess ; Only WIN API you need think about!
end start


When compiling, i use Hutch's Batch file "Buildac.bat" ~ Build All Console, found in the BIN dir of the MASM32 package.

Hope this is some interst to you...
:alright:
NaN
Posted on 2002-01-20 01:48:36 by NaN
Greg,

The advice you have been given here is good advice, 32 bit assembler is far simpler and a lot more powerful that DOS assembler because it uses a FLAT memory model. DOS used a 16 bit architecture which has a 64k address range limit and to build bigger programs, you had to use what is called segment/offset addressing which is a genuine pain to learn and write.

In DOS you accessed operating systems by what is called software interrupts and there is a far smaller range of those that there are Windows API functions which are just 32 bit operating system functions. DOS COM files are very simple technically but they have a size and capacity limitation that 32 bit PE files do not have in comparison.

With the MASM32 package, you have a reasonably easy entry into assembler programming and you have a library available to assist in doing basic things until you are ready to write your own. The other thing is windows API functions are no more complex than DOS interrupts but you can do many more things with them.

Regards,

hutch@movsd.com
Posted on 2002-01-20 02:43:10 by hutch--
... and if you really want to do dos, at least do 32bit extended dos,
with a flat memory model. The WDOSX extender (http://michael.tippach.bei.t-online.de/wdosx/) is quite good.
But really... one of the greatest advantages of WDOSX is that it has
the ability to load PE files and has implemented a (small) subset of
the win32 api... which should be a hint that win32 programming is
nicer than the cruddy old "int 21h" dos blah.
Posted on 2002-01-20 05:48:05 by f0dder
Thanks all for you feedback. Thing is, however, I .would like to learn 16bit programming using segments. Even if it's not generally used anymore. But I will take some of the advice, because I already knew most of it : - ) I only need the tools. I'm just interested about things such as what was used for writing those old games in 320x200 mode and things like that. Is it still possible to use the mode 13h in MASM32? Thanks again.
Posted on 2002-01-20 11:03:30 by gregd