Problem with assembly macro

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem with assembly macro

819件の閲覧回数
bahaa_sehsah_ex
Contributor I

I use IAR assembler V8.11.2.13589 w32 for arm and the target is Kinetis KEAZN64 (Cortex M0+). We face a problem when we use assembly macros:
1- When I pass a value to the macro.
2- When I pass register name to the macro.


So could you provide us with a working example to these cases?

ラベル(1)
0 件の賞賛
5 返答(返信)

697件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Bahaa Sehsah,

   About the IAR project macros, you totally can refer to the head file definition.

  Please open the IAR path: C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\arm\inc\NXP

You can find the SKEAZN642.h.

I post some macros code:

pastedImage_1.png

I also attach one head file for your reference.

   Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛

697件の閲覧回数
bahaa_sehsah_ex
Contributor I

Hi Kerry,

I need examples for assembly macros not C macros.

Thanks in advance.

0 件の賞賛

696件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Bahaa,

   Sorry, my mistake.

pastedImage_1.png

You can refer to asm_mac.h which can be find from this path:

C:\Program Files (x86)\IAR Systems\KinetisExample\TWR-K64F120M\mqx\source\psp\cortex_m\compiler\iar

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛

696件の閲覧回数
bahaa_sehsah_ex
Contributor I

Hi Kerry,

Thanks for your reply. By the way my issue was resolved, but now I face

another problem:

When my assembly file ".s" exceeds almost 1KB code size the IAR assembler

fires error "Error[400]: Expression out of range".

What should I do? also What is the cause of this error?

Thanks in advance.

0 件の賞賛

696件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Bahaa,

    Thank you for your updated information.

    What the detail chip you are using? I can't see your detail part number.

   Please check the flash address, do you exceed the flash size? Please also check the IAR project options, do you select the correct chip? Please also check your .ld file which has the flash size definition.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛