Xref: utzoo comp.sys.amiga:26410 comp.sys.amiga.tech:2743 Path: utzoo!attcan!uunet!munnari!acp!sns From: sns@acp.OZ (Stuart Nixon) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: MINTERM_SWAP? Summary: There is an XOR trick that will swap bits... Keywords: MINTERM graphics how Message-ID: <530@acp.OZ> Date: 8 Dec 88 10:55:02 GMT References: <1576@nmtsun.nmt.edu> Organization: Australian Computer Products, Perth, Australia Lines: 31 In article <1576@nmtsun.nmt.edu>, wbnsnsr@nmtsun.nmt.edu (William Norris) writes: > Is there a simple way to swap two bitmaps without a third temporary bitmap? > > I've looked over the MINTERMS, but none seem to do the trick. How come > the lower nibble in the MINTERM is always 0? If 0xC0 is a copy, shouldn't > 0xCC be a swap? > > wbnsnsr@nmtsun.nmt.edu | /// Seulement I seem to remember a trick using three (3) XOR's to swap contents of registers. There should be no reason why the same can not be carried out on Bitmaps using the blitter. It will require three blits to carry out the swap. I have not worked out the MINTERMs to do XORs. However, if my memory serves me correctly, the logic is something like : B = A XOR B ; where A & B are regs/bitmaps/bits/whatever A = A XOR B B = A XOR B ; tada! bits swapped There may be a still quicker way of doing this with the blitter, as it has the ability to accept three inputs. Still, this should give you some ideas... Hope this helps. sns sns Stuart Nixon Software, via Australian Computer Products Phone : +61 9 322 6497 Uucp : ...{uunet,mcvax,ukc}!munnari!acp.oz!sns ACSnet: sns@acp.oz