hola gente del foro , tengo un problema con el siguiente programa , es un programa que modifique ( aclaro que mi conocimiento de programacion en asm es super basico , aprendido de chusmear en los foros y leer mucho en internet ) este programa estaba armado y funcionando en un pic 16f84a ,el programa original controlaba 3 pulsadores que manejaban 3 leds cada pulsador , cuando se preciona el pulsador 1 , prende el led 1 , pulsa nuevamente , prende led 2 , pulsa nuevamente , prende led 3 , pulsa nuevamente , apaga los 3 leds , eso hace cada pulsador con sus respectivos leds, yo lo modifique para pasarlo a un pic 16f877a , y agregar un total de 8 pulsadores con 3 leds cada uno, basicamente lo que hice fue duplicar y modificar las sentencias para cada pulsador con sus respectivos leds , ( nada del otro mundo ) , bien el tema es que funciona todo genial menos el ultimo boton que en el programa se encuentra en la ultima pocicion ( al final ) es la sentencia NTRI , si voy precionando los otros pulsadores prenden sus leds perfectos , pero cuando pulso el pulsador NTRI me apaga todos los leds de los otros pulsadores , ahora bien , si copio toda la sentencia de NTRI y la pego al principio del programa , la sentencia NTRI funciona perfecta , eso me dice que la sentencia completa esta bien , pero deja de funcionar la sentencia que quedo en el final y hace lo que hacia la sentencia NTRI cuando estaba en ese lugar , es como que todo el programa esta perfecto pero la ultima posicion del programa tiene algun problema y no se ejecuta , por favor les pido si pueden dar un vistazo y decirme en que me estoy equivocando , se los agradezco , aca les dejo el programa
processor 16F877A
#include <P16F877A.INC>
;__config _CP_OFF & _PWRTE_OFF & _WDT_OFF & _XT_OSC ; 0x3FF9
LRAM_0x0C equ 0x20
LRAM_0x0D equ 0x21
LRAM_18 equ 0x22
LRAM_0x0F equ 0x23
LRAM_0x10 equ 0x24
LRAM_17 equ 0x25
LRAM_16 equ 0X26
LRAM_15 equ 0x27
LRAM_DO equ 0x28
LRAM_TRI equ 0x29
Org 0x0000
GOTO LADR_0x0005
;Org 0x0005
LADR_0x0005
BSF STATUS,RP0
MOVLW 0x11
MOVWF PORTA
MOVLW 0x08
MOVWF PORTB
MOVLW 0x88
MOVWF PORTC
MOVLW 0x88
MOVWF PORTD
MOVLW 0x04
MOVWF PORTE
MOVLW 0X06
MOVWF ADCON1
BCF STATUS,RP0
CLRF LRAM_0x0C
CLRF LRAM_0x0D
CLRF LRAM_18
CLRF LRAM_17
CLRF LRAM_16
CLRF LRAM_15
CLRF LRAM_DO
CLRF LRAM_TRI
CLRF PORTA
CLRF PORTB
CLRF PORTC
CLRF PORTD
CLRF PORTE
LADR_0x000F
BTFSS PORTA,0
GOTO N20
BTFSS PORTA,4
GOTO N19
BTFSS PORTE,2
GOTO N18
BTFSS PORTC,3
GOTO N17
BTFSS PORTD,3
GOTO N16
BTFSS PORTC,7
GOTO N15
BTFSS PORTD,7
GOTO NDO
BTFSS PORTB,3
GOTO NTRI
GOTO LADR_0x000F
N20
CALL LADR_0x006A
LADR_0x0017
BTFSS PORTA,0
GOTO LADR_0x0017
CALL LADR_0x006A
INCF LRAM_0x0C,F
MOVLW 0x04
SUBWF LRAM_0x0C,W
BTFSS STATUS,Z
GOTO LADR_0x0020
GOTO LADR_0x0021
LADR_0x0020
GOTO LADR_0x0026
LADR_0x0021
BCF PORTA,1
BCF PORTA,2
BCF PORTA,3
CLRF LRAM_0x0C
GOTO LADR_0x000F
LADR_0x0026
MOVF LRAM_0x0C,W
ADDWF PCL,F
GOTO LADR_0x000F
GOTO LADR_0x002C
GOTO LADR_0x002E
GOTO LADR_0x0030
LADR_0x002C
BSF PORTA,1
GOTO LADR_0x000F
LADR_0x002E
BSF PORTA,2
GOTO LADR_0x000F
LADR_0x0030
BSF PORTA,3
GOTO LADR_0x000F
N19
CALL LADR_0x006A
LADR_0x0033
BTFSS PORTA,4
GOTO LADR_0x0033
CALL LADR_0x006A
INCF LRAM_0x0D,F
MOVLW 0x04
SUBWF LRAM_0x0D,W
BTFSS STATUS,Z
GOTO LADR_0x003C
GOTO LADR_0x003D
LADR_0x003C
GOTO LADR_0x0042
LADR_0x003D
BCF PORTA,5
BCF PORTE,0
BCF PORTE,1
CLRF LRAM_0x0D
GOTO LADR_0x000F
LADR_0x0042
MOVF LRAM_0x0D,W
ADDWF PCL,F
GOTO LADR_0x000F
GOTO LADR_0x0048
GOTO LADR_0x004A
GOTO LADR_0x004C
LADR_0x0048
BSF PORTA,5
GOTO LADR_0x000F
LADR_0x004A
BSF PORTE,0
GOTO LADR_0x000F
LADR_0x004C
BSF PORTE,1
GOTO LADR_0x000F
N18
CALL LADR_0x006A
LADR_118
BTFSS PORTE,2
GOTO LADR_118
CALL LADR_0x006A
INCF LRAM_18,F
MOVLW 0x04
SUBWF LRAM_18,W
BTFSS STATUS,Z
GOTO LADR_218
GOTO LADR_318
LADR_218
GOTO LADR_418
LADR_318
BCF PORTC,0
BCF PORTC,1
BCF PORTC,2
CLRF LRAM_18
GOTO LADR_0x000F
LADR_418
MOVF LRAM_18,W
ADDWF PCL,F
GOTO LADR_0x000F
GOTO LADR_518
GOTO LADR_618
GOTO LADR_718
LADR_518
BSF PORTC,0
GOTO LADR_0x000F
LADR_618
BSF PORTC,1
GOTO LADR_0x000F
LADR_718
BSF PORTC,2
GOTO LADR_0x000F
N17
CALL LADR_0x006A
LADR_117
BTFSS PORTC,3
GOTO LADR_117
CALL LADR_0x006A
INCF LRAM_17,F
MOVLW 0x04
SUBWF LRAM_17,W
BTFSS STATUS,Z
GOTO LADR_217
GOTO LADR_317
LADR_217
GOTO LADR_417
LADR_317
BCF PORTD,0
BCF PORTD,1
BCF PORTD,2
CLRF LRAM_17
GOTO LADR_0x000F
LADR_417
MOVF LRAM_17,W
ADDWF PCL,F
GOTO LADR_0x000F
GOTO LADR_517
GOTO LADR_617
GOTO LADR_717
LADR_517
BSF PORTD,0
GOTO LADR_0x000F
LADR_617
BSF PORTD,1
GOTO LADR_0x000F
LADR_717
BSF PORTD,2
GOTO LADR_0x000F
N16
CALL LADR_0x006A
LADR_116
BTFSS PORTD,3
GOTO LADR_116
CALL LADR_0x006A
INCF LRAM_16,F
MOVLW 0x04
SUBWF LRAM_16,W
BTFSS STATUS,Z
GOTO LADR_216
GOTO LADR_316
LADR_216
GOTO LADR_416
LADR_316
BCF PORTC,4
BCF PORTC,5
BCF PORTC,6
CLRF LRAM_16
GOTO LADR_0x000F
LADR_416
MOVF LRAM_16,W
ADDWF PCL,F
GOTO LADR_0x000F
GOTO LADR_516
GOTO LADR_616
GOTO LADR_716
LADR_516
BSF PORTC,4
GOTO LADR_0x000F
LADR_616
BSF PORTC,5
GOTO LADR_0x000F
LADR_716
BSF PORTC,6
GOTO LADR_0x000F
N15
CALL LADR_0x006A
LADR_115
BTFSS PORTC,7
GOTO LADR_115
CALL LADR_0x006A
INCF LRAM_15,F
MOVLW 0x04
SUBWF LRAM_15,W
BTFSS STATUS,Z
GOTO LADR_215
GOTO LADR_315
LADR_215
GOTO LADR_415
LADR_315
BCF PORTD,4
BCF PORTD,5
BCF PORTD,6
CLRF LRAM_15
GOTO LADR_0x000F
LADR_415
MOVF LRAM_15,W
ADDWF PCL,F
GOTO LADR_0x000F
GOTO LADR_515
GOTO LADR_615
GOTO LADR_715
LADR_515
BSF PORTD,4
GOTO LADR_0x000F
LADR_615
BSF PORTD,5
GOTO LADR_0x000F
LADR_715
BSF PORTD,6
GOTO LADR_0x000F
NDO
CALL LADR_0x006A
LADR_DO
BTFSS PORTD,7
GOTO LADR_DO
CALL LADR_0x006A
INCF LRAM_DO,F
MOVLW 0x04
SUBWF LRAM_DO,W
BTFSS STATUS,Z
GOTO LADR_2DO
GOTO LADR_3DO
LADR_2DO
GOTO LADR_4DO
LADR_3DO
BCF PORTB,0
BCF PORTB,1
BCF PORTB,2
CLRF LRAM_DO
GOTO LADR_0x000F
LADR_4DO
MOVF LRAM_DO,W
ADDWF PCL,F
GOTO LADR_0x000F
GOTO LADR_5DO
GOTO LADR_6DO
GOTO LADR_7DO
LADR_5DO
BSF PORTB,0
GOTO LADR_0x000F
LADR_6DO
BSF PORTB,1
GOTO LADR_0x000F
LADR_7DO
BSF PORTB,2
GOTO LADR_0x000F
NTRI
CALL LADR_0x006A
LADR_NTRI
BTFSS PORTB,3
GOTO LADR_NTRI
CALL LADR_0x006A
INCF LRAM_TRI,F
MOVLW 0x04
SUBWF LRAM_TRI,W
BTFSS STATUS,Z
GOTO LADR_2TRI
GOTO LADR_3TRI
LADR_2TRI
GOTO LADR_4TRI
LADR_3TRI
BCF PORTB,4
BCF PORTB,5
BCF PORTB,6
CLRF LRAM_TRI
GOTO LADR_0x000F
LADR_4TRI
MOVF LRAM_TRI,W
ADDWF PCL,F
GOTO LADR_0x000F
GOTO LADR_5TRI
GOTO LADR_6TRI
GOTO LADR_7TRI
LADR_5TRI
BSF PORTB,4
GOTO LADR_0x000F
LADR_6TRI
BSF PORTB,5
GOTO LADR_0x000F
LADR_7TRI
BSF PORTB,6
GOTO LADR_0x000F
LADR_0x006A
CLRF LRAM_0x0F
MOVLW 0x41
MOVWF LRAM_0x10
LADR_0x006D
DECFSZ LRAM_0x0F,F
GOTO LADR_0x006D
DECFSZ LRAM_0x10,F
GOTO LADR_0x006D
RETURN
End