Escrito originalmente por JACKOLGAO
MI DUDA ES Q SI SE SEÑALA EL DESBORDAMIENTO TB EN EL DECREMENTO AL SOBREPASARSE HACIA ABAJO ES DECIR AL PASAR DE 00H A FFH.
A LO DE Q M CONTRADIGO SERÁ XQ M EXPLIQUÉ MAL; USO DEL PRIMER BYTE 4 BITS PARA UN DATO Y LOS OTROS 4 BITS SON LA PARTE ALTA DE UN CONTADOR
(EL OTRO BYTE ES EL RESTO DEL CONTADOR).
DE TODAS FORMAS GRACIAS TODAS.
JACKOLGAO
En realidad no hay forma de hacer lo que pretendes con una sola instrucción.
Se entendió bien, lo que quieres hacer. Tu problema está en la variable que tienes dos nibbles, uno para el contador y el otro para otra cuestión y pretendes que el PIC genere un aviso cuando el nibble inferior sea cero.
Si te fijas en el datasheet , las instrucciones DECFSZ y INCFSZ no afectan ningun bit del Status Register.
Tal vez tu pensabas en el bit DC (Digit Carry) pero este bit solo es seteado en operaciones de suma y resta.
Las instrucciones INCF y DECF afectan solo al Z, el cual estará habiltiado cuando sea totalmente 0.
En tu caso yo haría uso del ANDLW que sí afecta al Z, con un codigo como este
Codigo:
movf DIGITO,w
andlw 0x0F ;borro upper nibble
btfss STATUS,Z
goto NOESCERO
goto ESCERO
Espero haber entendido tu problemática y que esto te ayude a resolver tu problema.