;Showlaser-Steuerung $nomod51 $debug $nolist $include(reg515a.inc) $list ORG 0000H MOV SP,#30H START: JNB P1.1, PROG1 JNB P1.2, PROG2Z JNB P1.3, PROG3Z JNB P1.4, PROG4Z PROG2Z: LJMP PROG2 PROG3Z: LJMP PROG3 PROG4Z: LJMP PROG4 PROG1: MOV DPTR,#TAB1 ;DPTR auf Tabellenanfangsadresse MOV P5,#00H ;Y-Achse 50Hz LJMP LOOP Y2: MOV P5,#10H ;Y-Achse zweiter Wert LJMP LOOP Y3: MOV P5,#40H ;Y-Achse dritter Wert LOOP: MOVX A,@DPTR ;Daten auf die DPTR zeigt, in Akku laden CJNE A,#0FFH,NEXT1 ;Tabellenende erreicht? LJMP PROG1 NEXT1: MOV P4,A ;Akku auf X-Achse ausgeben INC DPTR ;DPTR um 1 erhöhen LCALL Warte ;Wartezeit 1s CJNE A,#8DH,NEXT2 ;zweiter Wert für Y-Achse nötig? LJMP Y2 NEXT2: CJNE A,#42H,NEXT3 ;dritter Wert für Y-Achse nötig? LJMP Y3 NEXT3: JNB P1.1, LOOP ;Drehschalter noch auf 1, dann wiederholen LJMP START ;Drehschalter nicht mehr auf 1, dann auf START TAB1: DB 4CH,4CH,8CH,8CH,8DH,0FH,0FH,28H DB 28H,41H,42H,03H,03H,0FFH PROG2: JNB P1.2, PROG2 ;Drehschalter noch auf 2, dann wiederholen LJMP START ;Drehschalter nicht mehr auf 2, dann auf START PROG3: JNB P1.3, PROG3 ;Drehschalter noch auf 3, dann wiederholen LJMP START ;Drehschalter nicht mehr auf 3, dann auf START PROG4: JNB P1.4, PROG4 ;Drehschalter noch auf 4, dann wiederholen LJMP START ;Drehschalter nicht mehr auf 4, dann auf START WARTE: MOV R0,#8 WAIT0: MOV R1,#250 WAIT1: MOV R2,#250 WAIT2: DJNZ R2, Wait2 DJNZ R1, Wait1 DJNZ R0, Wait0 RET END