unsigned integers

Questions about the BASICtools and MakeItC
Post Reply
YahooArchive
Posts: 1463
Joined: Fri Oct 19, 2012 5:11 am

unsigned integers

Post by YahooArchive » Thu Oct 25, 2012 10:08 pm

>from help line
>Is there support for or a way use unsigned 32 bit integers ? I want
to be able to make the MSB be logic 1 and then shift that bit right
and have that value be interpretted as straight unsigned binary.

The philosophy of ARMbasic is to keep it simple so integers are all
signed. A simple loop to shift from the msb would be-

X = $8000000
WHILE X
' do something with X
X = X>>1 and $7FFFFFFF
LOOP

WHILEs are more efficient than FOR, and the and 0x7FFFFFFF is only 2
instructions (30 nsec).



Post Reply