gnupic: Re: gpasm directives vs. MPASM
Subject:
gpasm directives vs. MPASM
From:
"Andrew E. Mileski" ####@####.####
Date:
30 Nov 2015 20:22:42 -0000
Message-Id: <565CB002.9030107@isoar.ca>
First, thanks to all those involved for the marvelous gputils suite!
I admit to being a PIC rookie, but it seems that gpasm is parsing the IDLOCS
symbol as a directive, even when the --mpasm-compatible option is used, despite
IDLOCS not being a MPASM directive (as far as I can tell).
Is this a potential bug / "feature"? Or is there a command-line option or
something else that I'm overlooking which avoids this behaviour?
I don't rule out that I could be doing something really stupid.
IDLOCS appears to be a standard section name; grep the linker files. An example
of the following can be found in the current MPASM manual (DS33014L), page 28.
I've just condensed the code, and set the processor type for this example.
LIST p=16f1829
IDLOCS CODE
dw H'048C'
dw H'159D'
dw H'26AE'
dw H'37BF'
END
$ ./gpasm --mpasm-compatible -c bug.asm
bug.asm:4:Warning[205] Found directive in column 1: "IDLOCS"
bug.asm:4:Error[181] Directive Error: The IDLOCS directive is invalid in MPASM
mode.
I would expect IDLOCS to be treated like any other section label when
--mpasm-compatible is specified.
I was considering patching the ^{IDENT}:? pattern in scan.l to return LABEL
instead of IDENTIFIER for gpasm-specific directives in the ID_DIRECTIVES case
when --mpasm-compatible is specified... unless there is a better route?
~~
Andrew E. Mileski