gnupic: MACRO expanding with gpasm


Previous by date: 20 Nov 2001 00:13:32 -0000 Re: MACRO expanding with gpasm, Frederic
Next by date: 20 Nov 2001 00:13:32 -0000 Re: MACRO expanding with gpasm, Frederic
Previous in thread: 20 Nov 2001 00:13:32 -0000 Re: MACRO expanding with gpasm, Frederic
Next in thread: 20 Nov 2001 00:13:32 -0000 Re: MACRO expanding with gpasm, Frederic

Subject: Re: MACRO expanding with gpasm
From: Craig Franklin ####@####.####
Date: 20 Nov 2001 00:13:32 -0000
Message-Id: <3BF9AEC5.D32FFE37@home.com>

Frederic wrote:
> How do you 'store macro as text' ? What is the syntax for the BIT macro
> example ?
> 
> BIT     MACRO   label,bit,file  ;Define a bit label
> label                            EQU    file<<8|bit             ;(macro)
>         ENDM                    ;
> 

This is not under the user's control.  Gpasm's sourcecode will be
modified.  The input file syntax will not change.

> Can you explain how gpasm exactly work when it parses the source code ?
> What are the differents phases (lexer, etc...) ?
> 

Input files are scanned by the lexer.  Some people refer to the lexer as
a scanner.  The lexer, defined in scan.l, analyzes the file for
occurances of regular expressions.  For example, "0x12" is a NUMBER with
a value of 12 hex.  

The token NUMBER and value 12 hex is passed to the parser.  The parser
analyzes streams of tokens against the grammar description in parse.y. 
If it finds a match, the data is passed on to the opcode generator in
opcode.c.  The data is passed in the parsed structure defined on line
156 of gpasm.h.

The functions in opcode.c convert the parsed structure into opcodes and
store them in instruction memory.  gpasm then proceeds to the next line
from the input file. 

90% of the code for parsing is decribed by scan.l and parse.y.  These
input files are converted into C by flex and bison.  Documentation for
these tools is available at http://www.gnu.org.

> 
> Thank you for your help,
> 
> --
>     Frederic
> 
>     http://perso.wanadoo.fr/biloba

No problem.

I will try to get this fixed, give me some time.  I am currently knee
deep in object files, archives, and a linker for gpasm.  The water is
rising fast...

Previous by date: 20 Nov 2001 00:13:32 -0000 Re: MACRO expanding with gpasm, Frederic
Next by date: 20 Nov 2001 00:13:32 -0000 Re: MACRO expanding with gpasm, Frederic
Previous in thread: 20 Nov 2001 00:13:32 -0000 Re: MACRO expanding with gpasm, Frederic
Next in thread: 20 Nov 2001 00:13:32 -0000 Re: MACRO expanding with gpasm, Frederic


Powered by ezmlm-browse 0.20.