[Coco] BASIC09 - unsigned INTEGERs?

L. Curtis Boyle curtisboyle at sasktel.net
Sat Jan 31 12:51:09 EST 2015


I am pretty sure you can assign regs.x*65536.+regs.u to a FLOAT variable and it works fineā€¦ we used to do this at work all the time.

L. Curtis Boyle
curtisboyle at sasktel.net



> On Jan 31, 2015, at 11:42 AM, Robert Gault <robert.gault at att.net> wrote:
> 
> 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
> 
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
> 



More information about the Coco mailing list