[comp.sys.amiga.tech] swapping bitmaps using the blitter and not using temporary space

dillon@HERMES.BERKELEY.EDU (Matt Dillon) (04/22/89)

	bitmap's A and B

	A = A ^ B
	B = B ^ A	(B = B ^ A ^ B = A)
	A = A ^ B	(A = A ^ B ^ A = B)

					-Matt

bryan@cs.utexas.edu (Bryan Bayerdorffer @ Wit's End) (04/22/89)

In article <8904212115.AA19128@hermes.berkeley.edu> dillon@HERMES.BERKELEY.EDU (Matt Dillon) writes:
=-
=-	bitmap's A and B
=-
=-	A = A ^ B
=-	B = B ^ A	(B = B ^ A ^ B = A)
=-	A = A ^ B	(A = A ^ B ^ A = B)
=-
=-					-Matt

	Or (Xor?), for that matter,

	A = A xor B
	B = A xor B
	A = A xor B

Now let's all recite swap() {a = a+b; b = a-b; a = a-b;} for the zillionth time.
:-) :-)

 ______________________________________________________________________________ 
/_____/_____/_____/_____/_____/_____/_____/_____/_____/_____/_____/_____/_____/
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|
_No dark sarcasm in the classroom|_____|_____|_____|_____|_____|_____|_____|___
|____Teachers leave the kids alone__|_____|_____|_____|_bryan@cs.utexas.edu___|
___|_____|_____|_____|_____|_____|_____|{vertebrae...}!cs.utexas.edu!bryan_|___
|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|

dillon@POSTGRES.BERKELEY.EDU (Matt Dillon) (04/25/89)

	Uh, we just said the same thing.... '^' *is* an xor.

					-Matt

:In article <8904212115.AA19128@hermes.berkeley.edu> dillon@HERMES.BERKELEY.EDU (Matt Dillon) writes:
:=-
:=-	bitmap's A and B
:=-
:=-	A = A ^ B
:=-	B = B ^ A	(B = B ^ A ^ B = A)
:=-	A = A ^ B	(A = A ^ B ^ A = B)
:=-
:=-					-Matt
:
:	Or (Xor?), for that matter,
:
:	A = A xor B
:	B = A xor B
:	A = A xor B

ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) (04/26/89)

In article <8904212115.AA19128@hermes.berkeley.edu> dillon@HERMES.BERKELEY.EDU (Matt Dillon) writes:
>	bitmap's A and B
>
>	A = A ^ B
>	B = B ^ A	(B = B ^ A ^ B = A)
>	A = A ^ B	(A = A ^ B ^ A = B)
>
	Gee, Matt, did you just discover this?  Even I knew about this one.

	Of course, it had to be spelled out to me...

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape	INET: well!ewhac@ucbvax.Berkeley.EDU
 \_ -_		Recumbent Bikes:	UUCP: pacbell > !{well,unicom}!ewhac
O----^o	      The Only Way To Fly.	      hplabs / (pronounced "AE-wack")
"Work FOR?  I don't work FOR anybody!  I'm just having fun."  -- The Doctor

jimm@amiga.UUCP (Jim Mackraz) (05/02/89)

--
I've just caught the end of this thread, but I want to say two things:

1- I actually got this question on an interview once.

2- layers.library/SwapBitsRastPortClipRect(), page A-175 of blue RKM.

	jimm
-- 
Jim Mackraz, I and I Computing	   	"He's hidden now, but you can see
{cbmvax,well,oliveb}!amiga!jimm          The bubbles where he breathes."
							- Shriekback
Opinions are my own.  Comments are not to be taken as Commodore official policy.