Professional Documents
Culture Documents
; barrido teclado.asm
;
; Created: 17/06/2018 12:51:59
; Author : Mateo V�squez
;
;declaracion de variables
.def tempo = r16
.def conta = r17
.def numero_A = r18
.def numero_B = r19
.def tecla = r20
.def aux = r21
.def ante = r23
; reserva de memoria
.dseg
binario:.byte 2
bcd0: .byte 1
bcd1: .byte 1
bcd2: .byte 1
bcd3: .byte 1
dig0: .byte 1
dig1: .byte 1
dig2: .byte 1
dig3: .byte 1
num: .byte 1
valor1: .byte 1
valor2: .byte 1
valor3: .byte 1
in tempo, mcucr
andi tempo, 0b11101111
out mcucr, tempo
ldi tempo,high(ramend)
out sph,tempo
ldi tempo,low(ramend)
out spl,tempo
ldi tempo,0x00
sts binario,tempo
clr conta
ldi ante,16
inicio:
rcall binario_bcd
rcall bcd_digitos
rcall barrido_display
rcall barrido_teclas
manejo_de_datos:
lds aux,num
cpi aux,10
breq borrar
cpi aux,11
breq resultado
cpi aux,12
breq por
call acomodar
rjmp inicio
borrar:
clr tempo
;sts valor1,tempo
;sts valor2,tempo
;sts valor3,tempo
ldi xh,high(binario)
ldi xl,low(binario)
st x+,tempo
st x,tempo
clr numero_A
;clr numero_B
clr conta
clr r0
clr r1
rjmp inicio
;************* por ******************
por:
sts valor3,numero_A
clr numero_B
clr tempo
sts valor1,tempo
sts valor2,tempo
ldi xh,high(binario)
ldi xl,low(binario)
st x+,tempo
st x,tempo
clr conta
rjmp inicio
.INCLUDE "binario_bcd.asm"
.INCLUDE "bcd_digitos.asm"
.INCLUDE "barrido_display.asm"
.INCLUDE "barrido_teclas.asm"