From 436f70092652d4967f280a321e0ca3ac29061ade Mon Sep 17 00:00:00 2001 From: pjs Date: Tue, 22 Jan 2002 02:23:40 +0000 Subject: [PATCH] xa_asm: fixed parsing of symbols used with DS directive in BSEG (pass 2&3). git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1833 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- as/xa51/xa_asm.l | 2 +- as/xa51/xa_asm.y | 7 +++++-- as/xa51/xa_dasm.c | 2 +- as/xa51/xa_main.c | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/as/xa51/xa_asm.l b/as/xa51/xa_asm.l index fa188b3f..61fdaf63 100644 --- a/as/xa51/xa_asm.l +++ b/as/xa51/xa_asm.l @@ -5,7 +5,7 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2. * - * Foobar is distributed in the hope that it will be useful, + * Paul's XA51 Assembler is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/as/xa51/xa_asm.y b/as/xa51/xa_asm.y index 339b7509..4567d7e3 100644 --- a/as/xa51/xa_asm.y +++ b/as/xa51/xa_asm.y @@ -5,7 +5,7 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2. * - * Foobar is distributed in the hope that it will be useful, + * Paul's XA51 Assembler is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -182,7 +182,7 @@ directive: '.' ORG expr { db_directive: DB {db_count = 0;} -linesymbol: WORD { +linesymbol: normal_or_bit_symbol { strcpy(symbol_name, lex_sym_name); if (!strchr(lex_sym_name, ':')) { /* non-local label, remember base name */ @@ -191,6 +191,9 @@ linesymbol: WORD { if (is_target(symbol_name)) pad_with_nop(); } +normal_or_bit_symbol: WORD {$$ = $1;} + | BIT {$$ = $1;} + bytes: byte_element | bytes ',' byte_element diff --git a/as/xa51/xa_dasm.c b/as/xa51/xa_dasm.c index de055f02..b7d598bc 100644 --- a/as/xa51/xa_dasm.c +++ b/as/xa51/xa_dasm.c @@ -4,7 +4,7 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2. * - * Foobar is distributed in the hope that it will be useful, + * Paul's XA51 Assembler is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/as/xa51/xa_main.c b/as/xa51/xa_main.c index f632f562..b01f8294 100644 --- a/as/xa51/xa_main.c +++ b/as/xa51/xa_main.c @@ -17,12 +17,13 @@ /* adapted from the osu8asm project, 1995 */ /* http://www.pjrc.com/tech/osu8/index.html */ -#define printf(x...) fprintf(stderr,x) #include #include #include +#define printf(x...) fprintf(stderr,x) + #include "xa_main.h" extern void yyrestart(FILE *new_file); -- 2.30.2