[Coco] How to use the syscall for mdir.

coco at jechar.ca coco at jechar.ca
Wed Apr 28 10:01:07 EDT 2021


I am trying to understand how the F$GModDr is used it seems to require
three parameters regs.x regs.y and regs.u I think I understand what is
required for regs.x but have no clue what to provide for regs.y and 
regs.u

I have included enough proposed code (below) to give a clear idea of 
what I
am trying to accomplish.

I have no clue where to go from here, can anyone help ?

  PROCEDURE pmdir

(* Demo reimplementation of mdir to ilistrate syscall use.               
*)
(* In this reimplementation 15 , 32 character lines are shown at a time. 
*)

(* F$GModDr 103F 1A
(*   ENTRY
(*          X = Pointer to 2K buffer
(*          y = End of copied module directory
(*          u = start address of system module directory.
(*

TYPE registers=cc,a,b,dp:BYTE;x,y,u:INTEGER
DIM regs:registers

(* Array to load mdir into 64*32=2K
DIM modir$(64),N$:STRING
(* It's address
DIM mat:INTEGER
DIM line:INTEGER
DIM lx,es:REAL

mat=ADDR(modir$(1))
regs.x= mat
regs.y= ???
regs.u= ???
RUN syscall($1A,regs)

line=0
REPEAT
   line=line+1
   PRINT modir$(line)
   lx=FLOAT(line)
   es=MOD(lx,15)
   IF es=0 THEN
      PRINT "Press ENTER to show next screen ";
      INPUT N$
   ENDID
UNTIL line>64

END

Charlie


More information about the Coco mailing list