Documentos de Académico
Documentos de Profesional
Documentos de Cultura
G EQU 0x21
NUM EQU 0x22
menos EQU 0x23
X EQU 0x24
NUM2 EQU 0x25
NUM3 EQU 0x26
ESPACIO2 EQU 0x27
Y EQU 0x28
NUM4 EQU 0x29
NUM5 EQU 0x2A
M EQU 0x2B
NUM6 EQU 0x2C
NUM7 EQU 0x2D
NUM8 EQU 0x2E
s EQU 0x2F
NUM9 EQU 0x30
NUM10 EQU 0x31
p EQU 0x32
NUM11 EQU 0x33
NUM12 EQU 0x34
NUM13 EQU 0x35
ENTER EQU 0x36
CONT1 EQU 0x37
CONT2 EQU 0x38
CONT3 EQU 0x39
CONT4 EQU 0X3A
CONT250 EQU 0x3B
guard EQU 0x3C
guardado EQU 0x3D
Wdeward EQU 0x3E
V1X EQU 0x3F
V2X EQU 0x40
VY EQU 0x41
VTX EQU 0x42
TMP0 EQU 0x43
VRESET ORG 0X00
GOTO INICIO
CALL CONF_PTOS
CALL CONF_RX
CONF_PTOS:
BANKSEL ANSEL
CLRF ANSEL
CLRF ANSELH
BANKSEL TRISA
bcf TRISA,0
BSF TRISC,7
CLRF TRISB
BANKSEL PORTA
RETURN
CONF_RX:
BANKSEL TXSTA
MOVLW B'00000100'
MOVWF TXSTA
MOVLW D'25'
MOVWF SPBRG
CLRF SPBRGH
BANKSEL PORTA
MOVLW B'10010000'
MOVWF RCSTA
RETURN
RX_DATO:
LOQUESEA: BTFSS PIR1,RCIF
GOTO LOQUESEA
movf RCREG,W
sublw D'71'
btfsc STATUS, Z
goto check_M
movf RCREG, W
movwf G
goto check_X
check_M:
MOVF RCREG, W
SUBLW D'77'
BTFSC STATUS,Z
goto LOQUESEA
movf RCREG, W
movwf M
goto check_1
check_1:
MOVF RCREG, W
sublw D'49'
BTFSC STATUS,Z
GOTO bajar
movf RCREG, W
movwf M
goto subir
bajar: ;irse a 90 grados (mover
servo)
bcf PORTB, 4
bsf PORTB, 5
goto check_X
checar1:
MOVF S, W
SUBLW D'49'
BTFSC STATUS,Z
goto num_pos
movlw D'10'
movwf V1X
movf S, W
movwf NUM2
goto num2
num2:
call guardadito
movf P,W
SUBLW D'48'
BTFSC STATUS,Z
goto checar01
clrf V2X
movf P, W
movwf NUM3
goto sumar
checar01:
movf P,W
SUBLW D'49'
BTFSC STATUS,Z
goto checar02
movlw D'1'
movwf V2X
movf P, W
movwf NUM3
goto sumar
checar02:
movf P,W
SUBLW D'50'
BTFSC STATUS,Z
goto checar03
movlw D'2'
movwf V2X
movf P, W
movwf NUM3
goto sumar
checar03:
movf P,W
SUBLW D'51'
BTFSC STATUS,Z
goto checar04
movlw D'3'
movwf V2X
movf P, W
movwf NUM3
goto sumar
checar04:
movf P,W
SUBLW D'52'
BTFSC STATUS,Z
goto checar04
movlw D'4'
movwf V2X
movf P, W
movwf NUM3
goto sumar
checar05:
movf P,W
SUBLW D'53'
BTFSC STATUS,Z
goto checar04
movlw D'5'
movwf V2X
movf P, W
movwf NUM3
goto sumar
checar06:
movf P,W
SUBLW D'54'
BTFSC STATUS,Z
goto checar04
movlw D'6'
movwf V2X
movf P, W
movwf NUM3
goto sumar
num_neg:
call guardar
MOVF S, W
SUBLW D'48'
BTFSC STATUS,Z
goto checar1
movf S, W
movwf NUM6
goto num2
checary1:
MOVF NUM11, W
SUBLW D'49'
BTFSC STATUS,Z
goto checary2
movlw D'1'
movwf VY
movf NUM11, W
movwf NUM4
goto enter
checary2:
MOVF NUM11, W
SUBLW D'50'
BTFSC STATUS,Z
goto checary3
movlw D'2'
movwf VY
movf NUM11, W
movwf NUM4
goto enter
checary3:
MOVF NUM11, W
SUBLW D'51'
BTFSC STATUS,Z
goto checary4
movlw D'3'
movwf VY
movf NUM11, W
movwf NUM4
goto enter
checary4:
MOVF NUM11, W
SUBLW D'52'
BTFSC STATUS,Z
goto checary5
movlw D'4'
movwf VY
movf NUM11, W
movwf NUM4
goto enter
checary5:
MOVF NUM11, W
SUBLW D'53'
BTFSC STATUS,Z
goto checary6
movlw D'5'
movwf VY
movf NUM11, W
movwf NUM4
goto enter
checary6:
MOVF NUM11, W
SUBLW D'54'
BTFSC STATUS,Z
goto checary7
movlw D'6'
movwf VY
movf NUM11, W
movwf NUM4
goto enter
checary7:
MOVF NUM11, W
SUBLW D'55'
BTFSC STATUS,Z
goto checary8
movlw D'7'
movwf VY
movf NUM11, W
movwf NUM4
goto enter
checary8:
MOVF NUM11, W
SUBLW D'56'
BTFSC STATUS,Z
goto checary9
movlw D'8'
movwf VY
movf NUM11, W
movwf NUM4
goto enter
checary9:
MOVF NUM11, W
SUBLW D'57'
BTFSC STATUS,Z
goto checary3
movlw D'9'
movwf VY
movf NUM11, W
movwf NUM4
goto enter
num_neg2: call guardadito2
MOVF NUM11, W
SUBLW D'48'
BTFSC STATUS,Z
goto checary1
movf NUM11, W
movwf NUM4
goto enter
goto motores
motores:
dec: decf VTX
bsf PORTB, 2
call retardo
btfsc STATUS,Z
goto dec
goto MY
RETURN
;es con la diagonal el enter (/)