From The Compiler, 8 Years ago, written in x86 Assembler.
This paste is a reply to led.S from The Compiler
- go back
Embed
Viewing differences between led.S and Re: led.S
??? cat led.S                                                                                          ??[1]???
#include <avr/io.h>

#define temp r16

.global main

main:
    ldi temp, (1 << 1)
    out _SFR_IO_ADDR(DDRB), temp

loop:
    ldi temp, (1 << 1)
    out _SFR_IO_ADDR(PINB), temp ; Hardware toggle
    rcall delay
    rjmp loop

; 100ms delay loop
delay:
    ldi  r18, 5
    ldi  r19, 15
    ldi  r20, 241

delay_inner:
    dec  r20
    brne delay_inner
    dec  r19
    brne delay_inner
    dec  r18
    brne delay_inner
    nop
    ret