;ledlight.asm ;A beginner's program ;lights up an LED on pin PORTB0 ;LED is arranged to sink current into the PORTB0 pin ;assembled using Atmel's avrasm assembler. ;the following .inc file should be placed in the same directory as ;this assembly program .include "1200def.inc" .cseg .org 0 rjmp RESET ;Reset Handle rjmp RESET rjmp RESET RESET: ldi r16, 0b11111111 ;load register r16 with all 1's out DDRB, r16 ;configure PORT B for all outputs loopit: ldi r16, 0 ;load register r16 with all 0's out PORTB, r16 ;output the contents of r16 ;on PORTB ;Thus PORTB0 pin is at logic '0' ;as well as all the other PORTB ;pins. This enables the current ;through the LED to flow into ;PORTB0 pin and the LED lights up rjmp loopit