Lab Report
Lab Report
Program:
MOV AX,0000H
MOV CX,0009H
MOV AX, CX
MUL CX
HLT
d) Find the average of n numbers.
Here, (1+2+3+4+5)/5=3.
Program:
MOV AX,0000H
MOV CX,0005H
MOV BX,0005
L:
ADD AX, CX
LOOP L
DIV BX
HLT
Expt.4(a): Blinking LED using Atmega32 microcontroller (all at once).
Program:
#include <avr/io.h>
#define F_CPU 1000000UL
#include <util/delay.h>
int main(void)
{
DDRD=0xff;
while (1)
{
PORTD=0xff;
_delay_ms(1000);
PORTD=0x00;
_delay_ms(1000);
}