From 4080c2706506c4b8a18f8f74ff962c5f033b31a2 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 9 Feb 1996 01:04:21 +0000 Subject: [PATCH] * read.c (potable): Pass negative numbers for new .balign[wl] and .p2align[wl] pseudo-ops. (s_align_bytes): Treat a negative argument as specifying the fill length. (s_align_ptwo): Likewise. --- gas/ChangeLog | 8 ++++++++ gas/read.c | 53 +++++++++++++++++++++++++++++++-------------------- 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index df6f3ec4ce9..c467aaf7def 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +Thu Feb 8 20:02:58 1996 Ian Lance Taylor + + * read.c (potable): Pass negative numbers for new .balign[wl] and + .p2align[wl] pseudo-ops. + (s_align_bytes): Treat a negative argument as specifying the fill + length. + (s_align_ptwo): Likewise. + Wed Feb 7 14:12:03 1996 Ian Lance Taylor * read.c (potable): Add balignw, balignl, p2alignw, and p2alignl. diff --git a/gas/read.c b/gas/read.c index eacc8e60bf4..ba392c02e34 100644 --- a/gas/read.c +++ b/gas/read.c @@ -246,8 +246,8 @@ static const pseudo_typeS potable[] = {"ascii", stringer, 0}, {"asciz", stringer, 1}, {"balign", s_align_bytes, 0}, - {"balignw", s_align_bytes, 2}, - {"balignl", s_align_bytes, 4}, + {"balignw", s_align_bytes, -2}, + {"balignl", s_align_bytes, -4}, /* block */ {"byte", cons, 1}, {"comm", s_comm, 0}, @@ -341,8 +341,8 @@ static const pseudo_typeS potable[] = {"offset", s_struct, 0}, {"org", s_org, 0}, {"p2align", s_align_ptwo, 0}, - {"p2alignw", s_align_ptwo, 2}, - {"p2alignl", s_align_ptwo, 4}, + {"p2alignw", s_align_ptwo, -2}, + {"p2alignl", s_align_ptwo, -4}, {"page", listing_eject, 0}, {"plen", listing_psize, 0}, {"print", s_print, 0}, @@ -1100,7 +1100,12 @@ s_align_bytes (arg) stop = mri_comment_field (&stopc); if (is_end_of_line[(unsigned char) *input_line_pointer]) - temp = arg; /* Default value from pseudo-op table */ + { + if (arg < 0) + temp = 0; + else + temp = arg; /* Default value from pseudo-op table */ + } else temp = get_absolute_expression (); @@ -1123,29 +1128,32 @@ s_align_bytes (arg) if (*input_line_pointer == ',') { offsetT fillval; + int len; input_line_pointer++; fillval = get_absolute_expression (); - if (arg == 0) - arg = 1; - if (arg <= 1) + if (arg >= 0) + len = 1; + else + len = - arg; + if (len <= 1) { temp_fill = fillval; - do_align (temp, &temp_fill, arg); + do_align (temp, &temp_fill, len); } else { char ab[16]; - if (arg > sizeof ab) + if (len > sizeof ab) abort (); - md_number_to_chars (ab, fillval, arg); - do_align (temp, ab, arg); + md_number_to_chars (ab, fillval, len); + do_align (temp, ab, len); } } else { - if (arg > 0) + if (arg < 0) as_warn ("expected fill pattern missing"); do_align (temp, (char *) NULL, 0); } @@ -1181,29 +1189,32 @@ s_align_ptwo (arg) if (*input_line_pointer == ',') { offsetT fillval; + int len; input_line_pointer++; fillval = get_absolute_expression (); - if (arg == 0) - arg = 1; - if (arg <= 1) + if (arg >= 0) + len = 1; + else + len = - arg; + if (len <= 1) { temp_fill = fillval; - do_align (temp, &temp_fill, arg); + do_align (temp, &temp_fill, len); } else { char ab[16]; - if (arg > sizeof ab) + if (len > sizeof ab) abort (); - md_number_to_chars (ab, fillval, arg); - do_align (temp, ab, arg); + md_number_to_chars (ab, fillval, len); + do_align (temp, ab, len); } } else { - if (arg > 0) + if (arg < 0) as_warn ("expected fill pattern missing"); do_align (temp, (char *) NULL, 0); } -- 2.30.2