HP3000-L Archives

April 2000, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
James Muro <[log in to unmask]>
Reply To:
James Muro <[log in to unmask]>
Date:
Wed, 12 Apr 2000 12:15:41 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (59 lines)
I'm not having any luck writing a switch stub for passing a real
number from cm pascal/v to nm c/ix. The c code doesn't get the number
or change the number (via the parameter list). It looked easy enough
in the manuals, although, I'm not that experienced in either pascal or c.
Thanks - Jim

1. source for pascal/v (version hp32106 a.01.32):

   $segment 'TESTLIB', subprogram$
   PROGRAM x;
   TYPE
    smlint = -32768..32767;
   FUNCTION HPSWTONMNAME : INTEGER; INTRINSIC;
   PROCEDURE testfunc  (VAR X1 : real);
    VAR
     returnstat: INTEGER;
     procname: PACKED ARRAY [1..8] OF CHAR;
     procnamelen: smlint;
     libname: PACKED ARRAY [1..8] OF CHAR;
     libnamelen: smlint;
     numparms: smlint;
     arglistarray: ARRAY [1..1] OF smlint;
     argdescary: ARRAY [1..1] OF smlint;
     functype: smlint;
    BEGIN
     X1 := 2.2;
     procname := 'testfunc';
     procnamelen := 8;
     libname := 'SWXLR';
     libnamelen := 5;
     numparms := 1;
     functype := 0;
     arglistarray[1] := BADDRESS (X1);
     argdescary[1] := 5;
     returnstat := HPSWTONMNAME (procname, procnamelen,
     libname, libnamelen, numparms, arglistarray, argdescary, functype);
    END;
    BEGIN
    END.

2. source for c/ix (version hp31506 a.05.10, compiled with ;info="-Aa"):

   /* all header files included, just not listed */
   #pragma intrinsic HPFPCONVERT
   void testfunc(float *x1)
   {
    float x2;
    short sformat,dformat;
    sformat=1;
    dformat=3;
    HPFPCONVERT(&x1,&x2,sformat,dformat);
    printf("parm rec'd = %f\n",x2);
    x2=3.3;
    sformat=3;
    dformat=1;
    HPFPCONVERT(&x2,&x1,sformat,dformat);
    return;
   }

ATOM RSS1 RSS2