EmbeddedRelated.com
Forums

Problems annotating a symbols' size using gpasms .DEF

Started by Johann Klammer December 30, 2019
I had been trying to output some sort of address<->name mapping
for debugging. Using the Map file seemed promising initially. 
But when trying to dump memory locations, it became obvious 
that I needed the sizes, too. 
The pure MPASM syntax does not seem to allow annotating that information.
gpasm looked superior in that respect. Their .DEF extension specifically.

BUT it seems to be moving the labels around the memmap 
when it shouldn't.

This is what I tried:
-----uart.asm---------
        radix dec
include p16f1705.inc
include coff.inc

        GLOBAL l_buf
        GLOBAL l_offs

LINEAR0 UDATA
;l_buf  RES 256
        .DEF l_buf,global,type=(DT_ARY<<5)|T_CHAR,size=256

        UDATA
;       .DEF l_offs,global,type=T_CHAR,size=0
;       RES 1
l_offs  RES 1
        END

Then run:
gpasm -c -p p16f1705 ./uart.asm -o uart.o
gplink -m -s ./16f1705_g.lkr ./uart.o -o ./main.hex

look at main.map to see the l_buf is moved 256 bytes ahead 
(0x2100) into LINEAR0 which starts at 0x2000.
changing the size field changes that offset.

Am I using DEF wrong, or is there a Bug?
(It's supposed to be a char array. the <<5 was found experimentally 
and can be verified with 'gpvo -t ./uart.o')

The gpasm version I used is:
gpasm-1.5.2 #1316 (Oct 20 2018)


On 12/30/2019 09:51 AM, Johann Klammer wrote:
> > The gpasm version I used is: > gpasm-1.5.2 #1316 (Oct 20 2018) > >
It seems the GP_ARR auxiliary symbol is not implemented A text search for GP_ARR shows it's only in the libgputils/gpcoff.h header.