Is there a better way to define an array in VSPA3 assembly code?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Is there a better way to define an array in VSPA3 assembly code?

跳至解决方案
5,684 次查看
xuedongyang
Contributor II

Hi, NXP experts,

I need to define a local array of size 64 in assembly code and initialize it to zero. Each element is 32-bit word. I tried to define it in the following way (see attached screen shot). It works.

But my question is: is there a better way to define the array (something like, csirs_after_cc[64]) in one line, rather than define it with 64 lines? 

BTW, do you have any document to explain the assembly syntax, like .global, .data, .text, etc. I have LA1224 instruction set manual, but it does not include assembly syntax information.

xuedongyang_0-1643994772310.png

Thanks,

Xuedong Yang

 

0 项奖励
回复
1 解答
5,627 次查看
yipingwang
NXP TechSupport
NXP TechSupport

The VSPA ISM pretty much covers the VSPA assembly instructions or opcodes. I found some definition of .text and .data in the CodeWarrior Development Studio for VSPA3 Architecture Application Binary Interface (ABI) Reference Manual. This document is provided as a part of CW for VSPA installation. So if customer has access to CW for VSPA, they can go to the installation folder like C:\Freescale\CW_VSPA_v10.3.2\VSPA\Help\PDF and find the document at this location on the machine where CW for VSPA is installed.

 

For your reference, I have also attached the document here. Please let me know if this is what you are looking for?

在原帖中查看解决方案

0 项奖励
回复
4 回复数
5,636 次查看
xuedongyang
Contributor II

Thank you for your reply.

By the way, do you have any document to explain the assembly syntax, like .global, .data, .text, etc. I have LA1224 instruction set manual, but it does not include assembly syntax information. I tried to search in NXP doc web site, but could not find any useful info about assembly syntax. If you have something, like assembly user's manual, would you please share it with me?

0 项奖励
回复
5,628 次查看
yipingwang
NXP TechSupport
NXP TechSupport

The VSPA ISM pretty much covers the VSPA assembly instructions or opcodes. I found some definition of .text and .data in the CodeWarrior Development Studio for VSPA3 Architecture Application Binary Interface (ABI) Reference Manual. This document is provided as a part of CW for VSPA installation. So if customer has access to CW for VSPA, they can go to the installation folder like C:\Freescale\CW_VSPA_v10.3.2\VSPA\Help\PDF and find the document at this location on the machine where CW for VSPA is installed.

 

For your reference, I have also attached the document here. Please let me know if this is what you are looking for?

0 项奖励
回复
5,623 次查看
xuedongyang
Contributor II

Thank you very much for your guidance!

0 项奖励
回复
5,641 次查看
yipingwang
NXP TechSupport
NXP TechSupport

I consulted with VSPA assembly code expert and heres the response from SME:

 

There is no concept of an array allocation in assembly. Memory management is done by the user. If you use the C compiler to generate VSPA assembly, then the compiler/linker takes care of memory management. You can use regular assembly functions and call them from C, and can just do memory management and function calling etc from C. Assembly code only understands pointers, it doesn't understand sizes of arrays and boundaries thereof. For initializing an array in assembly, what customer did is also correct.

 

Hope this helps.

0 项奖励
回复