The following code works; it uses the technique from the June 2000 thread 
"setsppfp bug" in the archives, in which the SYP is passed as a 16-byte 
character variable "by value".

I changed from the _SETSPPFP builtin to the setsppfp function, because 
_SETSPPFP caused the compiler to dump.

Also, it doesn't use the names of the parms on the procedure declarations as 
variables, but defines other stand-alone variables.


     H bnddir('QC2LE')

     d MatPco          PR              *   ExtProc('_PCOPTR')

     d CrtS            PR                  ExtProc('_CRTS')
     d  PspcPtr                        *
     d  Pcrt_Tmplt                     *   value

     d SetSppFp        PR              *   ExtProc('setsppfp')
     d  PsysPtr                      16a   value

     d Crts_Tmplt      ds
...
...
     d                 ds
     d SysPtrA                 1     16a
     d SysPtr                  1     16*

     d Pco             s               *
     d PcoPtr          s               *   dim(8) based(Pco)

     d SpcPtr          s               *
     d Spc             s           4096    based(SpcPtr)

      /free

       Pco = Matpco;

       Crt_Obj_Type = x'19';
       Crt_Obj_STyp = x'34';
       Crt_Obj_Name = 'USERSPACE';
       Crt_Context = PcoPtr(5);   // QTEMP

       CrtS (SysPtr:%addr(Crts_Tmplt));  // returns a SYP to 1934USERSPACE
       SpcPtr = SetSppFp(SysPtrA);         // address to PCS

      /end-free

--Dave


On Friday 15 November 2002 06:28, Giuseppe Costagliola wrote:

>The _CRTS allows to create a (user) space in USER DOMAIN. It returns a SYP
>to this newly created object.
>
>Then _SETSPPFP should set a SPP to this space but it seems to address an
>area in the PCS instead.
>
>I've tried with procptr, redefinitions of pointers, etc. but unsuccesfully.
>
>Where am I wrong?
>
>Giuseppe Costagliola
>gcosta@sidin.it
>
>-------------------------------------------------
>
>d MatPco          PR              *   ExtProc('_PCOPTR')
>d  Pco            s               *
>d  PcoPtr         s               *   dim(8) based(Pco)
>
>d CrtS            PR                  ExtProc('_CRTS')
>d  SpcPtr                         *
>d  Crt_Tmplt                      *   value
>
>d SetSppFp        PR              *   ExtProc('_SETSPPFP')
>d  SysPtr                         *
>
>. . .
>. . .
>
>d Spc             s           4096    based(SpcPtr)
>
> /free
>
>  Pco = Matpco;
>
>  Crt_Obj_Type = x'19';
>  Crt_Obj_STyp = x'34';
>  Crt_Obj_Name = 'USERSPACE';
>  Crt_Context = PcoPtr(5);   // QTEMP
>
>  CrtS (SpcPtr:%addr(Crt_Tmplt));  // returns a SYP to 1934USERSPACE
>  SpcPtr = SetSppFp(SpcPtr);         // address to PCS
>
> /end-free



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.