Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Hannibal
16
Years of Service
User Offline
Joined: 5th Mar 2007
Location:
Posted: 24th May 2023 00:06
It's a pity there's no ROL ROR command that I am aware of
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 24th May 2023 01:01 Edited at: 27th May 2023 03:57
it would be easy to code it but the issue is what type of number system your dealing with. See in assembly rol,ror rely on the state of the processor carry flag depending on what processor your coding with. 6809 is exactly like that. 68000 however does not use the carry and requires roxL roxr to do it properly if i recall. Maybe your thinking of LSL and LSR? These two commands could very easily be programmed in basic as they are simple bit shifts introducing 0's on the ends depending which way your rotating your data. ROL & ROR are kinda useless with basics numbering system.


edit: LSL & LSR

essentially all we are doing here is a division in half or a multiply by 2 for each shift....easy to code in basic.

0100 000 LSR-> 0010 000 64 now equals 32
0100 000 LSL<- 1000 000 64 now equals 128
Hannibal
16
Years of Service
User Offline
Joined: 5th Mar 2007
Location:
Posted: 24th May 2023 01:12
I think lsl and lsr are available g=g <<8 kinda ting

I think 68000 does us carry flag for that as I recall

It is really just reintroducing the carried bit in lol and rol
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 24th May 2023 01:18
learning assembly is actually allot of fun.

ya i wasn't sure if you needed the carry bit. may be complicated due to basics numbering system.
Hannibal
16
Years of Service
User Offline
Joined: 5th Mar 2007
Location:
Posted: 24th May 2023 01:24
yea would only be used in integer stuff, but should still be quite easy, and if the carry was indicated, would be a dream ! Or, not have a carry flag, but reintroduce the shifted out bit....
Kevin Picone
21
Years of Service
Recently Online
Joined: 27th Aug 2002
Location: Australia
Posted: 4th Jun 2023 05:06

Here's some functions to do 32bit ROL / ROR




PlayBASIC To HTML5/WEB - Convert PlayBASIC To Machine Code
Hannibal
16
Years of Service
User Offline
Joined: 5th Mar 2007
Location:
Posted: 7th Jun 2023 23:53
Cheers Kevin

Login to post a reply

Server time is: 2024-02-24 03:33:01
Your offset time is: 2024-02-24 03:33:01