[Coco] BASIC09 - unsigned INTEGERs?
Allen Huffman
alsplace at pobox.com
Sun Feb 1 08:55:50 EST 2015
> On Feb 1, 2015, at 7:45 AM, K. Pruitt <pruittk at roadrunner.com> wrote:
>
> This is from the rainbow mag and it does print the correct value:
>
> PROCEDURE filesize
> TYPE Registers=CC,A,B,DP:BYTE; X,Y,U:INTEGER
> DIM regs:Registers
> DIM path,callcode:BYTE
> OPEN #path,"test":READ
> callcode=$8D
> regs.A:=path
> regs.B=$02
> RUN SysCall(callcode,regs)
> CLOSE #path
> PRINT USING "'Filesize = $',2(h4)",regs.X; regs.U
>
> I created a file with a size of 92324 bytes and it prints out the correct value of 000168A4.
>
> I guess the real question now is how do we get this result in to a variable.
Right. That code there is the example from the SYSCALL source code, apparently, from the OS-9 Level 1 days.
http://www.cocopedia.com/wiki/index.php/SysCall.asm_Level_1 <http://www.cocopedia.com/wiki/index.php/SysCall.asm_Level_1>
— A
More information about the Coco
mailing list