Micro Focus CALL-CONVENTION 8 doesn't seem to work 
Author Message
 Micro Focus CALL-CONVENTION 8 doesn't seem to work

I have some assembler routines I wish to link statically (LITLINK) within a
program, but must let the COBOL routines link dynamically so that I can
animate the modules.  I have coded the CALL-CONVENTION EXACTLY as shown in
the manual, but I cannot get the assembler routines to link statically
unless I preface the name with two underscore characters.

SPECIAL-NAMES.
    CALL-CONVENTION 8 IS LITLINKED.
          .
          .
    CALL LITLINKED 'ASMPROG' USING ...  (Compiles as dynamic call)

    CALL '__ASMPROG' USING...           (Compiles as static call)

What am I doing wrong?  This is MF 3.2.20 compiler...

Thanks.

Kevin Hansen



Fri, 02 Apr 1999 03:00:00 GMT  
 Micro Focus CALL-CONVENTION 8 doesn't seem to work

Quote:

> I have some assembler routines I wish to link statically (LITLINK) within a
> program, but must let the COBOL routines link dynamically so that I can
> animate the modules.  I have coded the CALL-CONVENTION EXACTLY as shown in
> the manual, but I cannot get the assembler routines to link statically
> unless I preface the name with two underscore characters.

> SPECIAL-NAMES.
>     CALL-CONVENTION 8 IS LITLINKED.
>           .
>           .
>     CALL LITLINKED 'ASMPROG' USING ...  (Compiles as dynamic call)

>     CALL '__ASMPROG' USING...           (Compiles as static call)

> What am I doing wrong?  This is MF 3.2.20 compiler...

Hi Kevin.

You're doing nothing wrong, but I can explain why you are seeing what you're
seeing.

1) Any CALL LITLINKED "name" call will cause the code generator to add a leading
   underscore to "name", as the assumption is that any global (callable) symbol
   names will begin with an underscore (C compilers will prefix any external
   symbols with an underscore too - if we didn't do this, you could not call
   C from COBOL (and that includes most of the CBL_ and PC_ calls!)).

2) CALL "__name" causes the code generator to drop into a compatibility mode for
   the 16-bit product before CALL CONVENTIONs existed - any double-underscore
   prefixed name implied litlinking and also the removal of the underscores.

I'm not sure what I would suggest as the best fix. Maybe you can either change
your ASM code to have a leading underscore or, if that is not possible or
desirable, have a simple glue layer in assembler that is just a bunch of
"_name" symbols which simply jump to "name" ?

Theoretically, it would be possible to have a call convention that specifies the
name should be taken absolutely literally, but to use that the knowledge of what
language the routine is written in would have to be placed in the COBOL source.
I think that would be undesirable.

Cheers, Kev.

--

These views are strictly my own. I doubt that anyone else would want them.
STUFF FOR SALE: <A HREF="http://ds.dial.pipex.com/kevin.digweed/">Here!</A>



Mon, 05 Apr 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. expect's full_buffer doesn't seem to work

2. set VIDEO_MODE_RESTRICTION=CGA doesn't seem to work

3. ios.gets doesn't seem to work as advertised

4. setting LD_LIBRARY_PATH doesn't seem to work?

5. proc doesn't seem to work in NASM

6. Adagide install doesn't seem to work?

7. Temporarily changing error_reporting()...doesn't seem to work

8. problem with exec: import doesn't seem to work

9. ldap.modify_s doesn't seem to work

10. update doesn't seem to work with scale

11. Micro Focus 2.4.38 EXTFH and Micro Focus 3.1.35 compiler

12. BLT installs but doesn't work, and TkTable doesn't build

 

 
Powered by phpBB® Forum Software