From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2124) id 7A3E03858D38; Fri, 12 Apr 2024 15:52:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A3E03858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712937158; bh=P183Ta6xS7AjwgWfAi0k5Na5LPuNf2e0vB1IVcwlrMc=; h=From:To:Subject:Date:From; b=cOk3triAmkWFwGVuJ+Bv0ucPyFBjoKBRgdwD4laB68KSMlQUrUGjIO4nxFbnZubGC lDqwTvN1GVqZ0ZLDNNqVe9B7PCgosJNwVFZw22EKrUamQSHptQfmvY4fPMWJFuWFYX EnpWjTv0GjCG/RPVqNuUj8p3/08xSjOKJp2NG2x4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Nick Clifton To: binutils-cvs@sourceware.org Subject: [binutils-gdb] Update description of macro keyword argument assignment in assembler documentation. X-Act-Checkin: binutils-gdb X-Git-Author: Nick Clifton X-Git-Refname: refs/heads/master X-Git-Oldrev: 3d67591c6ff0443e36cbc38ece082cc240e87bf6 X-Git-Newrev: 99daf56f4b4bf831bb29bffb79f2172f1b316cb9 Message-Id: <20240412155238.7A3E03858D38@sourceware.org> Date: Fri, 12 Apr 2024 15:52:38 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D99daf56f4b4b= f831bb29bffb79f2172f1b316cb9 commit 99daf56f4b4bf831bb29bffb79f2172f1b316cb9 Author: Nick Clifton Date: Fri Apr 12 16:51:51 2024 +0100 Update description of macro keyword argument assignment in assembler do= cumentation. =20 PR 31255 Diff: --- gas/doc/as.texi | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/gas/doc/as.texi b/gas/doc/as.texi index 1e122ccbbde..56b5b752b2f 100644 --- a/gas/doc/as.texi +++ b/gas/doc/as.texi @@ -4781,6 +4781,10 @@ write @samp{<4.3 !> 5.4!!>} to get the literal text = @samp{4.3 > 5.4!}. @item Expression results as strings You can write @samp{%@var{expr}} to evaluate the expression @var{expr} and use the result as a string. + +@item No passing arguments to macros based upon keyword assignment. +In altmacro mode arguments cannot be passed to macros by keyword assignmen= t. +See @xref{altmacro-keyword-arguments} for more details @end ftable =20 @node Ascii @@ -6217,7 +6221,36 @@ will get assigned all remaining arguments specified = at invocation time. =20 When you call a macro, you can specify the argument values either by position, or by keyword. For example, @samp{sum 9,17} is equivalent to -@samp{sum to=3D17, from=3D9}. +@samp{sum to=3D17, from=3D9}. You can also omit values when using keyword= s, +so for example @samp{sum to=3D6} is equivalent to @samp{sum 0, 6}. + +@anchor{altmacro-keyword-arguments} +Note however that when operating in altmacro mode arguments can only be +specified by position, not keyword. @xref{Altmacro,,@code{.altmacro}}. + +Thus for example: + +@example +.altmacro +.macro foo bar=3D1, baz=3D2 +.print "\bar \baz" +.endm + +foo baz=3D3 +@end example + +Will print: + +@smallexample +baz=3D3 2 +@end smallexample + +Rather than the expected: + +@smallexample +1 3 +@end smallexample + =20 @end table