码迷,mamicode.com
首页 > 其他好文 > 详细

6455工程中的asm文件

时间:2014-10-10 20:27:14      阅读:347      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   使用   ar   strong   文件   

已有的.pjt工程文件,往往有一个.asm文件,.asm文件包含了设置跳转到该程序的c入口点的reset中断(C_int00)所需的汇编指令,还会定义附加的中断向量。

每个DSP处理器都有一个中断源列表,有的是固定的有的是可通过编程修改的。向量表(vector table)又叫做中断服务表(interrupt service table),往往在cmd文件中分配了其存储区。DSP复位,程序加载后,寄存器初始化为默认值,程序计数器(PC)设置为复位向量,同时cpu开始从地址0运行代码,这个位置往往就是复位向量。

每个中断向量的长度是固定的,为8个字。中断向量表以0x400B为边界,因为一共有32个向量,每个向量32B,这样就是0x400B。当移动中断服务表时,中断服务表指针(ISTP)也要相应改变,复位后ISTP保持为0。

?

?

DSP用到的的汇编伪指令查看assembly language tools v7.6 UG.pdf

用到的汇编指令查看tms320c64x64x+ DSP CPU and instruction set refrence guide.pdf

从pdf里搜索的时候这么搜bubuko.com,布布扣"syntax "

?

?

.def指令在当前模块中定义

.ref指令在当前模块使用在别的模块中定义的符号

.global指令可以是上面任何一种情况

?

?

汇编指令查看tms320c64x64x+ DSP CPU and instruction set refrence guide.pdf

?

.sect

bubuko.com,布布扣

Example:

bubuko.com,布布扣

?

Mvk

bubuko.com,布布扣

bubuko.com,布布扣

bubuko.com,布布扣

?

Zero

bubuko.com,布布扣

LDB:load byte from memory with a 15-bit unsigned constant offset

bubuko.com,布布扣

ADD

bubuko.com,布布扣

B

bubuko.com,布布扣

Cmplt

bubuko.com,布布扣

?

Stb

bubuko.com,布布扣

?

?

?

?

?

?

?

?

?

?

?

bootDSK6455.asm文件内容

.ref _c_int00????????????C入口点

.global RESET_RST????????

?

FLASH_START ????.equ 0xB0000400 ;flash start address????????//In EMIFA boot mode, the bootloader simply branches to the base address of EMIFA CE3 (0xB000 0000).Interrupts are disabled.这个地址 EMIFA_CE3: o = 0xB0000000 l = 0x00800000

CODE_START ????.equ 0x00800400 ;start of non boot code

CODE_SIZE ????.equ 0x0000F000 ;application code size in byte

?

????.sect "vectors"????????????????????????????????//中断服务表

RESET_RST:

?

NOP ; mvkl .S2 _c_int00, B0

NOP ; mvkh .S2 _c_int00, B0

NOP ; B .S2 B0

????NOP

????NOP

????NOP

????NOP

NOP

?

NMI_RST:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

RESV1:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

RESV2:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

INT4:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

INT5:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

INT6:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

INT7:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

INT8:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

INT9:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

INT10:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

INT11:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

INT12:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

INT13:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

INT14:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

INT15:

NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

????NOP

?

????.sect "bootload"

????

_boot_start:

mvkl FLASH_START,B4 ;flash start address ->B4

mvkh FLASH_START,B4

????

????mvkl CODE_START,A4 ;apps code start address ->A4

????mvkh CODE_START,A4

????zero A1

????

_boot_loop1:

????ldb *B4++,B5 ; flash read

????mvkl CODE_SIZE-4,B6 ; B6 = BOOT_SIZE -1024

????

????add 1,A1,A1 ;A1+=1,inc outer counter

????|| mvkh CODE_SIZE-4,B6????????//Parallel bars (||) indicate instructions that are in parallel with a previous instruction. You can have up to eight instructions that will be executed in parallel. The following example demonstrates six instructions to be executed in parallel:

????

????cmplt A1,B6,B0

????nop

????stb B5,*A4++

????[B0] b _boot_loop1

????nop 5

????

????mvkl .S2 _c_int00, B0

????mvkh .S2 _c_int00, B0

????B .S2 B0

????nop 5????

?

6455工程中的asm文件

标签:style   blog   http   color   io   使用   ar   strong   文件   

原文地址:http://www.cnblogs.com/pejoicen/p/4016475.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!