[Coco] How to use the syscall for mdir.

L. Curtis Boyle curtisboyle at sasktel.net
Thu Apr 29 16:14:20 EDT 2021


The manual (original and EOU) is indeed wrong; Only register X needs to be set up for the call; Y and U are returned to the caller. Thanks for catching that; I will update the EOU manual to reflect that.
It should be mentioned, however, that module directory entries are made up of four 16 bit INTEGER values, not text. You will need additional system calls to get things like actual module names. So a better way might be to define your 2K buffer to match, with something like:
TYPE mddirentry=mddat,mdblksz,mdptr,mdlinkcount:INTEGER
DIM moddir(256):mddirentry

L. Curtis Boyle
curtisboyle at sasktel.net



> On Apr 28, 2021, at 8:01 AM, coco at jechar.ca wrote:
> 
> 
> 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
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
> 



More information about the Coco mailing list