Any idea why this code doesn't work as a 16 bit ring buffer?

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
User avatar
Blue Bill
Posts: 10
Joined: Thu Sep 27, 2012 3:37 pm
Location: Toronto

Any idea why this code doesn't work as a 16 bit ring buffer?

Post by Blue Bill » Mon May 27, 2013 5:05 pm

StatOverflow As bit
StatusFlash As word

Code: Select all

		StatOverflow = StatusFlash.15
		StatusFlash = Word(StatusFlash << 1)
		StatusFlash.0 = StatOverflow
The bits are somewhat wonky.
Blue Bill (aka BlueRoomElectronics)

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Post by Jerry Messina » Tue May 28, 2013 9:52 am

Seems to work ok here from what I see.

Can you describe "wonky"?

Oh, and what version are you using?

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Post by Jerry Messina » Tue May 28, 2013 10:19 am

If you're using the SE version, I take that back.

Both SE 2213 and 2216 seem to have issues.

Using 2216 (the latest), it appears that the shift code works properly, but there are some issues with words.

Code: Select all

StatusFlash = $0000
StatusFlash = $aaaa      // produces $00AA
StatusFlash = $8001
StatusFlash = $5555      // produces $8055
StatusFlash = $1234

User avatar
Blue Bill
Posts: 10
Joined: Thu Sep 27, 2012 3:37 pm
Location: Toronto

Post by Blue Bill » Tue May 28, 2013 2:51 pm

Thank you, thought I was seeing things :D

I think I have an old copy of Swordfish with the USB key, apparently it can be upgraded to the Si version.
Blue Bill (aka BlueRoomElectronics)

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Post by Jerry Messina » Tue May 28, 2013 3:02 pm

Great.

Not sure what version you're using, but if you install the latest release (version 2.2.1.7), things should work ok.

User avatar
Blue Bill
Posts: 10
Joined: Thu Sep 27, 2012 3:37 pm
Location: Toronto

Post by Blue Bill » Wed May 29, 2013 2:26 am

The full version fixed it. Thanks again.
Blue Bill (aka BlueRoomElectronics)

Post Reply