[Coco] _os9 call from C still not Virqing
Walter Zambotti
zambotti at iinet.net.au
Sun Apr 12 21:53:07 EDT 2020
Hi guys
trying to get this Virq counter in VRN working from C.
Looking at the asm code for tstfs2 I see this :
DvcName fcc '/Nil'
lda #UPDAT defined as 3 in OS9Defs
leax DvcName,pc
os9 I$Open
lda <PathNmbr
ldb #$80 get Virq total
os9 I$GetSttt
So my code looks like this :
int nilp = open("/Nil", 3);
if (nilp == -1) printf("Can't open Nil\n");
struct registers regs;
regs.rg_a = nilp;
regs_rg_b = 0x80;
if (_os9(I_GETSTT, ®s) == -1) printf ("Can't stat Virq total %d\n",
regs.rg_b & 0xFF);
And my code is always failing at the _os9 call with error:
240: UNIT ERROR—The specified device unit does not exist.
Not sure if I'm doing this correctly!
Any ideas?
Walter
More information about the Coco
mailing list