; test08.asm ; ; Programme de test de l'afficheur LCD 2*16 et du clavier standard ; ; (C) CHAMOUARD 1996 ; (Libre de droits pour utilisation non ; commerciale et à vos propres risques) ; ; Matériel requis : ; carte 8031 base 1, programme chargé en 2000h ; clavier standard (clavier 16 touches/6 leds) relié à la carte 8031 base1 ; afficheur connecté au port afficheur de la carte 8031 base 1 ; Bibliothèques requises : ; libasc.asm ; libcla1.asm ; liblcd.asm ; libret.asm ; Sortie : ; chenillard sur les leds avec "Programme de test" affiché ; si appui sur la touche "0" (bas à gauche), affichage "Moniteur" et jump dessus word LcdCmdReadAdd, #C000h word LcdCmdWriteAdd, #A000h word LcdDataReadAdd, #C001h word LcdDataWriteAdd, #A001h word ClaAdd, #E000h direct ClaLedReg, 08h byte ClaAntiRebonDly, #20 byte To0, #10h byte To1, #11h byte To2, #12h byte To3, #13h byte To4, #14h byte To5, #15h byte To6, #16h byte To7, #17h byte To8, #18h byte To9, #19h byte ToA, #1ah byte ToB, #1bh byte ToC, #1ch byte ToD, #1dh byte ToE, #1eh byte ToF, #1fh ORG 2000h Begin: mov SP,#0Fh ; Debut de pile lcall LcdInit mov DPTR,#Mes1 lcall LcdWriteString lcall LcdCurseurOff Boucle: lcall ClaTestLed lcall ClaRead cjne A,#1,Bouclesuite ; Test si double touche lcall ClaAntiRebond ljmp Boucle Bouclesuite: cjne A,#0,Bouclesuite2 ljmp Boucle Bouclesuite2: cjne A,#To0,Suiteaction1 ; Test si touche 0 mov DPTR,#Mes2 ; Touche 0 = retour au moniteur 8051 lcall LcdWriteString ljmp 0000h Suiteaction1: cjne A,#To1,Suiteaction2 ; Test si touche 1 Suiteaction2: cjne A,#To2,Suiteaction3 ; Test si touche 2 Suiteaction3: cjne A,#To3,Suiteaction4 ; Test si touche 3 Suiteaction4: cjne A,#To4,Suiteaction5 ; Test si touche 4 Suiteaction5: cjne A,#To5,Suiteaction6 ; Test si touche 5 Suiteaction6: cjne A,#To6,Suiteaction7 ; Test si touche 6 Suiteaction7: cjne A,#To7,Suiteaction8 ; Test si touche 7 Suiteaction8: cjne A,#To8,Suiteaction9 ; Test si touche 8 Suiteaction9: cjne A,#To9,Suiteaction10 ; Test si touche 9 Suiteaction10: cjne A,#ToA,Suiteaction11 ; Test si touche 10 Suiteaction11: cjne A,#ToB,Suiteaction12 ; Test si touche 11 Suiteaction12: cjne A,#ToC,Suiteaction13 ; Test si touche 12 Suiteaction13: cjne A,#ToD,Suiteaction14 ; Test si touche 13 Suiteaction14: cjne A,#ToE,Suiteaction15 ; Test si touche 14 Suiteaction15: cjne A,#ToF,Suiteaction16 ; Test si touche 15 Suiteaction16: ; Fin du test des touches ljmp Boucle ; Boucle infinie Mes1: DB " Programme de test ",0 Mes2: DB " Moniteur ",0 INCLUDE lib\liblcd.asm INCLUDE lib\libasc.asm INCLUDE lib\libcla1.asm INCLUDE lib\libret.asm