Académique Documents
Professionnel Documents
Culture Documents
.def tempo=r16
.def columna=r17
.def tecla=r18
.def ante=r19
.def fila=r20
.def aux=r21
.cseg
.org 0x00
ldi tempo,0b11111111
out ddrb,tempo
out portb,tempo
ldi tempo,0b00000000
out ddrc,tempo
out ddrd,tempo
ldi tempo,0b11111111
out portc,tempo
out portd,tempo
in tempo,mcucr
andi tempo,0b11101111
out mcucr,tempo
ldi tempo,high(ramend)
out sph,tempo
ldi tempo,low(ramend)
out spl,tempo
ldi tecla,16
ldi tempo,0b11110000;(poner todas las filas a 0L)
out porta,tempo
leer:
sbis pina,5
ldi columna,1
sbis pina,6
ldi columna,2
sbis pina,7
ldi columna,3
sbis pina,4
ldi columna,0
in aux,pina
andi aux,0b11110000
cpi aux,0b11110000
breq leer
cp tecla,ante
breq otrobarrido
mov ante,tecla
cpi tecla,16
breq otrobarrido
out portb,tecla
rjmp otrobarrido