LCMRS EQU P2.4LCMRW EQU P2.5LCMEN EQU P2.6LCMDATA EQU P0ORG 0000HLJMP MAINORG 0030HMAIN:MOV SP,#60HLCALL LCMSETLCALL LCMCLRMOV A,#80HLCALL LCMWR0MOV DPTR,#TAB0LCALL LCMWR2MOV A,#0C0HLCALL LCMWR0MOV DPTR,#TAB1LCALL LCMWR2SJMP $TAB0: DB "I AM YUAN MING",00HTAB1: DB "NICE TO MEET YOU",00HLCMLAY: ;讀忙程序,用于判斷d7是否為0PUSH ACCLOOP:CLR LCMENCLR LCMRSSETB LCMRWSETB LCMENMOV A,LCMDATACLR LCMENJB ACC.7,LOOPPOP ACCLCALL DELAYRETLCMWR0: ;寫入指令LCALL LCMLAYCLR LCMENCLR LCMRSCLR LCMRWSETB LCMENMOV LCMDATA,ACLR LCMENRETLCMWR1: ;寫入數(shù)據(jù)LCALL LCMLAYCLR LCMENSETB LCMRSCLR LCMRWSETB LCMENMOV LCMDATA,ACLR LCMENRETLCMWR2: 寫入字符串(字符串屬于數(shù)據(jù))PUSH ACCLOOP1:CLR AMOVC A,@A+DPTRJZ LOOP2LCALL LCMWR1INC DPTRLJMP LOOP1LOOP2:POP ACCRETLCMSET: ;程序初始化MOV A,#38HLCALL LCMWR0MOV A,#08HLCALL LCMWR0MOV A,#01HLCALL LCMWR0MOV A,#06HLCALL LCMWR0MOV A,#0CHLCALL LCMWR0RETLCMCLR: ;清屏MOV A,#01HLCALL LCMWR0RETDELAY:MOV R6,#5 ;2.7MS延時(shí)子程序(作用尚不知)D1: MOV R7,#248DJNZ R7,$DJNZ R6,D1RETEND
評(píng)論