public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@sourceware.org>
To: binutils-cvs@sourceware.org
Subject: [binutils-gdb] Update description of macro keyword argument assignment in assembler documentation.
Date: Fri, 12 Apr 2024 15:52:38 +0000 (GMT)	[thread overview]
Message-ID: <20240412155238.7A3E03858D38@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=99daf56f4b4bf831bb29bffb79f2172f1b316cb9

commit 99daf56f4b4bf831bb29bffb79f2172f1b316cb9
Author: Nick Clifton <nickc@redhat.com>
Date:   Fri Apr 12 16:51:51 2024 +0100

    Update description of macro keyword argument assignment in assembler documentation.
    
      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 assignment.
+See @xref{altmacro-keyword-arguments} for more details
 @end ftable
 
 @node Ascii
@@ -6217,7 +6221,36 @@ will get assigned all remaining arguments specified at invocation time.
 
 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=17, from=9}.
+@samp{sum to=17, from=9}.  You can also omit values when using keywords,
+so for example @samp{sum to=6} 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=1, baz=2
+.print "\bar \baz"
+.endm
+
+foo baz=3
+@end example
+
+Will print:
+
+@smallexample
+baz=3 2
+@end smallexample
+
+Rather than the expected:
+
+@smallexample
+1 3
+@end smallexample
+
 
 @end table

                 reply	other threads:[~2024-04-12 15:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240412155238.7A3E03858D38@sourceware.org \
    --to=nickc@sourceware.org \
    --cc=binutils-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).