[Coco] BASIC09 - unsigned INTEGERs?

Robert Gault robert.gault at att.net
Sat Jan 31 21:42:07 EST 2015


Allen Huffman wrote:
><snip>
> Neat! I tried LAND() early on to un-do the negative, but that didn’t work for getting it in to a REAL.
>
> Actually, I didn’t think it needed to be that complex. When I was Googling on how to use SYSCALL, I came across a page on my CoCopedia site someone put there. It was the SYSCALL source code from OS-9 L1 and embedded in the comments was an example of how to use it (missing one crucial line!) specifically on getting the size. In it, the just
>
> PRINT USING “‘filesize =‘,H2,H4”, regs.X, regs.Y
>
> ….or something very similar to that. Printing as HEX will show $FF00 as $FF00, though decimal shows it as a negative value.
>
> 		—A
>
>
>
>
>

You don't need to go quite that far to just print the result. If you want to do 
32-bit math you might need to separate the four bytes.
As suggested by others, conversion of the hex words to reals might get around 
the negative integers.

Robert



More information about the Coco mailing list