资源描述:
《红外遥控电子密码锁汇编程序(infrared remote control electronic code lock assembler)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、红外遥控电子密码锁汇编程序(Infraredremotecontrolelectroniccodelockassembler)InfraredremotecontrolelectroniccodelockprogramORG0000H;mainprogramCLRP1.7;clearedMOV,RO,#OOHCLRP1.3;turnoffthealarmCLRP1.7;P1.7clearedCLRP1.4;turnoffthealarmMOV,RO,#OOH,serialportinitializationMOV,52H,#02
2、H;sendanimmediatenumberof02Hto52HMOV,TMOD,#20H;settheT1modeofoperation2MOV,TL1,#OF4H;timedinitialvaluetosendTL1MOV,TH1,#OF4H;timedinitialvaluetosendTH1SETBTR1;starttimerT1MOV,SCON,#ODOH;defineseriallineoperation3MOV,PCON,#OOHKEY:,JNB,P1.5,KEP1;selectpassword57618LJMP
3、KEP2*******************************************************password57618programKEP1:,MOV,P2,#0FFH,passdisplayMOVA,P0todetermineifthereisakeypressCPLA;takethedatafromtheP0portbackANL,A,#OFFH;immediatedataOFFandPOdataphaseJNZJP;presskeytogotoJPMOV,A,P1;determinewhether
4、thekeyboardispressedCPLA;takethedatafromtheP1portbackANLA,#O7H;theaccumulatordataiszerototheremotereceiveprogramJZWAITACALLD10MS;calls10seconddelayMOV,A,P1CPLAANL,A,#O7HJZWAITPP1:,CJNE,A,#01H,JP1"MOV,P2,#89H;displaycharacters",H"LJMPK0P1PP2:,CJNE,A,#02H,JP2"MOV,P2,#8
5、9H;displaycharacters",H"LJMPKOP1JP2:,CJNE,A,#04H,KY"MOV,P2,#89H;displaycharacters",H"JP3:,MOV,A,#O7HCJNE,A,#07H,JP3LJMPLP1KOP1:,MOV,A,P1ANL,A,#07Hcjnea#07h,kop1ljmpkep1jp:lcalld10msmova,aftercplbut.anla#offhsouthwestc6cjzea#01h,key02movp2,#89hljmpkey1key02:cjnea#02h,
6、key03movp2,#89hljmpkjp1keyo3:cjnea#04h,key04movp2,#89ljmpkjp1key04:cjzea#08h,key05movp2,#89hljmpkjp1key05:cjzea#10,key06movp2,#89hljmpkjp1key06:cjzea#08h,key07movp2,#89hljmpkjp1key07cjzea#10key08movp2,#89hljmpkjp1key08cjzea#10h,c6movp2,#89hljmpkjp1kjp1:mova,p0cjnea#o
7、ffh,kjp1c6:ljmpwalt********************************************************************key1:lcallmpcjnea#02h,key03movp2,#89hkey2lcallmpcjnea#04,key02movp2,#89hkey3lcallmpcjnea#08,key02movp2,#89hkey4lcallmpcjnea#10,key02movp2,#89hkey5mova,p0cjnea#0ffh,key5movp2,#offhm
8、ovr5,#30key6:mova,aftercplbutanla#offhjnzbb2mova,p1cplbutanla#o7hibb1LCALLd10msMOVA,P1CPL的一ANLA,#07hJZcjne,#04h,B1MOVP2,#89hLJMPLP2