SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Politics : PRESIDENT GEORGE W. BUSH -- Ignore unavailable to you. Want to Upgrade?


To: FastC6 who wrote (143868)5/9/2001 12:16:50 AM
From: Scumbria  Respond to of 769670
 
Any bison experts out there?

I'm trying to convert this gas syntax :

.long _instrux+13000

into this nasm syntax :

.dd _instrux+13000

Using a2i, which is a bison sourced program.

The a2i.y file contains this parser lexicon:

| _LONG numlist { fprintf(outfile, "\tdd %s\n", $2); }
| _LONG ID { fprintf(outfile, "\tdd %s+0x%lx\n", $2, baseaddr); }
| _LONG ID '+' NUMBER { fprintf(outfile, "\tdd %s+%ld\n", $2, $4); }

which works fine for the translation I shown above, but converts this:

.long 0

into :

dd +0

(I don't want the plus sign before the 0)

I'm not a YACC/Bison expert, so any help is appreciated.

Thanks,
Scumbria