◄Up► ◄Contents► ◄Index► ◄Back► ──────────────────────────────────────────────────────────────────────────── To use DOS macros (Int 21h), include DOS.INC. To use BIOS macros (Int 10h), include BIOS.INC. When calling the macros, you are responsible for saving and restoring registers used in macros. The "Uses" field in the macro description identifies registers to save. Symbols must be previously defined before they can be passed as arguments to most of the DOS macros. Generally this means that data must be declared before code in the source file. Macros that accept address parameters use internal macros that allow you to specify addresses in several ways. The macro automatically identifies the type of the argument and handles it appropriately. For example, assume the following declarations: NPBYTE TYPEDEF NEAR PTR BYTE FPBYTE TYPEDEF FAR PTR BYTE Msg BYTE "test$" npMsg NPBYTE Msg fpMsg FPBYTE Msg Given these values, the macro @ShowStr (which displays the string at DS:DX) has the following effects: Argument Type Example Value Loaded Label of byte variable @ShowStr Msg DS:OFFSET Msg Near pointer variable @ShowStr npMsg DS:npMsg Far pointer variable @ShowStr fpMsg fpMsg[2]:fpMsg[0] Constant @ShowStr 0 DS:0 Pointer in register @ShowStr si DS:SI Near pointer with @ShowStr pMsg, es ES:pMsg segment Constant with segment @ShowStr 0, es ES:0 Register with segment @ShowStr di, es ES:DI NOTE: If a far pointer or a segment is given, DS must be saved before the macro call and restored afterward. Segments may be given as registers, constants, or word variables. -♦-