So what do you need? Many people will have access to the Microsoft Software Development Kit (SDK) and Microsoft assembler (MASM), so this is a good starting point. In my previous book I showed how the SDK and MASM could be used to write a complete assembly language program, but I now consider to be behind the times. However, I constrained the program in this chapter to work with in which case the earliest tools that I can guarantee the program to successfully assemble and link with are in Table 4.1.
Note that SLIBCEW and are C run-time libraries, and are not required for the skeleton. However, in a situation where you would need them to call C run-time functions, investigate using startup code supplied by the vendors, for correct initialisation (the next chapter shows how to link the Borland startup tile, COWS.OBJ; Microsft’s MASM supplies APPENTRY.OBJ). Whenever you see the letter in a filename, it usually means “Small model”, while the letter designates “Windows”.
of the f o o l s
Table 4.1: Earliest versions that will generate an executable. MASM.EXE (C ( C RC.EXE (SDK .O) RCPP.EXE (SDK .O) RCPP.ERR (SDK LIB W.LIB (SDK SLIBCEW.LIB (SDK the SDK) TASM.EXE ditto ditto ditto ditto IMPORT.LIB ditto
Borland The second column of Table 4.1 contains the earliest Borland
other tools versions that will work. Other LINK versions should be ok, as long as they are Windows-compatible. MASM prior to 5.10 should also be ok.
The normal situation is to have the SDK installed with everything
of the in the appropriate directories. The manuals with the SDK, C
and MASM explain how the environment variables need to be set so that MASM and LINK can find the appropriate files. Or, you could have one of the other development systems installed, such as Borland C++, that do not need the SDK as a separate entity. Note also the Microsoft C/C++ and later is bundled with elements of the SDK.
Actually, the main reason that you require the SDK is for the p r o g r a m s R C . E X E , t h e i m p o r t f i l e L I B W . L I B , a n d Windows-compatible LINK. The SDK does have some other tools, such as a debug version of Windows, but most of these tools are available with recent compilers. There are also a lot of useful manuals with the SDK. Microsoft has gone away from supplying printed manuals, and wherever I refer to a Microsoft manual in this book, it will be on-line; although, in most cases it should also be available for purchase separately. I personally prefer printed manuals.
If such housekeeping (i.e., the correct installation of all the software tools) is too much trouble, get together all the above files, or suitable equivalents, and put them all into the same directory. Problem solved.
Look ahead through this book and you’ll see examples of files for both Microsoft and Borland.
and Borland version notes 5 Quick assembler
I must emphasize again that this chapter is a “legacy chapter”. I am using the oldest tools and the most primitive assembly language skeleton. This is not what I recommend for actual development, but the very basic skeleton is excellent for learning. I have included all of the meandering through version numbers below, partly to record what I remember, before I completely forget! Should you wish to learn this skeleton and you only have old development tools, or you need to modify or maintain legacy code, you will find this information useful.
MASM prior to version 6.00 can’t handle the high-level language used in subsequent chapters, so I recommend upgrading if you don’t have it. The alternative is the long-winded program given in this chapter. In fact, at the time of writing, the latest version is 6.11, and I recommend that you use it in preference to all earlier versions, including version 6.10. Microsoft made some important changes in the upgrade from 6.10 to
Other older assemblers may be able to handle the code in this chapter.
Borland TASM prior to should be ok for this chapter, but has enhanced features and is the basis, along with TASM of the program in the next chapter. At the time of writing, the latest is version 5.0 (see Chapter 13).
Microsoft Quick assembler should be ok for this chapter. I think that Quick assembler version 2.01 can be considered equivalent to MASM version 5.2.
All of this upgrading is difficult to keep up with, but the above notes should prove helpful.
Of course, as mentioned above, with some language products, such as those from Borland, you don’t need to have the SDK installed, though I certainly recommend the SDK documentation.
Note that even if you are only interested in writing in-line assembly within your high-level code, consider this chapter to have important buiding-block educational information. Many modern compilers allow in-line assembly, and this is developed further in Chapter 6.
I have gone through the above outline of products and versions and based this chapter on early tools, as not everyone has access to the latest tools. Also, it is actually quite educational to analyse a Windows assembly language program written with an earlier assembler minus the high-level features. Having understood
# SKELETC #define #define skeleton E Ml
exactly what is happening, high-level features can be introduced later, for much more streamlined programs.