I'm no expert on this (in line assembly) but assembler in general is line based where as a C #define is all one line, so I would not expect the multiline assembler code work at all. The line continuation character '\' is removed by the pre-processor and the compiler only sees a single line, and all the compiler does is to pass everything between _asm and _endasm to the assembler.
Maybe this should be explained in the SDCC manual although it really should be obvious to anyone who is competent and courageous to enough to try to inject assembly code inline. At the end of the day the behavior depends on the assembler unless we want SDCC to understand the asm syntax. Spelling all that out in the SDCC manual would not hurt ... br Kusti On 8/30/11 01:51, "Mario" <marbar...@gmail.com> wrote: >Hello, its me ...once again. > >I have tried to do the following. > >#define SOMEASMHERE __asm\ > ASM INSTRUCTION\ > OTHER ONE\ > ETC\ > __endasm; > >where ³ASM INSTRUCTION², ³OTHER ONE², ³ETC², are ...assembler >instructions. >SDCC does not complain at all but I get error code 256. from gpasm. > >The strange part, is that it will work with a single asm instruction >inside, for example. > >#define SOMEASMHERE __asm\ > ASM INSTRUCTION\ > __endasm; > >Works as expected, but... if I do.- > >#define SOMEASMHERE __asm\ > ASM INSTRUCTION\ > OTHER ONE\ > __endasm; > >Only ³ASM INSTRUCTION² will be included and the second one wont, as if >I have never entered it. >If I try with three or more, the error code 256 from gpasm happens. > >However I have found a workaround for this bug: > >#define SOMEASMHERE __asm ASM INSTRUCTION __endasm;/ > __asm OTHER ONE __endasm;/ > __asm ETC __endasm; > >which works alright for this. >Greetings. > >-------------------------------------------------------------------------- >---- >Special Offer -- Download ArcSight Logger for FREE! >Finally, a world-class log management solution at an even better >price-free! And you'll get a free "Love Thy Logs" t-shirt when you >download Logger. Secure your free ArcSight Logger TODAY! >http://p.sf.net/sfu/arcsisghtdev2dev >_______________________________________________ >Sdcc-user mailing list >Sdcc-user@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/sdcc-user > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyh...@planmeca.com ------------------------------------------------------------------------------ Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution at an even better price-free! And you'll get a free "Love Thy Logs" t-shirt when you download Logger. Secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsisghtdev2dev _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user