单片机汇编查表指令
movdptr,#tp0mova,xp0movca,@a+dptrmovp2,aincxp0rettp0:DB030H,048H,048H,048H,048H,048H,...
mov dptr,#tp0
mov a,xp0
movc a,@a+dptr
mov p2,a
inc xp0
ret
tp0: DB 030H,048H,048H,048H,048H,048H,030H,000H
DB 010H,030H,010H,010H,010H,010H,07CH,000H
DB 000H,038H,044H,004H,018H,020H,07CH,000H
DB 030H,048H,008H,010H,008H,048H,030H,000H
DB 008H,018H,028H,048H,07CH,008H,008H,000H
DB 03CH,020H,020H,038H,004H,024H,018H,000H
DB 078H,040H,040H,078H,048H,048H,078H,000H
DB 078H,008H,008H,008H,008H,008H,008H,000H
DB 030H,048H,048H,030H,048H,048H,030H,000H
DB 030H,048H,048H,038H,008H,048H,030H,000H
我想写一个这样的程序,就是说我要动态的显示每一个数字,显示完后自动跳转到下一个DB,但是我却想不出来,希望高手帮我一下。 展开
mov a,xp0
movc a,@a+dptr
mov p2,a
inc xp0
ret
tp0: DB 030H,048H,048H,048H,048H,048H,030H,000H
DB 010H,030H,010H,010H,010H,010H,07CH,000H
DB 000H,038H,044H,004H,018H,020H,07CH,000H
DB 030H,048H,008H,010H,008H,048H,030H,000H
DB 008H,018H,028H,048H,07CH,008H,008H,000H
DB 03CH,020H,020H,038H,004H,024H,018H,000H
DB 078H,040H,040H,078H,048H,048H,078H,000H
DB 078H,008H,008H,008H,008H,008H,008H,000H
DB 030H,048H,048H,030H,048H,048H,030H,000H
DB 030H,048H,048H,038H,008H,048H,030H,000H
我想写一个这样的程序,就是说我要动态的显示每一个数字,显示完后自动跳转到下一个DB,但是我却想不出来,希望高手帮我一下。 展开
2个回答
展开全部
mov xp0,#0
mov dptr,#tp0
LOOP: mov a,xp0
movc a,@a+dptr
mov p2,a
inc xp0
mov a,xp0
cjne a,#80,LOOP %循环查表中每一个直接的值,一共80次%
ret
tp0: DB 030H,048H,048H,048H,048H,048H,030H,000H
DB 010H,030H,010H,010H,010H,010H,07CH,000H
DB 000H,038H,044H,004H,018H,020H,07CH,000H
DB 030H,048H,008H,010H,008H,048H,030H,000H
DB 008H,018H,028H,048H,07CH,008H,008H,000H
DB 03CH,020H,020H,038H,004H,024H,018H,000H
DB 078H,040H,040H,078H,048H,048H,078H,000H
DB 078H,008H,008H,008H,008H,008H,008H,000H
DB 030H,048H,048H,030H,048H,048H,030H,000H
DB 030H,048H,048H,038H,008H,048H,030H,000H
mov dptr,#tp0
LOOP: mov a,xp0
movc a,@a+dptr
mov p2,a
inc xp0
mov a,xp0
cjne a,#80,LOOP %循环查表中每一个直接的值,一共80次%
ret
tp0: DB 030H,048H,048H,048H,048H,048H,030H,000H
DB 010H,030H,010H,010H,010H,010H,07CH,000H
DB 000H,038H,044H,004H,018H,020H,07CH,000H
DB 030H,048H,008H,010H,008H,048H,030H,000H
DB 008H,018H,028H,048H,07CH,008H,008H,000H
DB 03CH,020H,020H,038H,004H,024H,018H,000H
DB 078H,040H,040H,078H,048H,048H,078H,000H
DB 078H,008H,008H,008H,008H,008H,008H,000H
DB 030H,048H,048H,030H,048H,048H,030H,000H
DB 030H,048H,048H,038H,008H,048H,030H,000H
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询