KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q34467: MASM 5.10 MACRO.DOC: DOS Macro Syntax and Description

Article: Q34467
Product(s): See article
Version(s): 5.10   | 5.10
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | | mspl13_masm
Last Modified: 12-JAN-1989

The following information was taken from the MASM 5.10 MACRO.DOC file.

DOS Macro Syntax and Description

KEYBOARD INPUT

@GetKey (01h, 07h, 08h, 0Ch)

Gets a keystroke from the keyboard

Syntax:         @GetKey [#echo] [,[#break] [,#clearbuf]]

Arguments:      echo        = nonzero to echo keystroke -
                              default yes
                break       = nonzero to accept Control-C - default
                              yes
                clearbuf    = nonzero to clear keyboard buffer -
                              default no
                (Arguments may be omitted to get defaults)
Return:         ASCII code of key in AL
Registers used: AX used for all, DL used if echo on and ctrl
-c off

@GetStr (0Ah)

Gets a string from the keyboard

Syntax:         @GetStr &buffer [,[$terminator] [,[#limit]
[,segment]]]

Arguments:      buffer      = Offset of buffer where string will
                              be stored
                    Byte 1  = Maximum length of string (before call)
                    Byte 2  = Actual length of string (after call)
                    Byte 3+ = Bytes of string
                terminator  = Terminating byte - usually null (0) or
$ (24h)
                limit       = Maximum length of string (if not given
                              as argument, must be in buffer before
                              macro call)
                segment     = Segment of buffer (DS if not given)
Return:         Pointer to string in SI, length of string in BX
Registers used: AX, DX, BX, SI

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.