[Coco] SYSCALL syntax for BASIC09
Wayne Campbell
asa.rand at gmail.com
Thu May 7 15:21:55 EDT 2020
Hi Charlie,
I have a manual that describes OS9 Syscalls
> but it does not explain how to use them
> with Basic09.
>
> 01 PROCEDURE politekey
> 02 TYPE registers=cc,a,b,dp:BYTE;x,y,u:INTEGER
>
This should be a BYTE, not a STRING of 2 characters
> 03???DIM A:STRING[2]
> 04 DIM regs:registers
> 05 PARAM key:STRING[1]
06???A$="0A"
>
This should be the callcode for getting the register packet:
callcode=$8D
> 07 RUN GFX2("CURXY",0,0)
> 08 LOOP
> 09 RUN INKEY(key)
> 10 (* Exit LOOP/ENDLOOP on key press *)
> 11 EXITIF key<>"" THEN
> 12 ENDEXIT
> 13 (* F$Sleep call - rest of 100ms time slice. )
> 14 regs.x= 1
>
This should be regs.a, containing the path number to use: (0=stdin.
1=stdout, 2=stderrout
regs.a=1
Then regs.b defining the routine to use, these are listed in the OS-9
Manual under Chapter 8: system calls > get status system calls:
regs.b=2 (filesize routine)
15 RUN syscall(A,regs)
>
RUN syscall(callcode,regs)
> 16 RUN GFX2("CURXY",0,0)
> 17 PRINT " ";
> 18 ENDLOOP
> 19 END
>
Wayne
More information about the Coco
mailing list