[cc65] Macros in ca65

From: Björn Spruck <bjoern1spruck.net>
Date: 2011-12-06 13:33:57
Hi,

I have a question on inline assembler macro processing. Looking for a
solution or if not, a request for additional features in the assembler :-)

I have code which I want to port from another assembler to inline within
a cc65 project. This code uses a lot of macros. One thing which is used
quiet often is:

    _IFNE   
            do something
    _ELSE
            so something else
    _ENDIF

where _IF _ELSE _ENDIF are macros. What the macros are doing is,
creating (local) labels and produce the branches.

    beq .ELSE001
        do something
    bra .ENDIF001
.ELSE001
            so something else   
.ELSE001  ;; this is only needed if you have an ENDIF without ELSE
.ENDIF001

now my question: any idea how this can be done in the simplest way in ca65?

remark: doing this with scopes or procs will not work if there is any
other label between IF and ENDIF which should be accessible from
outside, right?

I can give some details on how the macros are done inside the other
assembler, and how I did translate it in the very old ra65 (by patching the assembler).

Björn



----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Dec 6 14:15:38 2011

This archive was generated by hypermail 2.1.8 : 2011-12-06 14:15:43 CET