今天小弟写了一个抢答器程序 程序如下: org 0000h ljmp mian org 0003h ljmp ttq;抢答时间调节 org 0013h ljmp ttd;答题时间调节 org 000bh ljmp timerq;抢答剩余时间 org 001bh ljmp timerd; 答题剩余时间 org 0040h mian: mov 30h,#30;抢答剩余时间 mov 31h,#60;答题剩余时间 mov 32h,#0 ;抢答时间结束 mov 33h,#0 ;答题时间结束 mov 33h,#0 ;抢答时间暂存 mov 36h,#0 ;答题时间暂存 mov 35h,#71h ;选手号 mov 37h,#0 ;选手号暂存 mov 38h,#30;抢答时间调整暂存 mov 40h,#60;答题时间调整暂存 lop: mov sp,#60h mov ie,#8fh mov ip,#0 mov tmod,#22h mov th0,#06h mov tl0,#06h mov th1,#06h mov tl1,#06h mov p1,35h loop: jb p3.0,jp ; 检查抢答是否开始 mov p1,#0 dis: lcall display jnb p3.1,fw k1: jnb p1.0,k11 ;检查错误抢答 k2: jnb p0.1,k22 k3: jnb p0.2,k33 k4: jnb p0.3,k44 k5: jnb p0.4,k55 k6: jnb p0.5,k66 k7: jnb p0.6,k77 k8: jnb p0.7,k88 ljmp loop k11: lcall dly ;违规抢答检查 jb p0.0,k2 mov 35h,#1 ljmp dis k22: lcall dly jb p0.1,k3 mov 35h,#2 ljmp dis k33: lcall dly jb p0.2,k4 mov 35h,#3 ljmp dis k44: lcall dly jb p0.3,k5 mov 35h,#4 ljmp dis k55: lcall dly jb p0.4,k6 mov 35h,#5 ljmp dis k66: lcall dly jb p0.5,k7 mov 35h,#6 ljmp dis k77: lcall dly jb p0.6,k8 mov 35h,#7 ljmp dis k88: lcall dly jb p0.7,loop mov 35h,#8 ljmp dis fw: lcall dly ;结束 jnb p3.1,loop ljmp dis jp: lcall dly ;正常抢答检查 jb p3.0,loop setb tr0 loop1: mov a,p0 anl a,#0ffh cpl a mov 37h,a mov r1,a display2: jnb p3.1,jsh1;回答完毕主持人结束 mov r1,30h cjne r1,#0,dtjs1;抢答时间到自动结束 mov dptr,#tab mov a,30h mov b,#10 div ab movc a,@a+dptr mov p1,a mov p2,#02h lcall dly mov p1,#0ffh mov a,b movc a,@a+dptr mov p1,a mov p2,#01h mov p1,#0ffh lcall dly mov p1,#71h mov p2,#04h lcall dly mov p1,#0ffh jp1: cjne r1,#01h,jp2 mov 35h,#1 ljmp display1 jp2: cjne r1,#02h,jp3 mov 35h,#2 ljmp display1 jp3: cjne r1,#04h,jp4 mov 35h,#3 ljmp display1 jp4: cjne r1,#08h,jp5 mov 35h,#4 ljmp display1 jp5: cjne r1,#10h,jp6 mov 35h,#5 ljmp display1 jp6: cjne r1,#20h,jp7 mov 35h,#6 ljmp display1 jp7: cjne r1,#40h,jp8 mov 35h,#7 ljmp display1 jp8: cjne r1,#80h,loop1 mov 35h,#8 display1: jnb p3.1,jsh;回答完毕主持人结束 mov r2,36h cjne r2,#0,dtjs;答题时间到自动结束 clr tr0 setb tr1 mov dptr,#tab mov a,36h mov b,#10 div ab movc a,@a+dptr mov p1,a mov p2,#02h lcall dly mov p1,#0ffh mov a,b mov p1,a mov p2,#01h lcall dly mov p1,#0ffh mov a,35h mov p2,#04h lcall dly mov p1,#0ffh ljmp loop1 jsh: lcall dly jnb p3.1,display1 clr tr1 mov 36h,40h dtjs: mov 30h,39h ljmp lop jsh1: lcall dly jnb p3.1,display2 dtjs1: mov 30h,40h ljmp lop timerq: dec 38h mov 30h,33h reti timerd: dec 40h mov 31h,40h reti ttq: clr tr1 clr tr0 clr ex0 lop1: jnb p3.0,dd lop11: jnb p3.1,jj lop12: jnb p3.2,wc ajmp lop1 dd: lcall dly jb p3.0,lop11 inc 38h mov r3,38h cjne r3,#99,lop1 mov 38h,#0 ajmp lop1 jj: lcall dly jb p3.1,lop12 dec 38h mov r3,38h cjne r3,#0,lop1 mov 38h,#99 ajmp lop1 wc: lcall dly jb p3.2,lop1 setb ex0 reti ttd: clr tr1 clr tr0 clr ex1 lop2: jnb p3.0,dd1 lop21: jnb p3.1,jj1 lop22: jnb p3.3,wc1 ajmp lop2 dd1: lcall dly jb p3.0,lop21 inc 40h mov r4,40h cjne r4,#99,lop2 mov 40h,#0 ajmp lop1 jj1: lcall dly jb p3.1,lop22 dec 40h mov r4,40h cjne r4,#0,lop2 mov 40h,#99 ajmp lop2 wc1: lcall dly jb p3.3,lop2 setb ex1 reti dly: mov r7,#100 dly1: mov r6,#30 djnz r6,$ djnz r7,dly1 ret display: mov dptr,#tab mov a,35h movc a,@a+dptr mov p1,#0 mov p2,#01h lcall dly mov p1,#0ffh mov p1,#0 mov p2,#02h lcall dly mov p1,#0ffh mov p1,a mov p2,#04h lcall dly mov p1,#0ffh ret tab: end
这段程序里面 有下列错误提示为: 1.asm(31): error A51: TARGET OUT OF RANGE loop: jb p3.0,jp ; 检查抢答是否开始 k88: lcall dly jb p0.7,loop 还有其他错误 请哥哥些帮我看看是怎回事情谢谢
|