diff options
author | Timothy Wall <twall@alum.mit.edu> | 2000-02-08 19:06:00 +0000 |
---|---|---|
committer | Timothy Wall <twall@alum.mit.edu> | 2000-02-08 19:06:00 +0000 |
commit | 6dc19fc4d614ca0d241cace28ea999dcf9f2888f (patch) | |
tree | a8ce8600918b175eceb1584592c4bc1fd33132e1 /gas/read.c | |
parent | f15632584b5f2c0355fcc0f354da079b240aedf2 (diff) | |
download | gdb-6dc19fc4d614ca0d241cace28ea999dcf9f2888f.zip gdb-6dc19fc4d614ca0d241cace28ea999dcf9f2888f.tar.gz gdb-6dc19fc4d614ca0d241cace28ea999dcf9f2888f.tar.bz2 |
Remove redundant code for checking numbers with suffixes. Add
functionality to break out of assembler loops.
Diffstat (limited to 'gas/read.c')
-rw-r--r-- | gas/read.c | 38 |
1 files changed, 34 insertions, 4 deletions
@@ -2644,15 +2644,28 @@ s_rept (ignore) int ignore ATTRIBUTE_UNUSED; { int count; - sb one; - sb many; count = get_absolute_expression (); + do_repeat(count, "REPT", "ENDR"); +} + +/* This function provides a generic repeat block implementation. It allows + different directives to be used as the start/end keys. */ + +void +do_repeat (count, start, end) + int count; + const char *start; + const char *end; +{ + sb one; + sb many; + sb_new (&one); - if (! buffer_and_nest ("REPT", "ENDR", &one, get_line_sb)) + if (! buffer_and_nest (start, end, &one, get_line_sb)) { - as_bad (_("rept without endr")); + as_bad (_("%s without %s"), start, end); return; } @@ -2667,6 +2680,23 @@ s_rept (ignore) buffer_limit = input_scrub_next_buffer (&input_line_pointer); } +/* Skip to end of current repeat loop; EXTRA indicates how many additional + input buffers to skip. Assumes that conditionals preceding the loop end + are properly nested. + + This function makes it easier to implement a premature "break" out of the + loop. The EXTRA arg accounts for other buffers we might have inserted, + such as line substitutions. */ + +void +end_repeat (extra) + int extra; +{ + cond_exit_macro (macro_nest); + while (extra-- >= 0) + buffer_limit = input_scrub_next_buffer (&input_line_pointer); +} + /* Handle the .equ, .equiv and .set directives. If EQUIV is 1, then this is .equiv, and it is an error if the symbol is already defined. */ |