0
votes

I am using Atmel Studio 6, I have made this small program that reads PINA inputs and outputs the two's compliment to PORTC. I was wondering how I could repeatedly do this.

ldi r17, 0xFF
out DDRC, r17
ldi r18, 0x00
out DDRA, r18
out PORTA, r18
in r16, PINA
NEG r16
out PORTC, r16

Just wondering how I would go about labelling this? I did a google search and found some things using like @@ and using @B or @F, but I have no clue how to implement this?

Can anyone lend a hand?

Cheers,

James

1

1 Answers

0
votes

Start by reading a beginner's tutorial.:

LoopBegin:
    foo r0, r1
    xor r0, r0
    rjmp LoopBegin