cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ Creator & Designer

WaMa_286156
Contributor II

I am trying to create a multi-line assembly #define.

The keil documentation says __asm { push ACC } is the format.  That is a lie.  If you do that, the result is:

 

 

                       2520              { push ACC; };
*** _____________________________________^
*** ERROR #A9 IN 2520 (Z:\drop-folder\Dropbox\4g\Cypress\Projects\Depth\DepthRTOS_PSOC3-Brd6V0\Source\tasks.src, LINE 25
                               20): SYNTAX ERROR

 

 

-----------

The correct format is

__asm push ACC  

  That produces the correct result.

In order to generate a #define that creates several lines of assembly code for 8051, you must use this format

__asm push ACC \n push IE \n CLR EA \n

The __asm caused the assembly to be generated.  *Important:* to get *each* of the lines of assembly out, you must follow each assembly instruction with a \n.  During my testing, I left the \n off of the CLR EA, and it did not get emitted. 

 

1 Solution
AlenAn14
Moderator
Moderator

Hi @WaMa_286156 ,

Thank you for sharing this useful information with the Infineon Community.

Please continue to use our products and contact us through the community regarding any queries you have on our products or information you would like to share.

View solution in original post

0 Likes
1 Reply
AlenAn14
Moderator
Moderator

Hi @WaMa_286156 ,

Thank you for sharing this useful information with the Infineon Community.

Please continue to use our products and contact us through the community regarding any queries you have on our products or information you would like to share.

View solution in original post

0 Likes