Helpful Information
 
 
Category: Other Programming Languages
Ada, Fortran & Java Assembler Support

Does Ada, Fortran & Java support assembly code inserts like C++ does?

Example:

(from The C++ Programming Language, Special Edition by Bjarne Stroupstrup, page 806; grammar for assembly code inserts.)

asm( string-literal ) ;

no, no idea, no.

Java will never in any case, since the whole idea is that it's bytecode and runs inside it's own little box.

Does Ada, Fortran & Java support assembly code inserts like C++ does?

Example:

(from The C++ Programming Language, Special Edition by Bjarne Stroupstrup, page 806; grammar for assembly code inserts.)

asm( string-literal ) ;

I doubt it, Ada is very similar to Java in a lot of ways but I've never used it.

Fortran on the other hand is really pretty close to assembly anyway but I don't think you can embed raw assembly in it. It should compile down into ASM so you could play with it that way?

Mark.

You can link to assembly modules from FORTRAN (yes, the CAPS are intentional). Some compilers may even allow embedded asm statements, but this construct isn't part of the standard FORTRAN language (yet!)

You can link to assembly modules from FORTRAN (yes, the CAPS are intentional). Some compilers may even allow embedded asm statements, but this construct isn't part of the standard FORTRAN language (yet!)

Fortran was originally called FORTRAN but it's much more common to write it as "Fortan" now :).


Fortran (also FORTRAN) is a computer programming language originally developed in the 1950s; it is still used for...

I had to write a paper about different programming languages a while ago.

Take care Scorpi,

Mark.

It's becoming less common, there hasn't been a new fortran compiler since 2001 IIRC.

Sometimes its necessary for things to die out.

It's becoming less common, there hasn't been a new fortran compiler since 2001 IIRC.

Sometimes its necessary for things to die out.
Actually we now have Fortran 2003. Also, my dad's workplace still uses it. Fortran still kicks butt when it comes to scientific computation (due in part to the large # of math libraries available to compute nearly anything)

Actually we now have Fortran 2003. Also, my dad's workplace still uses it. Fortran still kicks butt when it comes to scientific computation (due in part to the large # of math libraries available to compute nearly anything) Point taken, everything has it's use

>>calpol2004 disagrees: well that wouldn't be very good now would it. if the lower level languages die out, how are we going
to make higher level compilers (efficient ones)?

How many compilers do you know that compile code to fortran? Nuff said.

Why embedded assembly? Is there something you need to use assembly for that precludes linking together separate object-code files? Pretty muchd any language allows you to link to separately assembled functions. In the case of Java, you need to use the native code interface (JNI (http://java.sun.com/j2se/1.4.2/docs/guide/jni/index.html)), however.

Ada does have a standard library for inline assembly, named System.Machine_Code (http://www.adaic.org/standards/05aarm/html/AA-13-8.html), though AFAICT it's an optional library that not all implementations support. The details will vary from compiler to compiler; you can look at the GNAT documentation section on inline code (http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Inline-Assembler.html) for a typical example.










privacy (GDPR)