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 展开
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 展开
展开全部
找哪一个数?假设找38H
MOV DPTR , #TABLE
LOOP:
MOV A,#0
MOVC A,@A+DPTR ;查表
CJNE A,#38H,LOOP ;不是需要的,返回,继续
SJMP $ ;是它,踏步
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 $ ;是它,踏步
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询