HP110 FORTRAN / MASM Problem
|
04-24-2024, 04:49 PM
Post: #1
|
|||
|
|||
HP110 FORTRAN / MASM Problem
Hi,
i have MS Fortran 3.31 and MASM 3.0 running on my HP110. I like to call a assembler proc from Fortran. I have already read several hours manuals from MS, but it does not work as expected. I have a working sunposition algorithm in Fortran on the HP110 and like to fetch the time from the dos with bios interrupts with the asm proc. The external proc is defined in the fortran code like this: PHP Code: interface to integer*4 function getdate(ii) The assembler source is just in test state nd does nothing and looks like this: PHP Code: .8086 link sunpos.obj date.obj or link sunpos,,,date.lib have always the same error : unresolved externals. So there must be a problem in my definition of Fortran or ASM source. Can anyone help? Ralf /41/48/ |
|||
04-25-2024, 10:52 AM
Post: #2
|
|||
|
|||
RE: HP110 FORTRAN / MASM Problem
Ralf,
you might want to a) declare the function as PUBLIC in the assembler code, b) change the name GETDATE to upper case, c) make sure that the stack is cleaned up properly in the assembler routine, e.g. by a RET 4 instruction as there is only one parameter to the function GETDATE. Best to follow the examples in the manual before starting into something more complex. Martin |
|||
04-28-2024, 09:27 AM
(This post was last modified: 05-01-2024 01:12 PM by Martin Hepperle.)
Post: #3
|
|||
|
|||
RE: HP110 FORTRAN / MASM Problem
Ralf,
attached are some working examples using FORTRAN 3.31, Pascal 3.31, Quick Basic 4.5 and Quick C 2.5 for the main program and implementing some functions and subroutines in an assembler module. The code simply follows the calling conventions explained in the manuals. The assembler module is always the same. I noted that the available archives containing Microsoft FORTRAN 3.31 seem to be based on an installed copy and include a few files which were not part of the original distribution (e.g. EGA... stuff and GRAPHICS.LIB and SUPPORT.LIB). The early Microsoft FORTRANs up to 3.x were based on the CP/M versions and they were closely related to the Pascal compiler (in fact both compilers use the same back ends PAS2 and PAS3). The manual states that the FORTRAN compiler itself was written in Pascal. Later versions, starting with 4.0, were obviously largely rewritten and differ in command line parameters and such. Version 5.1 was the last of this line and works very well together with "C" 5.1, MASM 5.1, as well as compiled BASIC. Martin |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)