The LazyBoy Library Manual

(extended typographic error edition)

(aka. DOSKit 4.0 pre-release)

(for NASM 2.16.01 or later)
(just really small text that is very hard to read)

LazyBoy is the next generation of my DOSKit. I'm just developing it under the working title of LazyBoy during the creation of this new version of the library and a new DOS program. Those sources include newest version of the LazyBoy library sources. Eventually, LazyBoy will probably be ported back to DOSKit as version 4.0. Then again, maybe not. Now many weeks into this project, I'm starting to get very attached to the working title.

LazyBoy provides a large set of interwoven macros that provide a near high level language experience when programming in assembly. Things like windowed text output, mouse support, displaying large numbers in different formats, and much much more. The code supporting such things is compiled conditionally when needed. For example, if you don't need to display a ZWORD as an signed integer, then that code is excluded from the compiled binary.

The LazyBoy library absolutely requires NASM 2.16.01 or better. Don't even bother trying to use 2.15.03 or a lesser version. You will be sadly disappointed. Yeah, I know this is for DOS. But, it has a bunch of complex macros that make the library possible. Some of which is not supported as written in the library with older compiler versions.

The library, manual and other included files are all released under the BSD 3-Clause License.


In general and unless otherwise stated, all library macros and macro sets have the following behaviour and requirements:

  • The library is optimized to only include the required code and data which are needed to support the macros used by the program.
  • Nearly all macros have a prefered set of registers. Although passing other registers as parameters to those macros may be desired and is acceptable, using the prefered register will generate the least amount of compiled code.
  • DS register MUST always equal the main data segment when invoking a library macro. This library is intended for use in creating flat binaries (COM files) for DOS. So, DS should be equal to CS when calling the library macros. Maybe someday, I'll put in an effort to support EXE files.
  • Unless stated otherwise, the macros will preserve all registers except the Flags register. There are other macros in the library that are primarily for internal use by the library. The internal macros are not described in this document and you should refrain from using them. They could completely change at any time.
  • Macros revolving around a specific purpose are grouped together. Several of those macro groups (like CRT, XMS, MICE, etc) must be initialized before they can be used. This is performed at program startup and has some overhead. For example, the CRT macros need a lot of information to be present regarding the display before it can be used. This information is automatically initialized when the program starts. However, those groups can be disabled by creating a define to exclude the initialization of that group to reduce the compiled binary file size. For instance, to exclude all CRT support, simple place a %define NO_CRT before the %include "lazy.inc". There is also a means to just postpone the initialization of those groups until a later point in the program.
  • The core of the library ensures DOS 5.00 (or better) and there is at least a full segment of memory (64kb). It also sets up a stack and provides the safe program shutdown process used by other portions of the library. Even with the included error messages (like "unsupported DOS version") it weighs in at only about 1/4 of a kilobyte.


You will probably want to get started by checking out one of these: