51单片机汇编语言如何通过查表的方法找出下面表中任意一位数 20

TABLE:DB00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H;"",0DB00H,00H... TABLE:
DB 00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H;" ",0
DB 00H ,00H ,00H ,0F8H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,33H ,00H ,00H ,00H ,00H;" ! ",1
DB 00H ,10H ,0CH ,02H ,10H ,0CH ,02H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H;" " ",2
DB 00H ,40H ,0C0H ,78H ,40H ,0C0H ,78H ,00H ,00H ,04H ,3FH ,04H ,04H ,3FH ,04H ,00H;" # ",3
DB 00H ,70H ,88H ,88H ,0FCH ,08H ,30H ,00H ,00H ,18H ,20H ,20H ,0FFH ,21H ,1EH ,00H;" $ ",4
DB 0F0H ,08H ,0F0H ,80H ,60H ,18H ,00H ,00H ,00H ,31H ,0CH ,03H ,1EH ,21H ,1EH ,00H;" % ",5
DB 00H ,0F0H ,08H ,88H ,70H ,00H ,00H ,00H ,1EH ,21H ,23H ,2CH ,19H ,27H ,21H ,10H;" & ",6
DB 00H ,12H ,0EH ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H;" ' ",7
DB 00H ,00H ,00H ,0E0H ,18H ,04H ,02H ,00H ,00H ,00H ,00H ,07H ,18H ,20H ,40H ,00H;" ( ",8
DB 00H ,02H ,04H ,18H ,0E0H ,00H ,00H ,00H ,00H ,40H ,20H ,18H ,07H ,00H ,00H ,00H;" ) ",9
DB 40H ,40H ,80H ,0F0H ,80H ,40H ,40H ,00H ,02H ,02H ,01H ,0FH ,01H ,02H ,02H ,00H;" * ",10
DB 00H ,00H ,00H ,00H ,0E0H ,00H ,00H ,00H ,00H ,01H ,01H ,01H ,0FH ,01H ,01H ,01H;" + ",11
DB 00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,90H ,70H ,00H ,00H ,00H ,00H ,00H;" , ",12
DB 00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,01H ,01H ,01H ,01H ,01H ,01H ,00H;" - ",13
DB 00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,00H ,30H ,30H ,00H ,00H ,00H ,00H ,00H;" . ",14
DB 00H ,00H ,00H ,00H ,0C0H ,38H ,04H ,00H ,00H ,60H ,18H ,07H ,00H ,00H ,00H ,00H;" / ",15
DB 00H ,0E0H ,10H ,08H ,08H ,10H ,0E0H ,00H ,00H ,0FH ,10H ,20H ,20H ,10H ,0FH ,00H;" 0 ",16
展开
 我来答
cqs8031
推荐于2017-12-16 · TA获得超过1.8万个赞
知道大有可为答主
回答量:1.9万
采纳率:31%
帮助的人:5581万
展开全部
找哪一个数?假设找38H
MOV DPTR , #TABLE
LOOP:
MOV A,#0
MOVC A,@A+DPTR ;查表
CJNE A,#38H,LOOP ;不是需要的,返回,继续
SJMP $ ;是它,踏步
追问
如果我要找第270个0FH呢,270已经超出A的范围
追答
是呀,还是可以编程的,上面的程序有误,应该加一条
LOOP:
MOV A,#0
MOVC A,@A+DPTR ;查表
INC DPL ;加一条,指向下一个
CJNE A,#38H,LOOP ;不是需要的,返回,继续

给你一个方法,是不太好写的
MOV DPTR,#TABLE ;256字节中没查到
INC DPH ;指向下一段
.......
SJMP $ ;是它,踏步
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
做而论道
高能答主

2014-12-28 · 把复杂的事情简单说给你听
知道大有可为答主
回答量:3万
采纳率:80%
帮助的人:1.2亿
展开全部
使用 MOVC A, @A+DPTR 即可查表。
追问
如果我要找第270个0FH呢,270已经超出A的范围
追答
超出了 256,加在 DPH 里面即可。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式