#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2005
    Posts
    27
    Rep Power
    0

    Question 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 ) ;
  2. #2
  3. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1051
    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.
  4. #3
  5. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Originally Posted by bjr87
    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.
    programming language development: www.netytan.com Hula

  6. #4
  7. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,642
    Rep Power
    4247
    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!)
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  8. #5
  9. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Originally Posted by Scorpions4ever
    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.
    programming language development: www.netytan.com Hula

  10. #6
  11. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1051
    It's becoming less common, there hasn't been a new fortran compiler since 2001 IIRC.

    Sometimes its necessary for things to die out.

    Comments on this post

    • 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)?
  12. #7
  13. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,642
    Rep Power
    4247
    Originally Posted by LinuxPenguin
    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)
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  14. #8
  15. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1051
    Originally Posted by Scorpions4ever
    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.
  16. #9
  17. Commie Mutant Traitor
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jun 2004
    Location
    Alpharetta, GA
    Posts
    1,806
    Rep Power
    1570
    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), however.

    Ada does have a standard library for inline assembly, named System.Machine_Code, 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 for a typical example.
    Last edited by Schol-R-LEA; March 2nd, 2006 at 02:03 AM.
    Rev First Speaker Schol-R-LEA;2 JAM LCF ELF KoR KCO BiWM TGIF
    #define KINSEY (rand() % 7) λ Scheme is the Red Pill
    Scheme in Short Understanding the C/C++ Preprocessor
    Taming Python A Highly Opinionated Review of Programming Languages for the Novice, v1.1

    FOR SALE: One ShapeSystem 2300 CMD, extensively modified for human use. Includes s/w for anthro, transgender, sex-appeal enhance, & Gillian Anderson and Jason D. Poit clone forms. Some wear. $4500 obo. tverres@et.ins.gov

IMN logo majestic logo threadwatch logo seochat tools logo