[Coco] BASIC09 - unsigned INTEGERs?

Robert Gault robert.gault at att.net
Sat Jan 31 12:42:39 EST 2015


Robert Gault wrote:
> 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.
>>

Here is an example that will at least print the answer. Doing comparisons with 
the result would be more complex.


TYPE registers=cc,a,b,dp:BYTE; x,y,u:INTEGER
DIM regs:registers
DIM hx,lx,hu,lu:BYTE
regs.x=$FE47
regs.u=$CF39
hx=LAND(regs.x,65280)/256
lx=LAND(regs.x,255)
hu=LAND(regs.u,65280)/256
lu=LAND(regs.u,255)
PRINT"$";
PRINT USING "h2",hx;lx;hu;lu

RUN
$FE47CF39

Cumbersome but the value printed is correct.

Robert



More information about the Coco mailing list