
Click above to get retro games delivered to your door ever month!
X-Hacker.org- TASM 2.x / MASM 6.x Assembly Language - <b>arg sets up argument stack tasm directive</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ARG Sets Up Argument Stack TASM Directive
ARG argument [,argument] ...[=symbol] [RETURNS argument [,argument]]
ARG is used inside a PROC/ENDP pair to help you link to high level
languages. Using ARG, you can access arguments pushed onto the stack.
argument describes a parameter the procedure is called with. After
you use ARG, you can refer to each argument by name in your source
code. TASM replaces each reference by the appropriate [BP + n] stack
reference.
List the arguments in the same order as they appear in the high level
language call. Specify each argument like this:
name:[distance] type
If you do not specify a type, WORD is assumed. After you use ARG, you
refer to the arguments passed to the procedure by name in your code. For
example,
MYPROC PROC NEAR
ARG PAR1:WORD, PAR2:BYTE
:
In the code that follows, you can now refer to PAR1 or PAR2, and the
correct [BP + n] expression will be substituted automatically by the
assembler.
The optional RETURNS keyword indicates one or more arguments that
will not be popped from the stack upon return.
Notes: See PROC for more information. You must first establish
the calling convention by specifying a language with the
.MODEL directive (e.g., specifying C makes the assembler
use the C calling convention).
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson