[Coco] BASIC09 - unsigned INTEGERs?

Mark McDougall msmcdoug at iinet.net.au
Tue Feb 3 06:04:18 EST 2015


On 31/01/2015 6:33 PM, Allen Huffman wrote:

> In BASIC09, I am trying to use SYSCALL to get the size of a file. It
> returns with values in regs.X and regs.Y, which I would like to put
> together to make the actual file size.
>
> But, since regs.X and regsY are both INTEGER types, values with the high
> bit set are seen as negative numbers, and any such math is treated that
> way.

I'm perhaps showing my ignorance here but I fail to see what the fuss is 
about. You have the *correct* answer in regs.X and regs.Y. Let's forget 
about printing for the moment, since that's a completely separate problem; 
the only issue is how BASIC09 is treating those quantities. You already know 
the problem - they're two 16-bit signed integers, and it seems you can't 
change that.

So what's the issue with, for example, assigning to a real and applying the 
maths to fix it? It seems everyone here wants to take a sledgehammer to 
crack a nut!?!

Regards,

-- 
|              Mark McDougall                | "Electrical Engineers do it
|  <http://members.iinet.net.au/~msmcdoug>   |   with less resistance!"


More information about the Coco mailing list