On Thu, 13 Feb 2014, Jacques Pelletier wrote:

> Hi,
>
> I'm trying to use the macros (.macro/.endm) in the SDCC assembler for
> the Z80. However, it doesn't seem to work, and neither the latest
> version of ASZ80 (5.06).
>
> For both, the macro is not expanded and give the same main.lst
>
> Here is the command I use:
>     asz80 -glos main.asm (or)
>     sdasz80 -glos main.asm
>
> My main.asm file:
>         .area main (ABS)
>
>         .macro mytest value
>         ld      a,#value
>         .endm
>
>         .org 0
>
> start:
>         call    dummyfunc
>
>         mytest 0x30
>
> dummyfunc:
>         ret
>
> test1:
>         nop
> test2:
>         nop
>
>
> The resulting main.lst file:
> ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi
> HD64180), page 1.
>
>
>
>                               1         .area main (ABS)
>                               2
>                               3         .macro mytest value
>                               4         ld      a,#value
>                               5         .endm
>                               6
>    0000                       7         .org 0
>                               8
>    0000                       9 start:
>    0000 CD 03 00      [17]   10         call    dummyfunc
>                              11
>    0003                      12         mytest 0x30
>                               1
>                               2
>                              13
>    0003                      14 dummyfunc:
>    0003 C9            [10]   15         ret
>                              16
>    0004                      17 test1:
>    0004 00            [ 4]   18         nop
>    0005                      19 test2:
>    0005 00            [ 4]   20         nop
>                              21
>                              22
>                              23
>
>
> Any ideas?
>
> Jacques Pelletier

This sounds exactly like bug 2166 "Macro expansion in sdas not working"

   http://sourceforge.net/p/sdcc/bugs/2166/

Go to the SDCC snapshot page

   http://sdcc.sourceforge.net/snap.php

and update to any snapshot that has a date after Jan 4 of this year and 
that will probably take care of it, at least for sdasz80.

   Erik

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to