搜索
bottom↓
回复: 7

PIC汇编代码中的 udata_shr udata res是什么意思

[复制链接]

出0入0汤圆

发表于 2015-10-19 12:38:30 | 显示全部楼层 |阅读模式
本帖最后由 hubinghuandi 于 2015-10-19 13:44 编辑

如题,下面的汇编代码看不太懂,请高手转换成C语言的,
这个是pic关于单项无刷风扇的,这个程序是PIC官网文档AN1178的附带例子程序中的一段,我想知道SHARED udata_shr ,BANK0         udata,res在这里的意思是什么
;; Flag variable definations
#define tmr0int                        0                                        ; bit to show we've received a timer0 interrupt
#define locked                   1                                         ; for a locked rotor condition
#define hallmeasure         2                                         ; use for starting/stopping a measurement

;; General Purpose Registers
SHARED udata_shr
w_save                res 1                                                        ; context saving
status_save        res 1

BANK0         udata
flag                res 1                                                        ; generic flag variable

delay1                res 1
delay2                res 1
delay3                res 1                               

counthigh        res 1                                                        ; used for TMR2 ISR for counting for tach measurement
countlow        res 1

tachlow                res 1                                                        ; used to store the tach measurement
tachhigh        res 1                                                               

speedin                res        1                                                        ; duty cycle of the incoming speed PWM
compstate        res 1                                                        ; state variable to store comparator measurement routine
speedstate        res 1                                                        ; use for the speed state machine
tachspeed        res 1                                                        ; store the result of the divide routine here
temp                res 1                                                        ; outside of ISR temp variable
lockedcount        res 1                                                        ; store the number of times the rotor has tried to be freed
把全部完整的文件一起上传








本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入0汤圆

发表于 2015-10-19 12:46:08 | 显示全部楼层
本帖最后由 banye2010 于 2015-10-19 12:48 编辑

就是定义了一堆变量吧,有什么好看的

出0入0汤圆

 楼主| 发表于 2015-10-19 12:51:10 | 显示全部楼层
本帖最后由 hubinghuandi 于 2015-10-19 12:52 编辑
banye2010 发表于 2015-10-19 12:46
就是定义了一堆变量吧,有什么好看的


SHARED udata_shr
res
udata
我知道是在定义变量,但是这几个不知道什么意思,高手能否给菜鸟普及一下。

出0入4汤圆

发表于 2015-10-19 12:59:01 | 显示全部楼层
是哪家的单片机,找对应的汇编手册看看,PDF搜索对应关键字理解理解就OK啦

出50入10汤圆

发表于 2015-10-19 13:25:37 | 显示全部楼层
hubinghuandi 发表于 2015-10-19 12:51
SHARED udata_shr
res
udata

SHARED udata_shr
udata
这两个是指定区域吧?类似RAM 区和ROM区.
res  这个是指占用区域的字节数吧!

猜的!!!!

出0入0汤圆

 楼主| 发表于 2015-10-19 13:26:11 | 显示全部楼层
本帖最后由 hubinghuandi 于 2015-10-19 13:35 编辑
D.lovers 发表于 2015-10-19 12:59
是哪家的单片机,找对应的汇编手册看看,PDF搜索对应关键字理解理解就OK啦 ...


这个是pic关于单项无刷风扇的,这个程序是PIC官网文档AN1178的附带例子程序中的一段。没有搜索到相关的信息,既不是关键字也不确认是伪指令。完整的文件已经上传到楼主位,请高手帮忙看下

出0入0汤圆

 楼主| 发表于 2015-10-19 13:38:19 | 显示全部楼层
our2008 发表于 2015-10-19 13:25
SHARED udata_shr
udata
这两个是指定区域吧?类似RAM 区和ROM区.

你说的比较靠谱

出0入0汤圆

发表于 2015-10-19 14:34:51 | 显示全部楼层
SHARED udata_shr 指定位置 0x70~0x7F
BANK0         udata 指定在BANK0 的範圍內
res 字节数
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-4-29 07:50

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表