; Source created with Parsic Version 3.x

; at              : 23.02.2000 23:47:38


; Project File    : E:\DATEN\DELPHI\PARSIC\DEMO\BEISPI~1\ALU.PIC

; Project Version : 1.0.68

; Created         : 16.02.2000 08:09:00

; Last change     : 21.02.2000 21:26:00

	PROCESSOR 16F877

	INCLUDE P16F877.INC

	RADIX DEC


	__IDLOCS H'0100'

	__CONFIG _CP_OFF & _PWRTE_ON & _WDT_ON & _BODEN_ON & _XT_OSC & _LVP_OFF & _CPD_OFF & _DEBUG_OFF

; Diverses

ZERO	EQU Z	; ZERO-Flag
CARRY	 EQU C	; CARRY-Flag


; Variable

S16	= 32	; located in Bank 0
S4	= 33	; located in Bank 0
S0	= 34	; located in Bank 0
S17	= 35	; located in Bank 0
S18	= 36	; located in Bank 0
S19	= 37	; located in Bank 0
S1	= 38	; located in Bank 0
S2	= 39	; located in Bank 0
S11	= 40	; located in Bank 0
S3	= 41	; located in Bank 0
S12	= 42	; located in Bank 0
S13	= 43	; located in Bank 0
S14	= 44	; located in Bank 0
S15	= 45	; located in Bank 0
S5	= 46	; located in Bank 0
S8	= 47	; located in Bank 0
S6	= 48	; located in Bank 0
S9	= 49	; located in Bank 0
S7	= 50	; located in Bank 0
S10	= 51	; located in Bank 0
RAM	= 52	; located in Bank 0
SYS_TMP1	= 118	; located in Bank 0, 1, 2, 3

	ERRORLEVEL -302	; disable warning (Bankswitching)
	ERRORLEVEL -306	; disable warning (Pageswitching)

;****************************************
;Programmanfang
;****************************************

	ORG 0

	NOP
	MOVLW HIGH SYS_INIT	; set ROM-Bank
	MOVWF PCLATH
	GOTO SYS_INIT

;****************************************
; Subroutines
;****************************************


;****************************************
; Tables
;****************************************

	RETURN

;****************************************
;Initialisierung
;****************************************


SYS_INIT

	MOVLW B'00000000'
	MOVWF INTCON

; Ausgangs-Pegel setzen, bevor die Richtung gesetzt wird

	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	MOVLW B'00000000'
	MOVWF PORTA

	MOVLW B'00000000'
	MOVWF PORTB

	MOVLW B'00000000'
	MOVWF PORTC

	MOVLW B'00000000'
	MOVWF PORTD

	MOVLW B'00000000'
	MOVWF PORTE

	MOVLW 15
	BSF STATUS,RP0	; Bank 1
	BCF STATUS,RP1	; Bank 1
	MOVWF OPTION_REG

	BSF STATUS,RP0	; Bank 1
	BCF STATUS,RP1	; Bank 1
	MOVLW 6	; all Digital
	MOVWF ADCON1

; Richtung setzen

	MOVLW B'11111111'
	MOVWF TRISA

	MOVLW B'11111111'
	MOVWF TRISB

	MOVLW B'11111111'
	MOVWF TRISC

	MOVLW B'01110000'
	MOVWF TRISD

	MOVLW B'00000111'
	MOVWF TRISE

; init var

	MOVLW B'00001010'
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	MOVWF S16
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S4
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S0
	MOVLW B'00001100'
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	MOVWF S17
	MOVLW B'00001100'
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	MOVWF S18
	MOVLW B'00001100'
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	MOVWF S19
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S2
	CLRF SYS_TMP1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S11
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S12
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S13
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S14
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S15
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S5
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S8
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S6
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S9
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S7
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	CLRF S10


;**********************************
;******* Haupt-Programm ***********
;**********************************

MAIN

	CLRWDT

;***************************************************
; UND - Gatter -> LG1
;***************************************************

LABEL_LG1_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,0
	GOTO LABEL_LG1_FALSE
LABEL_LG1_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,4
	GOTO LABEL_LG1_FALSE
LABEL_LG1_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,4
	GOTO LABEL_LG1_FALSE

LABEL_LG1_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S16,0
	GOTO LABEL_LG1_ENDE
LABEL_LG1_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S16,0
LABEL_LG1_ENDE
;***************************************************
; UND - Gatter -> LG2
;***************************************************

LABEL_LG2_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S2,0
	GOTO LABEL_LG2_FALSE
LABEL_LG2_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S2,4
	GOTO LABEL_LG2_FALSE
LABEL_LG2_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S3,4
	GOTO LABEL_LG2_FALSE

LABEL_LG2_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S16,1
	GOTO LABEL_LG2_ENDE
LABEL_LG2_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S16,1
LABEL_LG2_ENDE
;***************************************************
; UND - Gatter -> LG3
;***************************************************

LABEL_LG3_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,0
	GOTO LABEL_LG3_FALSE
LABEL_LG3_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,4
	GOTO LABEL_LG3_FALSE

LABEL_LG3_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S16,4
	GOTO LABEL_LG3_ENDE
LABEL_LG3_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S16,4
LABEL_LG3_ENDE
;***************************************************
; UND - Gatter -> LG4
;***************************************************

LABEL_LG4_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,0
	GOTO LABEL_LG4_FALSE
LABEL_LG4_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,4
	GOTO LABEL_LG4_FALSE

LABEL_LG4_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S16,5
	GOTO LABEL_LG4_ENDE
LABEL_LG4_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S16,5
LABEL_LG4_ENDE
;***************************************************
; UND - Gatter -> LG5
;***************************************************

LABEL_LG5_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,4
	GOTO LABEL_LG5_FALSE
LABEL_LG5_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,4
	GOTO LABEL_LG5_FALSE

LABEL_LG5_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S16,6
	GOTO LABEL_LG5_ENDE
LABEL_LG5_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S16,6
LABEL_LG5_ENDE
;***************************************************
; UND - Gatter -> LG6
;***************************************************

LABEL_LG6_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S16,1
	GOTO LABEL_LG6_FALSE
LABEL_LG6_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S16,3
	GOTO LABEL_LG6_FALSE

LABEL_LG6_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S16,2
	GOTO LABEL_LG6_ENDE
LABEL_LG6_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S16,2
LABEL_LG6_ENDE
;***************************************************
; ODER - Gatter -> LG7
;***************************************************

LABEL_LG7_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S16,0
	GOTO LABEL_LG7_TRUE
LABEL_LG7_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S16,2
	GOTO LABEL_LG7_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG7_FALSE
	BCF S4,0
	GOTO LABEL_LG7_ENDE
LABEL_LG7_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S4,0
LABEL_LG7_ENDE
;***************************************************
; UND - Gatter -> LG8
;***************************************************

LABEL_LG8_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S0,0
	GOTO LABEL_LG8_FALSE

LABEL_LG8_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S16,3
	GOTO LABEL_LG8_ENDE
LABEL_LG8_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S16,3
LABEL_LG8_ENDE
;***************************************************
; ODER - Gatter -> LG9
;***************************************************

LABEL_LG9_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S16,4
	GOTO LABEL_LG9_TRUE
LABEL_LG9_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S16,5
	GOTO LABEL_LG9_TRUE
LABEL_LG9_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S16,6
	GOTO LABEL_LG9_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG9_FALSE
	BCF S0,0
	GOTO LABEL_LG9_ENDE
LABEL_LG9_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S0,0
LABEL_LG9_ENDE
;***************************************************
; UND - Gatter -> LG10
;***************************************************

LABEL_LG10_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,1
	GOTO LABEL_LG10_FALSE
LABEL_LG10_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,5
	GOTO LABEL_LG10_FALSE
LABEL_LG10_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S0,0
	GOTO LABEL_LG10_FALSE

LABEL_LG10_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S17,0
	GOTO LABEL_LG10_ENDE
LABEL_LG10_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S17,0
LABEL_LG10_ENDE
;***************************************************
; UND - Gatter -> LG11
;***************************************************

LABEL_LG11_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S2,1
	GOTO LABEL_LG11_FALSE
LABEL_LG11_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S2,5
	GOTO LABEL_LG11_FALSE
LABEL_LG11_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S0,0
	GOTO LABEL_LG11_FALSE

LABEL_LG11_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S17,2
	GOTO LABEL_LG11_ENDE
LABEL_LG11_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S17,2
LABEL_LG11_ENDE
;***************************************************
; UND - Gatter -> LG12
;***************************************************

LABEL_LG12_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,1
	GOTO LABEL_LG12_FALSE
LABEL_LG12_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,5
	GOTO LABEL_LG12_FALSE

LABEL_LG12_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S17,4
	GOTO LABEL_LG12_ENDE
LABEL_LG12_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S17,4
LABEL_LG12_ENDE
;***************************************************
; UND - Gatter -> LG13
;***************************************************

LABEL_LG13_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,1
	GOTO LABEL_LG13_FALSE
LABEL_LG13_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S0,0
	GOTO LABEL_LG13_FALSE

LABEL_LG13_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S17,5
	GOTO LABEL_LG13_ENDE
LABEL_LG13_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S17,5
LABEL_LG13_ENDE
;***************************************************
; UND - Gatter -> LG14
;***************************************************

LABEL_LG14_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,5
	GOTO LABEL_LG14_FALSE
LABEL_LG14_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S0,0
	GOTO LABEL_LG14_FALSE

LABEL_LG14_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S17,6
	GOTO LABEL_LG14_ENDE
LABEL_LG14_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S17,6
LABEL_LG14_ENDE
;***************************************************
; UND - Gatter -> LG15
;***************************************************

LABEL_LG15_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S17,2
	GOTO LABEL_LG15_FALSE
LABEL_LG15_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S17,3
	GOTO LABEL_LG15_FALSE

LABEL_LG15_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S17,1
	GOTO LABEL_LG15_ENDE
LABEL_LG15_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S17,1
LABEL_LG15_ENDE
;***************************************************
; ODER - Gatter -> LG16
;***************************************************

LABEL_LG16_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S17,0
	GOTO LABEL_LG16_TRUE
LABEL_LG16_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S17,1
	GOTO LABEL_LG16_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG16_FALSE
	BCF S4,1
	GOTO LABEL_LG16_ENDE
LABEL_LG16_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S4,1
LABEL_LG16_ENDE
;***************************************************
; UND - Gatter -> LG17
;***************************************************

LABEL_LG17_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S0,1
	GOTO LABEL_LG17_FALSE

LABEL_LG17_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S17,3
	GOTO LABEL_LG17_ENDE
LABEL_LG17_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S17,3
LABEL_LG17_ENDE
;***************************************************
; ODER - Gatter -> LG18
;***************************************************

LABEL_LG18_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S17,4
	GOTO LABEL_LG18_TRUE
LABEL_LG18_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S17,5
	GOTO LABEL_LG18_TRUE
LABEL_LG18_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S17,6
	GOTO LABEL_LG18_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG18_FALSE
	BCF S0,1
	GOTO LABEL_LG18_ENDE
LABEL_LG18_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S0,1
LABEL_LG18_ENDE
;***************************************************
; UND - Gatter -> LG19
;***************************************************

LABEL_LG19_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,2
	GOTO LABEL_LG19_FALSE
LABEL_LG19_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,6
	GOTO LABEL_LG19_FALSE
LABEL_LG19_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S0,1
	GOTO LABEL_LG19_FALSE

LABEL_LG19_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S18,0
	GOTO LABEL_LG19_ENDE
LABEL_LG19_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S18,0
LABEL_LG19_ENDE
;***************************************************
; UND - Gatter -> LG20
;***************************************************

LABEL_LG20_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S2,2
	GOTO LABEL_LG20_FALSE
LABEL_LG20_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S2,6
	GOTO LABEL_LG20_FALSE
LABEL_LG20_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S0,1
	GOTO LABEL_LG20_FALSE

LABEL_LG20_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S18,2
	GOTO LABEL_LG20_ENDE
LABEL_LG20_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S18,2
LABEL_LG20_ENDE
;***************************************************
; UND - Gatter -> LG21
;***************************************************

LABEL_LG21_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,2
	GOTO LABEL_LG21_FALSE
LABEL_LG21_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,6
	GOTO LABEL_LG21_FALSE

LABEL_LG21_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S18,4
	GOTO LABEL_LG21_ENDE
LABEL_LG21_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S18,4
LABEL_LG21_ENDE
;***************************************************
; UND - Gatter -> LG22
;***************************************************

LABEL_LG22_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,2
	GOTO LABEL_LG22_FALSE
LABEL_LG22_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S0,1
	GOTO LABEL_LG22_FALSE

LABEL_LG22_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S18,5
	GOTO LABEL_LG22_ENDE
LABEL_LG22_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S18,5
LABEL_LG22_ENDE
;***************************************************
; UND - Gatter -> LG23
;***************************************************

LABEL_LG23_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,6
	GOTO LABEL_LG23_FALSE
LABEL_LG23_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S0,1
	GOTO LABEL_LG23_FALSE

LABEL_LG23_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S18,6
	GOTO LABEL_LG23_ENDE
LABEL_LG23_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S18,6
LABEL_LG23_ENDE
;***************************************************
; UND - Gatter -> LG24
;***************************************************

LABEL_LG24_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S18,2
	GOTO LABEL_LG24_FALSE
LABEL_LG24_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S18,3
	GOTO LABEL_LG24_FALSE

LABEL_LG24_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S18,1
	GOTO LABEL_LG24_ENDE
LABEL_LG24_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S18,1
LABEL_LG24_ENDE
;***************************************************
; ODER - Gatter -> LG25
;***************************************************

LABEL_LG25_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S18,0
	GOTO LABEL_LG25_TRUE
LABEL_LG25_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S18,1
	GOTO LABEL_LG25_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG25_FALSE
	BCF S4,2
	GOTO LABEL_LG25_ENDE
LABEL_LG25_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S4,2
LABEL_LG25_ENDE
;***************************************************
; UND - Gatter -> LG26
;***************************************************

LABEL_LG26_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S0,2
	GOTO LABEL_LG26_FALSE

LABEL_LG26_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S18,3
	GOTO LABEL_LG26_ENDE
LABEL_LG26_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S18,3
LABEL_LG26_ENDE
;***************************************************
; ODER - Gatter -> LG27
;***************************************************

LABEL_LG27_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S18,4
	GOTO LABEL_LG27_TRUE
LABEL_LG27_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S18,5
	GOTO LABEL_LG27_TRUE
LABEL_LG27_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S18,6
	GOTO LABEL_LG27_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG27_FALSE
	BCF S0,2
	GOTO LABEL_LG27_ENDE
LABEL_LG27_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S0,2
LABEL_LG27_ENDE
;***************************************************
; UND - Gatter -> LG28
;***************************************************

LABEL_LG28_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,3
	GOTO LABEL_LG28_FALSE
LABEL_LG28_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,7
	GOTO LABEL_LG28_FALSE
LABEL_LG28_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S0,2
	GOTO LABEL_LG28_FALSE

LABEL_LG28_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S19,0
	GOTO LABEL_LG28_ENDE
LABEL_LG28_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S19,0
LABEL_LG28_ENDE
;***************************************************
; UND - Gatter -> LG29
;***************************************************

LABEL_LG29_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S2,3
	GOTO LABEL_LG29_FALSE
LABEL_LG29_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S2,7
	GOTO LABEL_LG29_FALSE
LABEL_LG29_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S0,2
	GOTO LABEL_LG29_FALSE

LABEL_LG29_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S19,2
	GOTO LABEL_LG29_ENDE
LABEL_LG29_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S19,2
LABEL_LG29_ENDE
;***************************************************
; UND - Gatter -> LG30
;***************************************************

LABEL_LG30_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,3
	GOTO LABEL_LG30_FALSE
LABEL_LG30_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,7
	GOTO LABEL_LG30_FALSE

LABEL_LG30_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S19,4
	GOTO LABEL_LG30_ENDE
LABEL_LG30_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S19,4
LABEL_LG30_ENDE
;***************************************************
; UND - Gatter -> LG31
;***************************************************

LABEL_LG31_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,3
	GOTO LABEL_LG31_FALSE
LABEL_LG31_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S0,2
	GOTO LABEL_LG31_FALSE

LABEL_LG31_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S19,5
	GOTO LABEL_LG31_ENDE
LABEL_LG31_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S19,5
LABEL_LG31_ENDE
;***************************************************
; UND - Gatter -> LG32
;***************************************************

LABEL_LG32_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S2,7
	GOTO LABEL_LG32_FALSE
LABEL_LG32_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S0,2
	GOTO LABEL_LG32_FALSE

LABEL_LG32_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S19,6
	GOTO LABEL_LG32_ENDE
LABEL_LG32_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S19,6
LABEL_LG32_ENDE
;***************************************************
; UND - Gatter -> LG33
;***************************************************

LABEL_LG33_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S19,2
	GOTO LABEL_LG33_FALSE
LABEL_LG33_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S19,3
	GOTO LABEL_LG33_FALSE

LABEL_LG33_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S19,1
	GOTO LABEL_LG33_ENDE
LABEL_LG33_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S19,1
LABEL_LG33_ENDE
;***************************************************
; ODER - Gatter -> LG34
;***************************************************

LABEL_LG34_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S19,0
	GOTO LABEL_LG34_TRUE
LABEL_LG34_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S19,1
	GOTO LABEL_LG34_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG34_FALSE
	BCF S4,3
	GOTO LABEL_LG34_ENDE
LABEL_LG34_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S4,3
LABEL_LG34_ENDE
;***************************************************
; UND - Gatter -> LG35
;***************************************************

LABEL_LG35_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTD,7
	GOTO LABEL_LG35_FALSE

LABEL_LG35_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S19,3
	GOTO LABEL_LG35_ENDE
LABEL_LG35_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S19,3
LABEL_LG35_ENDE
;***************************************************
; ODER - Gatter -> LG36
;***************************************************

LABEL_LG36_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S19,4
	GOTO LABEL_LG36_TRUE
LABEL_LG36_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S19,5
	GOTO LABEL_LG36_TRUE
LABEL_LG36_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S19,6
	GOTO LABEL_LG36_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG36_FALSE
	BCF PORTD,7
	GOTO LABEL_LG36_ENDE
LABEL_LG36_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF PORTD,7
LABEL_LG36_ENDE
;***************************************************
; UND - Gatter -> LG37
;***************************************************

LABEL_LG37_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,0
	GOTO LABEL_LG37_FALSE
LABEL_LG37_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,0
	GOTO LABEL_LG37_FALSE

LABEL_LG37_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S1,0
	GOTO LABEL_LG37_ENDE
LABEL_LG37_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S1,0
LABEL_LG37_ENDE
;***************************************************
; UND - Gatter -> LG38
;***************************************************

LABEL_LG38_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,0
	GOTO LABEL_LG38_FALSE
LABEL_LG38_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,1
	GOTO LABEL_LG38_FALSE

LABEL_LG38_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S1,1
	GOTO LABEL_LG38_ENDE
LABEL_LG38_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S1,1
LABEL_LG38_ENDE
;***************************************************
; UND - Gatter -> LG39
;***************************************************

LABEL_LG39_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,0
	GOTO LABEL_LG39_FALSE
LABEL_LG39_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,2
	GOTO LABEL_LG39_FALSE

LABEL_LG39_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S1,2
	GOTO LABEL_LG39_ENDE
LABEL_LG39_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S1,2
LABEL_LG39_ENDE
;***************************************************
; UND - Gatter -> LG40
;***************************************************

LABEL_LG40_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,0
	GOTO LABEL_LG40_FALSE
LABEL_LG40_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,3
	GOTO LABEL_LG40_FALSE

LABEL_LG40_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S1,3
	GOTO LABEL_LG40_ENDE
LABEL_LG40_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S1,3
LABEL_LG40_ENDE
;***************************************************
; UND - Gatter -> LG41
;***************************************************

LABEL_LG41_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,1
	GOTO LABEL_LG41_FALSE
LABEL_LG41_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,4
	GOTO LABEL_LG41_FALSE

LABEL_LG41_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S1,4
	GOTO LABEL_LG41_ENDE
LABEL_LG41_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S1,4
LABEL_LG41_ENDE
;***************************************************
; UND - Gatter -> LG42
;***************************************************

LABEL_LG42_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,1
	GOTO LABEL_LG42_FALSE
LABEL_LG42_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,5
	GOTO LABEL_LG42_FALSE

LABEL_LG42_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S1,5
	GOTO LABEL_LG42_ENDE
LABEL_LG42_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S1,5
LABEL_LG42_ENDE
;***************************************************
; UND - Gatter -> LG43
;***************************************************

LABEL_LG43_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,1
	GOTO LABEL_LG43_FALSE
LABEL_LG43_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,6
	GOTO LABEL_LG43_FALSE

LABEL_LG43_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S1,6
	GOTO LABEL_LG43_ENDE
LABEL_LG43_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S1,6
LABEL_LG43_ENDE
;***************************************************
; UND - Gatter -> LG44
;***************************************************

LABEL_LG44_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,1
	GOTO LABEL_LG44_FALSE
LABEL_LG44_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,7
	GOTO LABEL_LG44_FALSE

LABEL_LG44_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S1,7
	GOTO LABEL_LG44_ENDE
LABEL_LG44_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S1,7
LABEL_LG44_ENDE
;***************************************************
; EXKLUSIVODER - Gatter -> LG45
;***************************************************

	CLRF SYS_TMP1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,2
	GOTO LABEL_LG45_1
	INCF SYS_TMP1,F

LABEL_LG45_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S1,0
	GOTO LABEL_LG45_2
	INCF SYS_TMP1,F

LABEL_LG45_2
	DECF SYS_TMP1,F
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC STATUS,ZERO
	BSF S2,0
	BTFSS STATUS,ZERO
	BCF S2,0
;***************************************************
; EXKLUSIVODER - Gatter -> LG46
;***************************************************

	CLRF SYS_TMP1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,2
	GOTO LABEL_LG46_1
	INCF SYS_TMP1,F

LABEL_LG46_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S1,1
	GOTO LABEL_LG46_2
	INCF SYS_TMP1,F

LABEL_LG46_2
	DECF SYS_TMP1,F
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC STATUS,ZERO
	BSF S2,1
	BTFSS STATUS,ZERO
	BCF S2,1
;***************************************************
; EXKLUSIVODER - Gatter -> LG47
;***************************************************

	CLRF SYS_TMP1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,2
	GOTO LABEL_LG47_1
	INCF SYS_TMP1,F

LABEL_LG47_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S1,2
	GOTO LABEL_LG47_2
	INCF SYS_TMP1,F

LABEL_LG47_2
	DECF SYS_TMP1,F
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC STATUS,ZERO
	BSF S2,2
	BTFSS STATUS,ZERO
	BCF S2,2
;***************************************************
; EXKLUSIVODER - Gatter -> LG48
;***************************************************

	CLRF SYS_TMP1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,2
	GOTO LABEL_LG48_1
	INCF SYS_TMP1,F

LABEL_LG48_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S1,3
	GOTO LABEL_LG48_2
	INCF SYS_TMP1,F

LABEL_LG48_2
	DECF SYS_TMP1,F
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC STATUS,ZERO
	BSF S2,3
	BTFSS STATUS,ZERO
	BCF S2,3
;***************************************************
; EXKLUSIVODER - Gatter -> LG49
;***************************************************

	CLRF SYS_TMP1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,3
	GOTO LABEL_LG49_1
	INCF SYS_TMP1,F

LABEL_LG49_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S1,4
	GOTO LABEL_LG49_2
	INCF SYS_TMP1,F

LABEL_LG49_2
	DECF SYS_TMP1,F
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC STATUS,ZERO
	BSF S2,4
	BTFSS STATUS,ZERO
	BCF S2,4
;***************************************************
; EXKLUSIVODER - Gatter -> LG50
;***************************************************

	CLRF SYS_TMP1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,3
	GOTO LABEL_LG50_1
	INCF SYS_TMP1,F

LABEL_LG50_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S1,5
	GOTO LABEL_LG50_2
	INCF SYS_TMP1,F

LABEL_LG50_2
	DECF SYS_TMP1,F
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC STATUS,ZERO
	BSF S2,5
	BTFSS STATUS,ZERO
	BCF S2,5
;***************************************************
; EXKLUSIVODER - Gatter -> LG51
;***************************************************

	CLRF SYS_TMP1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,3
	GOTO LABEL_LG51_1
	INCF SYS_TMP1,F

LABEL_LG51_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S1,6
	GOTO LABEL_LG51_2
	INCF SYS_TMP1,F

LABEL_LG51_2
	DECF SYS_TMP1,F
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC STATUS,ZERO
	BSF S2,6
	BTFSS STATUS,ZERO
	BCF S2,6
;***************************************************
; EXKLUSIVODER - Gatter -> LG52
;***************************************************

	CLRF SYS_TMP1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,3
	GOTO LABEL_LG52_1
	INCF SYS_TMP1,F

LABEL_LG52_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S1,7
	GOTO LABEL_LG52_2
	INCF SYS_TMP1,F

LABEL_LG52_2
	DECF SYS_TMP1,F
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC STATUS,ZERO
	BSF S2,7
	BTFSS STATUS,ZERO
	BCF S2,7
;***************************************************
; UND - Gatter -> LG53
;***************************************************

LABEL_LG53_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,3
	GOTO LABEL_LG53_FALSE
LABEL_LG53_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,1
	GOTO LABEL_LG53_FALSE
LABEL_LG53_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,0
	GOTO LABEL_LG53_FALSE

LABEL_LG53_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S11,0
	GOTO LABEL_LG53_ENDE
LABEL_LG53_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S11,0
LABEL_LG53_ENDE
;***************************************************
; UND - Gatter -> LG54
;***************************************************

LABEL_LG54_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,2
	GOTO LABEL_LG54_FALSE
LABEL_LG54_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,1
	GOTO LABEL_LG54_FALSE
LABEL_LG54_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,0
	GOTO LABEL_LG54_FALSE

LABEL_LG54_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S11,1
	GOTO LABEL_LG54_ENDE
LABEL_LG54_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S11,1
LABEL_LG54_ENDE
;***************************************************
; UND - Gatter -> LG55
;***************************************************

LABEL_LG55_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,2
	GOTO LABEL_LG55_FALSE
LABEL_LG55_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,1
	GOTO LABEL_LG55_FALSE
LABEL_LG55_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,0
	GOTO LABEL_LG55_FALSE

LABEL_LG55_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S11,2
	GOTO LABEL_LG55_ENDE
LABEL_LG55_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S11,2
LABEL_LG55_ENDE
;***************************************************
; UND - Gatter -> LG56
;***************************************************

LABEL_LG56_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,3
	GOTO LABEL_LG56_FALSE
LABEL_LG56_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,1
	GOTO LABEL_LG56_FALSE
LABEL_LG56_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,0
	GOTO LABEL_LG56_FALSE

LABEL_LG56_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S11,3
	GOTO LABEL_LG56_ENDE
LABEL_LG56_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S11,3
LABEL_LG56_ENDE
;***************************************************
; ODER - Gatter -> LG57
;***************************************************

LABEL_LG57_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S11,0
	GOTO LABEL_LG57_TRUE
LABEL_LG57_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S11,1
	GOTO LABEL_LG57_TRUE
LABEL_LG57_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S11,2
	GOTO LABEL_LG57_TRUE
LABEL_LG57_4
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S11,3
	GOTO LABEL_LG57_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG57_FALSE
	BCF S3,0
	GOTO LABEL_LG57_ENDE
LABEL_LG57_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S3,0
LABEL_LG57_ENDE
;***************************************************
; UND - Gatter -> LG58
;***************************************************

LABEL_LG58_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,3
	GOTO LABEL_LG58_FALSE
LABEL_LG58_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,2
	GOTO LABEL_LG58_FALSE

LABEL_LG58_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S12,0
	GOTO LABEL_LG58_ENDE
LABEL_LG58_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S12,0
LABEL_LG58_ENDE
;***************************************************
; UND - Gatter -> LG59
;***************************************************

LABEL_LG59_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,3
	GOTO LABEL_LG59_FALSE
LABEL_LG59_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,2
	GOTO LABEL_LG59_FALSE
LABEL_LG59_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,1
	GOTO LABEL_LG59_FALSE

LABEL_LG59_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S12,1
	GOTO LABEL_LG59_ENDE
LABEL_LG59_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S12,1
LABEL_LG59_ENDE
;***************************************************
; UND - Gatter -> LG60
;***************************************************

LABEL_LG60_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,3
	GOTO LABEL_LG60_FALSE
LABEL_LG60_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,2
	GOTO LABEL_LG60_FALSE
LABEL_LG60_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,0
	GOTO LABEL_LG60_FALSE

LABEL_LG60_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S12,2
	GOTO LABEL_LG60_ENDE
LABEL_LG60_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S12,2
LABEL_LG60_ENDE
;***************************************************
; ODER - Gatter -> LG61
;***************************************************

LABEL_LG61_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S12,0
	GOTO LABEL_LG61_TRUE
LABEL_LG61_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S12,1
	GOTO LABEL_LG61_TRUE
LABEL_LG61_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S12,2
	GOTO LABEL_LG61_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG61_FALSE
	BCF S3,1
	GOTO LABEL_LG61_ENDE
LABEL_LG61_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S3,1
LABEL_LG61_ENDE
;***************************************************
; UND - Gatter -> LG62
;***************************************************

LABEL_LG62_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,3
	GOTO LABEL_LG62_FALSE
LABEL_LG62_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,2
	GOTO LABEL_LG62_FALSE
LABEL_LG62_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,1
	GOTO LABEL_LG62_FALSE
LABEL_LG62_4
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,0
	GOTO LABEL_LG62_FALSE

LABEL_LG62_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S13,0
	GOTO LABEL_LG62_ENDE
LABEL_LG62_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S13,0
LABEL_LG62_ENDE
;***************************************************
; UND - Gatter -> LG63
;***************************************************

LABEL_LG63_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,3
	GOTO LABEL_LG63_FALSE
LABEL_LG63_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,2
	GOTO LABEL_LG63_FALSE
LABEL_LG63_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,1
	GOTO LABEL_LG63_FALSE
LABEL_LG63_4
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,0
	GOTO LABEL_LG63_FALSE

LABEL_LG63_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S13,1
	GOTO LABEL_LG63_ENDE
LABEL_LG63_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S13,1
LABEL_LG63_ENDE
;***************************************************
; UND - Gatter -> LG64
;***************************************************

LABEL_LG64_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,3
	GOTO LABEL_LG64_FALSE
LABEL_LG64_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,2
	GOTO LABEL_LG64_FALSE
LABEL_LG64_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,1
	GOTO LABEL_LG64_FALSE
LABEL_LG64_4
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,0
	GOTO LABEL_LG64_FALSE

LABEL_LG64_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S13,2
	GOTO LABEL_LG64_ENDE
LABEL_LG64_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S13,2
LABEL_LG64_ENDE
;***************************************************
; UND - Gatter -> LG65
;***************************************************

LABEL_LG65_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,3
	GOTO LABEL_LG65_FALSE
LABEL_LG65_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,2
	GOTO LABEL_LG65_FALSE
LABEL_LG65_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,1
	GOTO LABEL_LG65_FALSE
LABEL_LG65_4
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,0
	GOTO LABEL_LG65_FALSE

LABEL_LG65_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S13,3
	GOTO LABEL_LG65_ENDE
LABEL_LG65_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S13,3
LABEL_LG65_ENDE
;***************************************************
; ODER - Gatter -> LG66
;***************************************************

LABEL_LG66_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S13,0
	GOTO LABEL_LG66_TRUE
LABEL_LG66_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S13,1
	GOTO LABEL_LG66_TRUE
LABEL_LG66_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S13,2
	GOTO LABEL_LG66_TRUE
LABEL_LG66_4
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S13,3
	GOTO LABEL_LG66_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG66_FALSE
	BCF S3,2
	GOTO LABEL_LG66_ENDE
LABEL_LG66_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S3,2
LABEL_LG66_ENDE
;***************************************************
; UND - Gatter -> LG67
;***************************************************

LABEL_LG67_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,3
	GOTO LABEL_LG67_FALSE
LABEL_LG67_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,2
	GOTO LABEL_LG67_FALSE
LABEL_LG67_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,1
	GOTO LABEL_LG67_FALSE
LABEL_LG67_4
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,0
	GOTO LABEL_LG67_FALSE

LABEL_LG67_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S14,0
	GOTO LABEL_LG67_ENDE
LABEL_LG67_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S14,0
LABEL_LG67_ENDE
;***************************************************
; UND - Gatter -> LG68
;***************************************************

LABEL_LG68_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,2
	GOTO LABEL_LG68_FALSE
LABEL_LG68_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,1
	GOTO LABEL_LG68_FALSE
LABEL_LG68_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,0
	GOTO LABEL_LG68_FALSE

LABEL_LG68_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S14,1
	GOTO LABEL_LG68_ENDE
LABEL_LG68_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S14,1
LABEL_LG68_ENDE
;***************************************************
; ODER - Gatter -> LG69
;***************************************************

LABEL_LG69_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S14,0
	GOTO LABEL_LG69_TRUE
LABEL_LG69_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S14,1
	GOTO LABEL_LG69_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG69_FALSE
	BCF S3,3
	GOTO LABEL_LG69_ENDE
LABEL_LG69_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S3,3
LABEL_LG69_ENDE
;***************************************************
; UND - Gatter -> LG70
;***************************************************

LABEL_LG70_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,2
	GOTO LABEL_LG70_FALSE
LABEL_LG70_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,1
	GOTO LABEL_LG70_FALSE
LABEL_LG70_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,0
	GOTO LABEL_LG70_FALSE

LABEL_LG70_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S15,0
	GOTO LABEL_LG70_ENDE
LABEL_LG70_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S15,0
LABEL_LG70_ENDE
;***************************************************
; UND - Gatter -> LG71
;***************************************************

LABEL_LG71_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,3
	GOTO LABEL_LG71_FALSE
LABEL_LG71_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,2
	GOTO LABEL_LG71_FALSE
LABEL_LG71_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,1
	GOTO LABEL_LG71_FALSE
LABEL_LG71_4
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,0
	GOTO LABEL_LG71_FALSE

LABEL_LG71_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S15,1
	GOTO LABEL_LG71_ENDE
LABEL_LG71_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S15,1
LABEL_LG71_ENDE
;***************************************************
; UND - Gatter -> LG72
;***************************************************

LABEL_LG72_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,3
	GOTO LABEL_LG72_FALSE
LABEL_LG72_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTA,2
	GOTO LABEL_LG72_FALSE

LABEL_LG72_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S15,2
	GOTO LABEL_LG72_ENDE
LABEL_LG72_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S15,2
LABEL_LG72_ENDE
;***************************************************
; ODER - Gatter -> LG73
;***************************************************

LABEL_LG73_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S15,0
	GOTO LABEL_LG73_TRUE
LABEL_LG73_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S15,1
	GOTO LABEL_LG73_TRUE
LABEL_LG73_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S15,2
	GOTO LABEL_LG73_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG73_FALSE
	BCF S3,4
	GOTO LABEL_LG73_ENDE
LABEL_LG73_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S3,4
LABEL_LG73_ENDE
;***************************************************
; UND - Gatter -> LG74
;***************************************************

LABEL_LG74_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,3
	GOTO LABEL_LG74_FALSE
LABEL_LG74_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,2
	GOTO LABEL_LG74_FALSE
LABEL_LG74_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,1
	GOTO LABEL_LG74_FALSE

LABEL_LG74_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S3,5
	GOTO LABEL_LG74_ENDE
LABEL_LG74_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S3,5
LABEL_LG74_ENDE
;***************************************************
; UND - Gatter -> LG75
;***************************************************

LABEL_LG75_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,3
	GOTO LABEL_LG75_FALSE
LABEL_LG75_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,2
	GOTO LABEL_LG75_FALSE
LABEL_LG75_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTA,0
	GOTO LABEL_LG75_FALSE

LABEL_LG75_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S3,6
	GOTO LABEL_LG75_ENDE
LABEL_LG75_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S3,6
LABEL_LG75_ENDE
;***************************************************
; UND - Gatter -> LG76
;***************************************************

LABEL_LG76_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,0
	GOTO LABEL_LG76_FALSE
LABEL_LG76_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,4
	GOTO LABEL_LG76_FALSE

LABEL_LG76_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S5,0
	GOTO LABEL_LG76_ENDE
LABEL_LG76_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S5,0
LABEL_LG76_ENDE
;***************************************************
; UND - Gatter -> LG77
;***************************************************

LABEL_LG77_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,1
	GOTO LABEL_LG77_FALSE
LABEL_LG77_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,5
	GOTO LABEL_LG77_FALSE

LABEL_LG77_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S5,1
	GOTO LABEL_LG77_ENDE
LABEL_LG77_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S5,1
LABEL_LG77_ENDE
;***************************************************
; UND - Gatter -> LG78
;***************************************************

LABEL_LG78_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,2
	GOTO LABEL_LG78_FALSE
LABEL_LG78_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,6
	GOTO LABEL_LG78_FALSE

LABEL_LG78_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S5,2
	GOTO LABEL_LG78_ENDE
LABEL_LG78_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S5,2
LABEL_LG78_ENDE
;***************************************************
; UND - Gatter -> LG79
;***************************************************

LABEL_LG79_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,3
	GOTO LABEL_LG79_FALSE
LABEL_LG79_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,7
	GOTO LABEL_LG79_FALSE

LABEL_LG79_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S5,3
	GOTO LABEL_LG79_ENDE
LABEL_LG79_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S5,3
LABEL_LG79_ENDE
;***************************************************
; UND - Gatter -> LG80
;***************************************************

LABEL_LG80_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S5,0
	GOTO LABEL_LG80_FALSE
LABEL_LG80_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,6
	GOTO LABEL_LG80_FALSE
LABEL_LG80_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S3,5
	GOTO LABEL_LG80_FALSE

LABEL_LG80_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S8,0
	GOTO LABEL_LG80_ENDE
LABEL_LG80_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S8,0
LABEL_LG80_ENDE
;***************************************************
; UND - Gatter -> LG81
;***************************************************

LABEL_LG81_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S5,1
	GOTO LABEL_LG81_FALSE
LABEL_LG81_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,6
	GOTO LABEL_LG81_FALSE
LABEL_LG81_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S3,5
	GOTO LABEL_LG81_FALSE

LABEL_LG81_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S8,1
	GOTO LABEL_LG81_ENDE
LABEL_LG81_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S8,1
LABEL_LG81_ENDE
;***************************************************
; UND - Gatter -> LG82
;***************************************************

LABEL_LG82_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S5,2
	GOTO LABEL_LG82_FALSE
LABEL_LG82_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,6
	GOTO LABEL_LG82_FALSE
LABEL_LG82_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S3,5
	GOTO LABEL_LG82_FALSE

LABEL_LG82_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S8,2
	GOTO LABEL_LG82_ENDE
LABEL_LG82_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S8,2
LABEL_LG82_ENDE
;***************************************************
; UND - Gatter -> LG83
;***************************************************

LABEL_LG83_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S5,3
	GOTO LABEL_LG83_FALSE
LABEL_LG83_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,6
	GOTO LABEL_LG83_FALSE
LABEL_LG83_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S3,5
	GOTO LABEL_LG83_FALSE

LABEL_LG83_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S8,3
	GOTO LABEL_LG83_ENDE
LABEL_LG83_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S8,3
LABEL_LG83_ENDE
;***************************************************
; ODER - Gatter -> LG84
;***************************************************

LABEL_LG84_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTC,0
	GOTO LABEL_LG84_TRUE
LABEL_LG84_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTC,4
	GOTO LABEL_LG84_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG84_FALSE
	BCF S6,0
	GOTO LABEL_LG84_ENDE
LABEL_LG84_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S6,0
LABEL_LG84_ENDE
;***************************************************
; ODER - Gatter -> LG85
;***************************************************

LABEL_LG85_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTC,1
	GOTO LABEL_LG85_TRUE
LABEL_LG85_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTC,5
	GOTO LABEL_LG85_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG85_FALSE
	BCF S6,1
	GOTO LABEL_LG85_ENDE
LABEL_LG85_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S6,1
LABEL_LG85_ENDE
;***************************************************
; ODER - Gatter -> LG86
;***************************************************

LABEL_LG86_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTC,2
	GOTO LABEL_LG86_TRUE
LABEL_LG86_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTC,6
	GOTO LABEL_LG86_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG86_FALSE
	BCF S6,2
	GOTO LABEL_LG86_ENDE
LABEL_LG86_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S6,2
LABEL_LG86_ENDE
;***************************************************
; ODER - Gatter -> LG87
;***************************************************

LABEL_LG87_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTC,3
	GOTO LABEL_LG87_TRUE
LABEL_LG87_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC PORTC,7
	GOTO LABEL_LG87_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG87_FALSE
	BCF S6,3
	GOTO LABEL_LG87_ENDE
LABEL_LG87_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S6,3
LABEL_LG87_ENDE
;***************************************************
; UND - Gatter -> LG88
;***************************************************

LABEL_LG88_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S6,0
	GOTO LABEL_LG88_FALSE
LABEL_LG88_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S3,6
	GOTO LABEL_LG88_FALSE
LABEL_LG88_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,5
	GOTO LABEL_LG88_FALSE

LABEL_LG88_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S9,0
	GOTO LABEL_LG88_ENDE
LABEL_LG88_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S9,0
LABEL_LG88_ENDE
;***************************************************
; UND - Gatter -> LG89
;***************************************************

LABEL_LG89_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S6,1
	GOTO LABEL_LG89_FALSE
LABEL_LG89_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S3,6
	GOTO LABEL_LG89_FALSE
LABEL_LG89_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,5
	GOTO LABEL_LG89_FALSE

LABEL_LG89_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S9,1
	GOTO LABEL_LG89_ENDE
LABEL_LG89_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S9,1
LABEL_LG89_ENDE
;***************************************************
; UND - Gatter -> LG90
;***************************************************

LABEL_LG90_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S6,2
	GOTO LABEL_LG90_FALSE
LABEL_LG90_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S3,6
	GOTO LABEL_LG90_FALSE
LABEL_LG90_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,5
	GOTO LABEL_LG90_FALSE

LABEL_LG90_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S9,2
	GOTO LABEL_LG90_ENDE
LABEL_LG90_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S9,2
LABEL_LG90_ENDE
;***************************************************
; UND - Gatter -> LG91
;***************************************************

LABEL_LG91_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S6,3
	GOTO LABEL_LG91_FALSE
LABEL_LG91_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S3,6
	GOTO LABEL_LG91_FALSE
LABEL_LG91_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,5
	GOTO LABEL_LG91_FALSE

LABEL_LG91_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S9,3
	GOTO LABEL_LG91_ENDE
LABEL_LG91_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S9,3
LABEL_LG91_ENDE
;***************************************************
; EXKLUSIVODER - Gatter -> LG92
;***************************************************

	CLRF SYS_TMP1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,0
	GOTO LABEL_LG92_1
	INCF SYS_TMP1,F

LABEL_LG92_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,4
	GOTO LABEL_LG92_2
	INCF SYS_TMP1,F

LABEL_LG92_2
	DECF SYS_TMP1,F
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC STATUS,ZERO
	BSF S7,0
	BTFSS STATUS,ZERO
	BCF S7,0
;***************************************************
; EXKLUSIVODER - Gatter -> LG93
;***************************************************

	CLRF SYS_TMP1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,1
	GOTO LABEL_LG93_1
	INCF SYS_TMP1,F

LABEL_LG93_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,5
	GOTO LABEL_LG93_2
	INCF SYS_TMP1,F

LABEL_LG93_2
	DECF SYS_TMP1,F
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC STATUS,ZERO
	BSF S7,1
	BTFSS STATUS,ZERO
	BCF S7,1
;***************************************************
; EXKLUSIVODER - Gatter -> LG94
;***************************************************

	CLRF SYS_TMP1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,2
	GOTO LABEL_LG94_1
	INCF SYS_TMP1,F

LABEL_LG94_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,6
	GOTO LABEL_LG94_2
	INCF SYS_TMP1,F

LABEL_LG94_2
	DECF SYS_TMP1,F
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC STATUS,ZERO
	BSF S7,2
	BTFSS STATUS,ZERO
	BCF S7,2
;***************************************************
; EXKLUSIVODER - Gatter -> LG95
;***************************************************

	CLRF SYS_TMP1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,3
	GOTO LABEL_LG95_1
	INCF SYS_TMP1,F

LABEL_LG95_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS PORTC,7
	GOTO LABEL_LG95_2
	INCF SYS_TMP1,F

LABEL_LG95_2
	DECF SYS_TMP1,F
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC STATUS,ZERO
	BSF S7,3
	BTFSS STATUS,ZERO
	BCF S7,3
;***************************************************
; UND - Gatter -> LG96
;***************************************************

LABEL_LG96_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S7,0
	GOTO LABEL_LG96_FALSE
LABEL_LG96_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,6
	GOTO LABEL_LG96_FALSE
LABEL_LG96_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,5
	GOTO LABEL_LG96_FALSE

LABEL_LG96_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S10,0
	GOTO LABEL_LG96_ENDE
LABEL_LG96_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S10,0
LABEL_LG96_ENDE
;***************************************************
; UND - Gatter -> LG97
;***************************************************

LABEL_LG97_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S7,1
	GOTO LABEL_LG97_FALSE
LABEL_LG97_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,6
	GOTO LABEL_LG97_FALSE
LABEL_LG97_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,5
	GOTO LABEL_LG97_FALSE

LABEL_LG97_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S10,1
	GOTO LABEL_LG97_ENDE
LABEL_LG97_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S10,1
LABEL_LG97_ENDE
;***************************************************
; UND - Gatter -> LG98
;***************************************************

LABEL_LG98_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S7,2
	GOTO LABEL_LG98_FALSE
LABEL_LG98_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,6
	GOTO LABEL_LG98_FALSE
LABEL_LG98_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,5
	GOTO LABEL_LG98_FALSE

LABEL_LG98_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S10,2
	GOTO LABEL_LG98_ENDE
LABEL_LG98_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S10,2
LABEL_LG98_ENDE
;***************************************************
; UND - Gatter -> LG99
;***************************************************

LABEL_LG99_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S7,3
	GOTO LABEL_LG99_FALSE
LABEL_LG99_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,6
	GOTO LABEL_LG99_FALSE
LABEL_LG99_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSS S3,5
	GOTO LABEL_LG99_FALSE

LABEL_LG99_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF S10,3
	GOTO LABEL_LG99_ENDE
LABEL_LG99_FALSE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BCF S10,3
LABEL_LG99_ENDE
;***************************************************
; ODER - Gatter -> LG100
;***************************************************

LABEL_LG100_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S4,0
	GOTO LABEL_LG100_TRUE
LABEL_LG100_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S8,0
	GOTO LABEL_LG100_TRUE
LABEL_LG100_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S9,0
	GOTO LABEL_LG100_TRUE
LABEL_LG100_4
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S10,0
	GOTO LABEL_LG100_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG100_FALSE
	BCF PORTD,0
	GOTO LABEL_LG100_ENDE
LABEL_LG100_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF PORTD,0
LABEL_LG100_ENDE
;***************************************************
; ODER - Gatter -> LG101
;***************************************************

LABEL_LG101_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S4,1
	GOTO LABEL_LG101_TRUE
LABEL_LG101_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S8,1
	GOTO LABEL_LG101_TRUE
LABEL_LG101_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S9,1
	GOTO LABEL_LG101_TRUE
LABEL_LG101_4
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S10,1
	GOTO LABEL_LG101_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG101_FALSE
	BCF PORTD,1
	GOTO LABEL_LG101_ENDE
LABEL_LG101_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF PORTD,1
LABEL_LG101_ENDE
;***************************************************
; ODER - Gatter -> LG102
;***************************************************

LABEL_LG102_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S4,2
	GOTO LABEL_LG102_TRUE
LABEL_LG102_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S8,2
	GOTO LABEL_LG102_TRUE
LABEL_LG102_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S9,2
	GOTO LABEL_LG102_TRUE
LABEL_LG102_4
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S10,2
	GOTO LABEL_LG102_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG102_FALSE
	BCF PORTD,2
	GOTO LABEL_LG102_ENDE
LABEL_LG102_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF PORTD,2
LABEL_LG102_ENDE
;***************************************************
; ODER - Gatter -> LG103
;***************************************************

LABEL_LG103_1
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S4,3
	GOTO LABEL_LG103_TRUE
LABEL_LG103_2
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S8,3
	GOTO LABEL_LG103_TRUE
LABEL_LG103_3
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S9,3
	GOTO LABEL_LG103_TRUE
LABEL_LG103_4
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BTFSC S10,3
	GOTO LABEL_LG103_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0

LABEL_LG103_FALSE
	BCF PORTD,3
	GOTO LABEL_LG103_ENDE
LABEL_LG103_TRUE
	BCF STATUS,RP0	; Bank 0
	BCF STATUS,RP1	; Bank 0
	BSF PORTD,3
LABEL_LG103_ENDE
;****************************************

	MOVLW HIGH MAIN
	MOVWF PCLATH

	GOTO MAIN


	END

