Even when you have reconciled calling conventions, naming conventions, and methods of data exchange, you must still be concerned with data types, because each language handles them differently. The following table lists the equivalent data types among Fortran, C, and MASM:
Fortran Data Type | C Data Type | MASM Data Type |
---|---|---|
REAL(4) |
float |
REAL4 |
REAL(8) |
double |
REAL8 |
REAL(16) |
--- |
--- |
CHARACTER(1) |
unsigned char |
BYTE |
CHARACTER*(*) |
||
COMPLEX(4) |
struct complex4 { |
COMPLEX4 STRUCT 4 |
COMPLEX(8) |
struct complex8 { |
COMPLEX8 STRUCT 8 |
COMPLEX(16) |
--- |
--- |
All LOGICAL types |
Use integer types for C, MASM |
|
INTEGER(1) |
char |
.sbyte |
INTEGER(2) |
short |
.sword |
INTEGER(4) |
int |
.sdword |
INTEGER(8) |
_int64 |
.qword |
The following sections describe how to reconcile data types between the different languages: