Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
DOS subroutines for C and Assembler
Scanlon L. (ed), Parker M., Windcrest/McGraw-Hill, Blue Ridge Summit, PA, 1993. Type: Book (9780830641604)
Date Reviewed: Oct 1 1994

Using this book will save programmers time and free them from creating subroutines from scratch. It provides more than 100 commonly used subroutines, which are thoroughly explained and documented and available on disk, so everything is at the user’s fingertips. The book is intended to serve as a cookbook or toolbox from which programmers can draw subroutines as needed. It should prove useful to both beginners and occasional programmers, because it not only gives pretested and hopefully error-free code, it presents a correct way to prepare programs. The book assumes that the reader has some assembly language programming knowledge on an MS-DOS compiler and experience in writing either C or C++ programs, and assumes familiarity with the manuals for Microsoft Macro Assembler, Borland Turbo Assembler, and the Borland C/C++ compiler.

This volume is not just a cookbook, but also a mini-tutorial on assembly and mixed-language programming. The book also summarizes the most important information about the microprocessors, the Macro and Turbo Assemblers, and the assembly language instruction set. By providing tutorial material, the authors have attempted to put all the essential details in one place.

The book is divided into 21 chapters. Chapters 1 through 4 describe the microprocessors from a programmer’s standpoint, covering their internal register and addressing modes; the assembly language instructions (commands and directives); the entire microprocessor instruction set in functional groups; and four program models that can be used as starting points for creating programs (the assembly driver, assembly routine, C driver, and C++ driver). These models contain the boilerplate that the assembler or compiler requires each program to have.

Chapters 5 through 21 present the subroutines, grouped by function: memory operations; 32-bit binary arithmetic; 16-bit decimal arithmetic; 32-bit shift and rotate operations; a variety of code conversion; string manipulation; dealing with lists; general-purpose input and output; time and date operations; IBM PC–specific input and output; DOS-like operations for disk drives, subdirectories, and disk files; disk input and output; and some miscellany. Each function is presented by providing the source code listing, how it operates, how to specify its entry values, the results expected, the command needed to link it to the calling program, and other subroutines it calls. In many cases, the authors give an example of the subroutine’s use.

Three useful but not unusual appendices--tables to convert hexadecimal to and from decimal, the ASCII character set, and the microprocessor instruction set in alphabetical order--complete the book.

Undoubtedly, as a cookbook, toolbox, or mini-tutorial, this book is useful for assembly language programmers. Skilled C or C++ programmers will be less impressed. The authors make some important points about the book, however. First, to call assembly language subroutines from C and C++, all that a C programmer needs to know to use a function are the purpose of the function, the number of arguments and their types, and the type of the value (if any) returned by the function. Second, four program models are presented as templates: they contain the framework that establishes the proper format for assembling. The user only has to insert the instructions and data for a particular application. About the only discernible difference between C and C++ drivers is the prototype for the assembly-written function. Due to the polymorphism of C++ (the support of virtual functions), a given function can be called with various numbers and types of arguments.

Finally, the disk included contains all of the subroutines discussed in the book. Both C and assembler files are included, along with compiled object files that are ready to be linked with the user’s driver programs. The only benefit of using assembly language is that the resulting programs run faster, but it has some important disadvantages: coding, testing, and maintaining assembly programs is not faster, easy, or flexible, and they are harder for humans to read. These drawbacks are why a book like this, written in a good teaching style, is useful.

For the sake of programming simplicity, the authors have chosen to use the small memory model in all subroutines in this book. Many difficult problems arise when using the other memory models (compact, medium, and large), and serious and powerful programs do not fit in less than 64K, but need more space. For the future, or for a second edition, I suggest that the authors improve the assembly subroutine set, especially when dealing with memory operations (it is important to know how to deal with the new pointers).

Reviewer:  L. Cecal Review #: CR117187
Bookmark and Share
 
Dos (D.4.0 ... )
 
 
C (D.3.2 ... )
 
 
C++ (D.3.2 ... )
 
 
Macro And Assembly Languages (D.3.2 ... )
 
 
Procedures, Functions, And Subroutines (D.3.3 ... )
 
Would you recommend this review?
yes
no
Other reviews under "Dos": Date
Dvorak’s guide to DOS and PC performance
Dvorak J. (ed), Nick J., Osborne/McGraw-Hill, Berkeley, CA, 1991. Type: Book (9780078816581)
May 1 1992
DOS 5 made easy
Schildt H., Osborne/McGraw-Hill, Berkeley, CA, 1991. Type: Book (9780078816901)
Jun 1 1992
Maximizing MS-DOS 5
Solomon D., Boyce J., Coulter M., Ellis J., Kusnierz D., Marchi M., Stuple S., Trout D., Underdahl B., White K., New Riders Publishing, Thousand Oaks, CA, 1991. Type: Book (9781562050139)
Aug 1 1992
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy