Le 2014-02-13 01:04, Jacques Pelletier a écrit : > 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 ;When adding these 2 lines, macros were expanded. ;Doesn't work with sdasz80 but it works with the ASXXXX asz80 .list (md) .list (me) > > 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 Now expands to: > 0003 3E 30 [ 7] 1 ld a,#0x30
> 16 > 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 > > > ------------------------------------------------------------------------------ > 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 > ------------------------------------------------------------------------------ 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