gnupic: gpasm macro object code listing?


Previous by date: 22 Jan 2002 01:45:17 -0000 gpasm macro object code listing?, Anthony Tekatch
Next by date: 22 Jan 2002 01:45:17 -0000 SDCC in the bank, Scott Dattalo
Previous in thread: 22 Jan 2002 01:45:17 -0000 gpasm macro object code listing?, Anthony Tekatch
Next in thread:

Subject: Re: gpasm macro object code listing?
From: Craig Franklin ####@####.####
Date: 22 Jan 2002 01:45:17 -0000
Message-Id: <3C4CC483.A1915A31@attbi.com>

Anthony Tekatch wrote:
> 
> Does gpasm list the object code for macros?

Most of the time.  There are some conditions when gpasm never expands
the macros in the listing file.

> 
> I tried setting "LIST e=ON" as suggested in the gputils.pdf but got an "Error [124] : Illegal argument."
> 

The default is enabled, so you don't have to turn it on.

gpasm uses LIST x=[ON|OFF] as one method to control macro expansion. 
The documentation is incorrect.  I have fixed it in CVS.

> The address seems to incrememnt for the macro code but the object code is not printed in the .lst file.
> 

It is doing this because a while loop is nested inside a macro.  This is
one of the conditions in which gpasm will not fully expand the macro. 
The hex file should be correct, but not all of the data is being written
to the list file.

Submit a bug report to sourceforge if you would like to see it changed. 

> Also the macro name is listed after the expanded macro, is that correct?
> 

gpasm always assembles the code then writes the results to the list
file.  In the case of an expanded macro, assembling the code requires
writing the body of the macro to the list file.  Because the macro is
processed before the call is written to the list file, the call appears
after the body.

This is not the desired behavior, its just the way it worked out.  

Again, if you would like it changed please submit a bug report.  

> This is what gpasm prints from the example in AN544 (note the lack of code in the expanded macro section):
> ----------------------------------------------------------------------------
>                00083 multiply    MACRO
>                00084         variable  i ;
>                00085           variable i = 0
>                00086            while i < 8
>                00087                 btfsc   mulplr,i
>                00088                 addwf   H_byte, F
>                00089                 rrf     H_byte, F
>                00090                 rrf     L_byte, F
>                00091             variable i = i+1 ;
>                00092            endw
>                00093         ENDM                    ; End of macro
>                00094 ;
>                00095 ;
> 0008           00096 mpy8x8_F
> 0008 01A2      00097         clrf    H_byte
> 0009 01A3      00098         clrf    L_byte
> 000A 0820      00099         movf    mulcnd,W        ; move the multiplicand to W reg.
> 000B 1003      00100         bcf     STATUS,C        ; Clear the carry bit in the status Reg.
>                00101 ;
>                    M         variable  i ;
>                    M           variable i = 0
>                    M            while i < 8
>                    M                 btfsc   mulplr,i
>                    M                 addwf   H_byte, F
>                    M                 rrf     H_byte, F
>                    M                 rrf     L_byte, F
>                    M             variable i = i+1 ;
>                    M            endw
>                00102         multiply
> ----------------------------------------------------------------------------
> 
> --
> Anthony
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####

Previous by date: 22 Jan 2002 01:45:17 -0000 gpasm macro object code listing?, Anthony Tekatch
Next by date: 22 Jan 2002 01:45:17 -0000 SDCC in the bank, Scott Dattalo
Previous in thread: 22 Jan 2002 01:45:17 -0000 gpasm macro object code listing?, Anthony Tekatch
Next in thread:


Powered by ezmlm-browse 0.20.