Yahoo Groups archive

AVR-Chat

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

Message

Re: [AVR-Chat] Re: Challenge

2005-06-09 by stevech@san.rr.com

and to swap two registers: and ye ole:

push r1

mov r1,r2�� ; r1 = r2

pop r2

more cycles than eor's

----- Original Message -----

From: Andreas Stemmer

Date: Thursday, June 9, 2005 11:28 am

Subject: Re: [AVR-Chat] Re: Challenge

> > 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
>
>
>
>
> Yahoo! Groups Links
>
> <*> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AVR-Chat/
>
> <*> To unsubscribe from this group, send an email to:
> AVR-Chat-unsubscribe@yahoogroups.com
>
> <*> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>!
>

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.