gnupic: gpasm macros/defines


Previous by date: 16 Oct 2006 20:44:39 +0100 [PIC] Xwisp2 documentation, Rob Hamerling
Next by date: 16 Oct 2006 20:44:39 +0100 Re: [gnupic] ethernet interface?, John De villiers
Previous in thread:
Next in thread:

Subject: gpasm macros/defines
From: "David Barnett" ####@####.####
Date: 16 Oct 2006 20:44:39 +0100
Message-Id: <004501c6f15b$6b4ffd00$0401a8c0@barnett2>

I've got some asm files that will assemble with MPASM but not with gpasm.  I think it's a result of stricter syntax rather than a bug, but I'll report it just in case.

There are two problems with my code.  The first and easiest to work around is that in MPASM an #ifdef will treat macro names as defined labels, whereas it looks like gpasm either treats them differently or processes macros after #ifdef directives.  I had been using this pattern a lot:
    MY_MAC macro
        endm
    ...
    #ifdef MY_MAC
        MY_MAC
    #endif
but it causes problems in gpasm.

My second problem is a bit more convoluted.  If you do a #define inside a macro, the macro parameters in the definition will not be expanded:
    START1 MACRO X
        #define OP1 movlw X
    ENDM
    ...
    START1 5
    OP1    ; gpasm reports "symbol not previously defined (X)."
My code had depended rather heavily on this specific ability, and I'm pretty sure EQU will not help me (although EQU gives no errors in the same situation).  If it's appropriate, I can explain why I needed that functionality and maybe someone can think of a workaround.

David

Previous by date: 16 Oct 2006 20:44:39 +0100 [PIC] Xwisp2 documentation, Rob Hamerling
Next by date: 16 Oct 2006 20:44:39 +0100 Re: [gnupic] ethernet interface?, John De villiers
Previous in thread:
Next in thread:


Powered by ezmlm-browse 0.20.