Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Phoenix Edition v3.1 released!
#12
(09-04-2022, 06:59 PM)bplus Wrote:
(09-04-2022, 05:53 PM)OldMoses Wrote:
(09-04-2022, 04:59 PM)bplus Wrote: Wow nice list of improvements. What is difference between shift left / right and rotate left /right?

shifts will drop bits from the end shifted toward. Rotate will carry those bits around to the opposite end.

Thanks, OK left and right shifts mult or divide by 2, what does rotate do?

I can recall, from back in the days when I attempted to fool with Assembly, that most CPU's had ROL & ROR in their instruction set. Also known as 'circular shifting' or 'rotate no carry'. However, I can't recall ever using it. The mathematics of doing it is pretty squirrely, and I can't for the life of me think of a mathematical application. I can't find much on the net about it, other than what it is. I found a mention on wikipedia that it is used frequently in cryptography. Not surprising given the arcane nature of that pursuit. I can imagine a simple encryption scheme of using a key array to rotate character bytes in certain order, to scramble them up and then reversing the order to unscramble them, but I'm sure its use is far more sophisticated than my kindergarden encryption ideas.

A lot of languages don't have native support for circular shifting, requiring the writing of appropriate functions, so now QB64PE has something to distinguish it from the rest of the rabble. Perhaps someone can discuss why it was added.

You can rotate 0 & -1 in either direction until the cows fly in to roost and they will remain 0 & -1, respectively.

It will act very much like _SHL & _SHR until a set bit crosses the MSB/LSB boundary and signs will flip (unless you're working with unsigned variables) and all sorts of weird fun commences.
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
Reply


Messages In This Thread
Phoenix Edition v3.1 released! - by SMcNeill - 09-04-2022, 02:46 AM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-04-2022, 03:26 AM
RE: Phoenix Edition v3.1 released! - by bplus - 09-04-2022, 04:59 PM
RE: Phoenix Edition v3.1 released! - by OldMoses - 09-04-2022, 05:53 PM
RE: Phoenix Edition v3.1 released! - by bplus - 09-04-2022, 06:59 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-04-2022, 08:31 PM
RE: Phoenix Edition v3.1 released! - by OldMoses - 09-05-2022, 01:32 AM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-04-2022, 06:18 PM
RE: Phoenix Edition v3.1 released! - by Coolman - 09-04-2022, 06:28 PM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-05-2022, 12:19 AM
RE: Phoenix Edition v3.1 released! - by Coolman - 09-05-2022, 10:45 AM
RE: Phoenix Edition v3.1 released! - by Gets - 09-05-2022, 01:31 AM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-05-2022, 02:05 AM
RE: Phoenix Edition v3.1 released! - by Coolman - 09-05-2022, 02:02 PM
RE: Phoenix Edition v3.1 released! - by OldMoses - 09-05-2022, 03:19 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-05-2022, 04:13 PM
RE: Phoenix Edition v3.1 released! - by a740g - 09-05-2022, 04:44 PM
RE: Phoenix Edition v3.1 released! - by Ikerkaz - 09-05-2022, 02:08 PM
RE: Phoenix Edition v3.1 released! - by Coolman - 09-05-2022, 06:09 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-05-2022, 06:29 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-05-2022, 11:25 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-06-2022, 08:37 PM
RE: Phoenix Edition v3.1 released! - by mnrvovrfc - 09-08-2022, 03:54 AM
RE: Phoenix Edition v3.1 released! - by bert22306 - 09-05-2022, 10:00 PM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-06-2022, 01:38 AM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-06-2022, 02:44 AM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-06-2022, 05:24 PM
RE: Phoenix Edition v3.1 released! - by SMcNeill - 09-06-2022, 04:43 AM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-06-2022, 05:49 PM
RE: Phoenix Edition v3.1 released! - by Gets - 09-07-2022, 04:01 PM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-08-2022, 10:01 AM
RE: Phoenix Edition v3.1 released! - by a740g - 09-10-2022, 07:10 PM
RE: Phoenix Edition v3.1 released! - by Stuart - 09-10-2022, 11:26 PM



Users browsing this thread: 1 Guest(s)