Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Re: Challenge

2005-06-09 by Andreas Stemmer

> How do you swap the contents of 2 registers without using any other
> registers or
> stack?

How about this one?

A = A + B
B = A - B
A = A - B

but I don't know how to do the second step in assembler...

Another solution:

eor r1, r2
eor r1, r2
eor r1, r2

should work... but I can't prove it

Andreas
-- 
Andreas Stemmer <groovingandi@gmx.de>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.