From 26aca5f60e2dde898fb5e6d71859778f0b786f09 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 6 May 2005 06:38:11 +0000 Subject: gas/ 2005-05-06 Jan Beulich * cond.c (s_ifb): New. * read.c (potable): Add s_ifb as handler for .ifb and .ifnb. * read.h (s_ifb): Prototype. * doc/as.texinfo: Document .ifb and .ifnb. gas/testsuite/ 2005-05-06 Jan Beulich * gas/all/cond.s: Also test .ifb/.ifnb. * gas/all/cond.d: Adjust. --- gas/cond.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'gas/cond.c') diff --git a/gas/cond.c b/gas/cond.c index 8bea97e..8cd98c2 100644 --- a/gas/cond.c +++ b/gas/cond.c @@ -181,6 +181,40 @@ s_if (int arg) demand_empty_rest_of_line (); } +/* Performs the .ifb (test_blank == 1) and + the .ifnb (test_blank == 0) pseudo op. */ + +void +s_ifb (int test_blank) +{ + struct conditional_frame cframe; + + initialize_cframe (&cframe); + + if (cframe.dead_tree) + cframe.ignoring = 1; + else + { + int is_eol; + + SKIP_WHITESPACE (); + is_eol = is_end_of_line[(unsigned char) *input_line_pointer]; + cframe.ignoring = (test_blank == !is_eol); + } + + current_cframe = ((struct conditional_frame *) + obstack_copy (&cond_obstack, &cframe, + sizeof (cframe))); + + if (LISTING_SKIP_COND () + && cframe.ignoring + && (cframe.previous_cframe == NULL + || ! cframe.previous_cframe->ignoring)) + listing_list (2); + + ignore_rest_of_line (); +} + /* Get a string for the MRI IFC or IFNC pseudo-ops. */ static char * -- cgit v1.1