我们从2011年坚守至今,只想做存粹的技术论坛。  由于网站在外面,点击附件后要很长世间才弹出下载,请耐心等待,勿重复点击不要用Edge和IE浏览器下载,否则提示不安全下载不了

 找回密码
 立即注册
搜索
查看: 531|回复: 0

李现路:在DSP6000中怎样编写您的第一个程序(二)   P

[复制链接]

该用户从未签到

1万

主题

1292

回帖

936

积分

管理员

积分
936

社区居民最爱沙发原创达人社区明星终身成就奖优秀斑竹奖宣传大使奖特殊贡献奖

QQ
发表于 2013-3-29 10:59:49 | 显示全部楼层 |阅读模式
李现路:在DSP6000中怎样编写您的第一个程序(二) Post By:2009-11-23 23:46:16


三、完整的中断向量表程序如下:


.global _vectors ;定义一个能被外部(C语言程序)引用的变量
.global _c_int00
.global _vector1
.global _vector2
.global _vector3
.global _vector1
.global _vector5
.global _vector6
.global _vector7
.global _vector8
.global _vector9   
.global _vector10
.global _vector11 ; Hookup the c_int08 ISR(连接这个中断设置寄存器) in main()
.global _vector12  ; Hookup the c_int08 ISR in main()
.global _vector13
.global _vector14
.global _vector15

完整版本请见http://www.51qianru.cn/bbs/
*------------------------------------------------------------------------------
* Global symbols referenced in this file but defined somewhere else.
* Remember that your interrupt service routines need to be referenced here.
*------------------------------------------------------------------------------
.ref _c_int00 ;reset ISR(复位中断设置寄存), .ref表明一个或多个在另一个模块中定义而在前模块中要用到的符号

*------------------------------------------------------------------------------
* This is a macro that instantiates one entry in the interrupt service table.
*------------------------------------------------------------------------------
VEC_ENTRY .macro addr ;中断返回函数
  STW B0,*--B15
  MVKLaddr,B0
  MVKHaddr,B0
  B B0
  LDW *B15++,B0
  NOP 2
  NOP
  NOP
.endm


*------------------------------------------------------------------------------
* This is a dummy interrupt service routine used to initialize the IST.
*------------------------------------------------------------------------------
_vec_dummy:;初始化IST寄存器(中断向量表起始地址寄存器,用于设置中断服务程序存放的地址)
B  B3
NOP5

*------------------------------------------------------------------------------
* This is the actual interrupt service table (IST). It is properly aligned and
* is located in the subsection .text:vecs. This means if you don't explicitly
* specify this section in your linker command file, it will default and link
* into the .text section. Remember to set the ISTP(中断向量表起始地址寄存器) register to point to this
* table.
*------------------------------------------------------------------------------
.sect ".vecs";定义初始化带名称的段
.align 1024;分配程序页

_vectors:
_vector0: VEC_ENTRY _c_int00  ;RESET(应用程序的入口)
_vector1: VEC_ENTRY _vec_dummy;NMI(非屏蔽中断,用于处理极为关键的任务)
_vector2: VEC_ENTRY _vec_dummy;RSVD
_vector3: VEC_ENTRY _vec_dummy
_vector4: VEC_ENTRY _vec_dummy
_vector5: VEC_ENTRY _vec_dummy
_vector6: VEC_ENTRY _vec_dummy
_vector7: VEC_ENTRY _vec_dummy
_vector8: VEC_ENTRY _vec_dummy
_vector9: VEC_ENTRY _vec_dummy
_vector10:VEC_ENTRY _vec_dummy
_vector11:VEC_ENTRY _vec_dummy ; Hookup the c_int08 ISR in main()
_vector12:VEC_ENTRY _vec_dummy  ; Hookup the c_int08 ISR in main()
_vector13:VEC_ENTRY _vec_dummy
_vector14:VEC_ENTRY _vec_dummy
_vector15:VEC_ENTRY _vec_dummy


完整版本请见http://www.51qianru.cn/bbs/

                  曙海教育
                曙海嵌入式学院3G通信培训中心
              (MTK培训,Android培训,iPhone培训)
                电话:021-51875830
                网址:http://www.51qianru.cn
                  讲师:李现路
             版权所有-曙海教育 转摘请注明作者和出处课程有:

Post By:2009-11-23 23:46:16


三、完整的中断向量表程序如下:


.global _vectors ;定义一个能被外部(C语言程序)引用的变量
.global _c_int00
.global _vector1
.global _vector2
.global _vector3
.global _vector1
.global _vector5
.global _vector6
.global _vector7
.global _vector8
.global _vector9   
.global _vector10
.global _vector11 ; Hookup the c_int08 ISR(连接这个中断设置寄存器) in main()
.global _vector12  ; Hookup the c_int08 ISR in main()
.global _vector13
.global _vector14
.global _vector15

完整版本请见http://www.51qianru.cn/bbs/
*------------------------------------------------------------------------------
* Global symbols referenced in this file but defined somewhere else.
* Remember that your interrupt service routines need to be referenced here.
*------------------------------------------------------------------------------
.ref _c_int00 ;reset ISR(复位中断设置寄存), .ref表明一个或多个在另一个模块中定义而在前模块中要用到的符号

*------------------------------------------------------------------------------
* This is a macro that instantiates one entry in the interrupt service table.
*------------------------------------------------------------------------------
VEC_ENTRY .macro addr ;中断返回函数
  STW B0,*--B15
  MVKLaddr,B0
  MVKHaddr,B0
  B B0
  LDW *B15++,B0
  NOP 2
  NOP
  NOP
.endm


*------------------------------------------------------------------------------
* This is a dummy interrupt service routine used to initialize the IST.
*------------------------------------------------------------------------------
_vec_dummy:;初始化IST寄存器(中断向量表起始地址寄存器,用于设置中断服务程序存放的地址)
B  B3
NOP5

*------------------------------------------------------------------------------
* This is the actual interrupt service table (IST). It is properly aligned and
* is located in the subsection .text:vecs. This means if you don't explicitly
* specify this section in your linker command file, it will default and link
* into the .text section. Remember to set the ISTP(中断向量表起始地址寄存器) register to point to this
* table.
*------------------------------------------------------------------------------
.sect ".vecs";定义初始化带名称的段
.align 1024;分配程序页

_vectors:
_vector0: VEC_ENTRY _c_int00  ;RESET(应用程序的入口)
_vector1: VEC_ENTRY _vec_dummy;NMI(非屏蔽中断,用于处理极为关键的任务)
_vector2: VEC_ENTRY _vec_dummy;RSVD
_vector3: VEC_ENTRY _vec_dummy
_vector4: VEC_ENTRY _vec_dummy
_vector5: VEC_ENTRY _vec_dummy
_vector6: VEC_ENTRY _vec_dummy
_vector7: VEC_ENTRY _vec_dummy
_vector8: VEC_ENTRY _vec_dummy
_vector9: VEC_ENTRY _vec_dummy
_vector10:VEC_ENTRY _vec_dummy
_vector11:VEC_ENTRY _vec_dummy ; Hookup the c_int08 ISR in main()
_vector12:VEC_ENTRY _vec_dummy  ; Hookup the c_int08 ISR in main()
_vector13:VEC_ENTRY _vec_dummy
_vector14:VEC_ENTRY _vec_dummy
_vector15:VEC_ENTRY _vec_dummy


完整版本请见http://www.51qianru.cn/bbs/

                  曙海教育
                曙海嵌入式学院3G通信培训中心
              (MTK培训,Android培训,iPhone培训)
                电话:021-51875830
                网址:http://www.51qianru.cn
                  讲师:李现路
             版权所有-曙海教育 转摘请注明作者和出处课程有:
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

论坛开启做任务可以
额外奖励金币快速赚
积分升级了


Copyright ©2011-2024 NTpcb.com All Right Reserved.  Powered by Discuz! (NTpcb)

本站信息均由会员发表,不代表NTpcb立场,如侵犯了您的权利请发帖投诉

平平安安
TOP
快速回复 返回顶部 返回列表