INCLUDE "16F628A.INC"
RAM_START EQU 00020h
RAM_END EQU 0014Fh
RAM_BANKS EQU 00003h
BANK0_START EQU 00020h
BANK0_END EQU 0007Fh
BANK1_START EQU 000A0h
BANK1_END EQU 000EFh
BANK2_START EQU 00120h
BANK2_END EQU 0014Fh
EEPROM_START EQU 02100h
EEPROM_END EQU 0217Fh
R0 EQU RAM_START + 000h
R1 EQU RAM_START + 002h
R2 EQU RAM_START + 004h
R3 EQU RAM_START + 006h
R4 EQU RAM_START + 008h
R5 EQU RAM_START + 00Ah
R6 EQU RAM_START + 00Ch
R7 EQU RAM_START + 00Eh
R8 EQU RAM_START + 010h
FLAGS EQU RAM_START + 012h
GOP EQU RAM_START + 013h
RM1 EQU RAM_START + 014h
RM2 EQU RAM_START + 015h
RR1 EQU RAM_START + 016h
RR2 EQU RAM_START + 017h
_peter EQU RAM_START + 018h
_raton EQU RAM_START + 019h
_salto EQU RAM_START + 01Ah
_PORTL EQU PORTB
_PORTH EQU PORTA
_TRISL EQU TRISB
_TRISH EQU TRISA
#define _x1 _PORTB??0
#define _x2 _PORTB??1
#define _x3 _PORTB??2
#define _x4 _PORTB??3
#define _x5 _PORTB??4
#define _x6 _PORTB??5
#define _x7 _PORTB??6
#define _x8 _PORTB??7
#define _x9 _PORTA??0
#define _y1 _PORTA??1
#define _y2 _PORTA??2
#define _y3 _PORTA??3
#define _rutbot _PORTA??6
#define _PORTB??0 PORTB, 000h
#define _PORTB??1 PORTB, 001h
#define _PORTB??2 PORTB, 002h
#define _PORTB??3 PORTB, 003h
#define _PORTB??4 PORTB, 004h
#define _PORTB??5 PORTB, 005h
#define _PORTB??6 PORTB, 006h
#define _PORTB??7 PORTB, 007h
#define _PORTA??0 PORTA, 000h
#define _PORTA??1 PORTA, 001h
#define _PORTA??2 PORTA, 002h
#define _PORTA??3 PORTA, 003h
#define _PORTA??6 PORTA, 006h
#define _PORTA??7 PORTA, 007h
INCLUDE "LEDCUB~1.MAC"
INCLUDE "PBPPIC14.LIB"
MOVE?CB 007h, CMCON
MOVE?CB 000h, TRISA
MOVE?CB 000h, TRISB
HIGH?T _PORTA??7
PAUSE?C 001F4h
LOW?T _PORTA??7
PAUSE?C 001F4h
LABEL?L _subbaja
MOVE?CB 0FFh, PORTB
MOVE?CB 003h, PORTA
GOSUB?L _tsb
GOSUB?L _comprobar
MOVE?CB 0FFh, PORTB
MOVE?CB 005h, PORTA
GOSUB?L _tsb
GOSUB?L _comprobar
MOVE?CB 0FFh, PORTB
MOVE?CB 009h, PORTA
GOSUB?L _tsb
GOSUB?L _comprobar
MOVE?CB 0FFh, PORTB
MOVE?CB 005h, PORTA
GOSUB?L _tsb
GOSUB?L _comprobar
MOVE?CB 0FFh, PORTB
MOVE?CB 003h, PORTA
GOSUB?L _tsb
GOSUB?L _comprobar
GOTO?L _subbaja
LABEL?L _tsb
PAUSE?C 0C8h
RETURN?