0 Usuarios y 1 Visitante están viendo este tema.
;**********************************************************************;*********proyecto GIROLED *******************************************.nolist.include"m16def.inc".list.def tempo=r16.def aux=r17.def val=r18.def cont=r19.def cont1=r20.def cont3=r21.def msj=r22.org 0x00rjmp inicio1.org 0x2rjmp resetinicio1:ldi tempo,0b00000000out ddra,tempoout ddrc,tempoldi tempo,0b11111111out ddrb,tempoout portc,tempoout porta,tempoldi tempo,0b00000000out ddrd,tempoldi tempo,0b11111111out portd,tempoldi tempo,high(ramend)out sph,tempoldi tempo,low(ramend)out spl,tempo;************interrupcion**************ldi tempo,0b00000010out mcucr,tempoldi tempo,0b01000000out gicr,temposei;**************************************ldi msj,0b00000001inicio:call delaycall delaycall delaycall delaycall delaycall delaycall delaycall delaylazo1: sbid pind,6 rjmp lazo1 ;*******************************[b][/b] sbrc msj,0 call uno sbrc msj,1 call dos sbrc msj,2 call tres sbrc msj,3 call cuatro sbrc msj,4 call cinco sbrc msj,5 call seis sbrc msj,6 call siete sbrc msj,7 call ocho ;******************************* lazo:lpm val,z+cpi val,'$' breq inicio ; The beginning of the SWITCH statement cpi val,0x41 ; breq a1 cpi val,0x42 ; Compare val to 1 breq b1 cpi val,0x43 ; Compare val to 1 breq c1 cpi val,0x44; Compare val to 1 breq d1 cpi val,0x45; Compare val to 1 breq e1 cpi val,0x46 ; Compare val to 1 breq f1 cpi val,0x47 ; Compare val to 1 breq g1 cpi val,0x48 ; Compare val to 1 breq h1 cpi val,0x49 ; breq i1 cpi val,0x4A ; breq j1 cpi val,0x4B ; Compare val to 1 breq k1 cpi val,0x4C ; Compare val to 1 breq l1 cpi val,0x4D ; Compare val to 1 breq m1 cpi val,0x4E ; Compare val to 1 breq n1 cpi val,0x4F ; Compare val to 1 breq o1 cpi val,0x50 ; Compare val to 1 breq p1 cpi val,0x51 ; Compare val to 1 breq q1 cpi val,0x52 ; breq re1 cpi val,0x53 ; Compare val to 1 breq s1 cpi val,0x54 ; Compare val to 1 breq t1 cpi val,0x55 ; breq u1 cpi val,0x56 ; Compare val to 1 breq v1 cpi val,0x57 ; Compare val to 1 breq w1 cpi val,0x58 ; breq ex1 cpi val,0x59 ; Compare val to 1 breq ye1 cpi val,0x5A ; Compare val to 1 breq ze1 call delay1 rjmp lazo a1:rjmp Ab1:rjmp Bc1:rjmp Cd1:rjmp De1:rjmp Ef1:rjmp Fg1:rjmp Gh1:rjmp Hi1:rjmp Ij1:rjmp Jk1:rjmp Kl1:rjmp Lm1:rjmp Mn1:rjmp No1:rjmp Op1:rjmp Pq1:rjmp Qre1:rjmp Rs1:rjmp St1:rjmp Tu1:rjmp Uv1:rjmp Vw1:rjmp Wex1:rjmp EXye1:rjmp YEze1:rjmp ZEA:ldi aux,0b11000000out portb,auxcall delayldi aux,0b00110000out portb,auxcall delayldi aux,0b00101110out portb,auxcall delayldi aux,0b00100001out portb,auxcall delayldi aux,0b00101110out portb,auxcall delayldi aux,0b00110000out portb,auxcall delayldi aux,0b11000000out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayjmp lazoB:ldi aux,0b11111111out portb,auxcall delayldi aux,0b10001001out portb,auxcall delaycall delaycall delaycall delayldi aux,0b01110110out portb,auxcall delayldi aux,0b11000000out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoC:ldi aux,0b00111100out portb,auxcall delayldi aux,0b01000010out portb,auxcall delayldi aux,0b10000001out portb,auxcall delayldi aux,0b10000001out portb,auxcall delayldi aux,0b10000001out portb,auxcall delayldi aux,0b01000010out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoD:ldi aux,0b11111111out portb,auxcall delayldi aux,0b10000001out portb,auxcall delaycall delaycall delayldi aux,0b01000010out portb,auxcall delayldi aux,0b00111100out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoE:ldi aux,0b11111111out portb,auxcall delayldi aux,0b10001001out portb,auxcall delaycall delaycall delaycall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoF:ldi aux,0b11111111out portb,auxcall delayldi aux,0b00001001out portb,auxcall delaycall delaycall delayldi aux,0b00000001out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoG:ldi aux,0b00111100out portb,auxcall delayldi aux,0b01000010out portb,auxcall delayldi aux,0b10000001out portb,auxcall delaycall delayldi aux,0b10010001out portb,auxcall delayldi aux,0b01010010out portb,auxcall delayldi aux,0b00110100out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoH:ldi aux,0b11111111out portb,auxcall delayldi aux,0b00001000out portb,auxcall delayldi aux,0b00001000out portb,auxcall delayldi aux,0b00001000out portb,auxcall delayldi aux,0b00001000out portb,auxcall delayldi aux,0b11111111out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoI:ldi aux,0b11111111out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoJ:ldi aux,0b01100000out portb,auxcall delayldi aux,0b10000000out portb,auxcall delaycall delayldi aux,0b01111111out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoK:ldi aux,0b11111111out portb,auxcall delayldi aux,0b00010000out portb,auxcall delayldi aux,0b00001000out portb,auxcall delayldi aux,0b00011100out portb,auxcall delayldi aux,0b01100010out portb,auxcall delayldi aux,0b10000001out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoL:ldi aux,0b11111111out portb,auxcall delayldi aux,0b10000000out portb,auxcall delaycall delaycall delaycall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoM:ldi aux,0b11111111out portb,auxcall delayldi aux,0b00000110out portb,auxcall delayldi aux,0b00111000out portb,auxcall delayldi aux,0b11000000out portb,auxcall delayldi aux,0b00111000out portb,auxcall delayldi aux,0b00000110out portb,auxcall delayldi aux,0b11111111out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoN:ldi aux,0b11111111out portb,auxcall delayldi aux,0b00000010out portb,auxcall delayldi aux,0b00001100out portb,auxcall delayldi aux,0b00110000out portb,auxcall delayldi aux,0b01000000out portb,auxcall delayldi aux,0b11111111out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazo;Ñ:;ldi aux,0b11000000;out portb,aux;call delay;ldi aux,0b00110000;out portb,aux;call delay;ldi aux,0b00101110;out portb,aux;call delay;ldi aux,0b00100001;out portb,aux;call delay;ldi aux,0b00101110;out portb,aux;call delay;ldi aux,0b00110000;out portb,aux;call delay;ldi aux,0b11000000;out portb,aux;call delay;ldi aux,0b00000000;out portb,aux;call delay;call delay;retO:ldi aux,0b00111100out portb,auxcall delayldi aux,0b01000010out portb,auxcall delayldi aux,0b10000001out portb,auxcall delaycall delaycall delayldi aux,0b01000010out portb,auxcall delayldi aux,0b00111100out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoP:ldi aux,0b11111111out portb,auxcall delayldi aux,0b00010001out portb,auxcall delaycall delaycall delayldi aux,0b00001110out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoQ:ldi aux,0b00111100out portb,auxcall delayldi aux,0b01000010out portb,auxcall delayldi aux,0b10000001out portb,auxcall delayldi aux,0b10100001out portb,auxcall delaycall delayldi aux,0b01000010out portb,auxcall delayldi aux,0b10111100out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoR:ldi aux,0b11111111out portb,auxcall delayldi aux,0b00001001out portb,auxcall delaycall delayldi aux,0b00011001out portb,auxcall delayldi aux,0b01101001out portb,auxcall delayldi aux,0b10000110out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoS:ldi aux,0b01000110out portb,auxcall delayldi aux,0b10001001out portb,auxcall delaycall delayldi aux,0b10010001out portb,auxcall delaycall delayldi aux,0b01100010out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoT:ldi aux,0b00000001out portb,auxcall delaycall delayldi aux,0b11111111out portb,auxcall delayldi aux,0b00000001out portb,auxcall delaycall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoU:ldi aux,0b01111111out portb,auxcall delayldi aux,0b10000000out portb,auxcall delaycall delaycall delaycall delayldi aux,0b01111111out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoV:ldi aux,0b00000011out portb,auxcall delayldi aux,0b00001100out portb,auxcall delayldi aux,0b00110000out portb,auxcall delayldi aux,0b11000000out portb,auxcall delayldi aux,0b00110000out portb,auxcall delayldi aux,0b00001100out portb,auxcall delayldi aux,0b00000011out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoW:ldi aux,0b00000011out portb,auxcall delayldi aux,0b00111100out portb,auxcall delayldi aux,0b11000000out portb,auxcall delayldi aux,0b00110000out portb,auxcall delayldi aux,0b00001110out portb,auxcall delayldi aux,0b00000001out portb,auxcall delayldi aux,0b00001110out portb,auxcall delayldi aux,0b00110000out portb,auxcall delayldi aux,0b11000000out portb,auxcall delayldi aux,0b00111100out portb,auxcall delayldi aux,0b00000011out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoEX:ldi aux,0b10000001out portb,auxcall delayldi aux,0b01100110out portb,auxcall delayldi aux,0b00011000out portb,auxcall delayldi aux,0b01100110out portb,auxcall delayldi aux,0b10000001out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoYE:ldi aux,0b00000001out portb,auxcall delayldi aux,0b00000110out portb,auxcall delayldi aux,0b00001000out portb,auxcall delayldi aux,0b11110000out portb,auxcall delayldi aux,0b00001000out portb,auxcall delayldi aux,0b00000110out portb,auxcall delayldi aux,0b00000001out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazoZE:ldi aux,0b10000001out portb,auxcall delayldi aux,0b11000001out portb,auxcall delayldi aux,0b10110001out portb,auxcall delayldi aux,0b10001101out portb,auxcall delayldi aux,0b10000011out portb,auxcall delayldi aux,0b10000001out portb,auxcall delayldi aux,0b00000000out portb,auxcall delaycall delayrjmp lazodelay: ldi cont,60 lazo_retardo: nop dec cont brne lazo_retardo retreset: push tempo in tempo,sreg push tempo lsl msj brne salir_1 ldi msj,0b000000001 salir_1: pop tempo out sreg,tempo pop tempo retiuno: ldi zh,high(uno_tex<<1) ldi zl,low(uno_tex<<1) retdos: ldi zh,high(dos_tex<<1) ldi zl,low(dos_tex<<1) rettres: ldi zh,high(tres_tex<<1) ldi zl,low(tres_tex<<1) retcuatro: ldi zh,high(cuatro_tex<<1) ldi zl,low(cuatro_tex<<1) retcinco: ldi zh,high(cinco_tex<<1) ldi zl,low(cinco_tex<<1) retseis: ldi zh,high(seis_tex<<1) ldi zl,low(seis_tex<<1) retsiete: ldi zh,high(siete_tex<<1) ldi zl,low(siete_tex<<1) retocho: ldi zh,high(ocho_tex<<1) ldi zl,low(ocho_tex<<1) retdelay1:nop retuno_tex:.DB"EPN $ "dos_tex:.DB"MICROPROCESADORES$"tres_tex:.DB"POR M.H.C.C $"cuatro_tex:.DB"PROYECTO GIROLED CON ATMEGA$"cinco_tex:.DB"EN LOS TIEMPODS DE FLOJERA$"seis_tex:.DB"SE ALQUIL A BORRACHOS$"siete_tex:.DB" PARA TODO EVENTO SOCIAL$"ocho_tex:.DB"ARRIBA ABAJO AL CENTRO Y PA DENTRO $"