

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An avr assembly language code to read values from portc and portd pins, multiply them, store the result in memory locations 0x50 and 0x51, and display the lsb byte on portb pins. It also calculates the clock cycles and delay size of the given program code.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


.org 0x ;Setting I/O register C and D for input LDI R16,0X OUT DDRC,R LDI R16,0X OUT DDRD,R ;Setting I/O register B for output LDI R16,0xFF OUT DDRB,R ;getting input from I/O ports IN R18, PINC IN R19,PIND ;multiplying the numbers and then storing R0 and R MUL R18,R ; Then copying the LSB and MSB from R0 and R1 to given adresses STS 0x50,R STS 0x51,R ;Output LSB to I/O register B OUT PORTB,R
- DEC R20 ; - BRNE LOOP1 ;2/ - DEC R21 ; - BRNE LOOP2 ;2/ - RET ;