Re: Need XOR solution
Re: Need XOR solution
- Subject: Re: Need XOR solution
- From: email@hidden (Michael Sullivan)
- Date: Thu, 8 Aug 2002 12:06:43 -0400
- Organization: Society for the Incurably Pompous
Marc K. Myers writes:
>
That's perfectly clear, with just the needed depth of explanation. I
>
understood the comparison of the modulated numbers as the actual
>
extraction of the XORed result, but the addition of 256 when it was true
>
threw me. Your explanation of the use of the extra left-hand bit and
>
how it rotates back to the rightmost position cleared that up for me.
>
You think like an assembly language programmer. Thanks, Nigel.
Heh. As someone who's done some assembly a very long time ago, it's
absolutely galling that this requires 25 AS numeric instructions (17
with the optimization Nigel mentions later) and a loop construct to do
something that works out to only 1/4 of a processor instruction. (1 XOR
and 3 overhead instructions to get the info in and out of the registers
-- since a G4 has 128 bit words you could be doing 16 bytes at a time
that way, so a single 8-bit byte takes only 1/4 of a processor
instruction).
But given AS limitations (no bitwise operations), it's definitely the
way an assembly programmer would solve the problem. I would've used
pretty much the same algorithm, but N.G. beat me to it.
Michael
--
Michael Sullivan
Business Card Express of CT Thermographers to the Trade
Cheshire, CT email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.