Shop OBEX P1 Docs P2 Docs Learn Events
java byte code to SX48AC native instructions — Parallax Forums

java byte code to SX48AC native instructions

cmccmc Posts: 4
edited 2005-02-10 23:27 in General Discussion
I would like to know how javelin converts java byte code to SX48AC native·instructions.
This is just out·of curiosity,I would also like to know what it takes to design a micro controller such
as SX48AC.Can anybody suggest any good books which specifically deal with this topic.

·

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-02-10 04:44
    No; the compiled Java bytecodes are downloaded to the Javelin and run by a very small JVM on the device.

    I can't help you on the second question -- you may want to post that one in the Sandbox forum where Beau Schwab (he works on chips) can respond.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • cmccmc Posts: 4
    edited 2005-02-10 18:44
    I appreciate·your reply.

    Can I ask one more question on the same lines.Where is the JVM located on javelin stamp module.Which chip is doing the translation of java byte code into native instructions (which SX48AC chip can understand.).

    I am planning on writing a compiler by myself which converts any high level·language to native instructions.

    Thank·you for your time.
  • kb2hapkb2hap Posts: 218
    edited 2005-02-10 20:01
    The JVM is located in the SX. The SX takes the bytecodes from the eeprom

    and perform the neccessary operation.

    It does not change the bytecodes into native code. That would be a compiler.

    Its like an operation system. sort of.

    What you want to do is more like SX/B which take the basic instructions and generates assembly.

    Actually Paul Baker explains it well in the sandbox

    "Byte code translation is done by Parallax's JVM which is software running on the SX48, it fetches the byte code from memory then executes a section of code based on that fetched byte code. It too is proprietary and Parallax won't part with it unless you enter a liscensing agreement with them, assuming they are willing to do so (They will enter a liscensing agreement for the Stamp's BASIC byte code, but that has been out for many years. Thier JVM is new and they may not be prepared to enter liscensing agreements with thier JVM yet). As you can guess this means giving them money for the privledge to look at thier code, plus signing a non-compete clause and the like. Actually they may only be willing to show you what the byte codes are, not how they execute them."

    If you want more general info on how JVM's are constructed there are some internet resources:

    http://www.eeglossary.com/jvm.htm

    http://www.linuxdevices.com/products/PD8658640976.html

    http://www.techonline.com/community/home/20283

    http://www.kaffe.org/




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DTQ

    Post Edited (kb2hap) : 2/10/2005 8:06:51 PM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-02-10 23:27
    Actually, the Javelin moves the bytecodes from EEPROM to RAM on reset to improve bytecode fetch and execution speed -- this is what allows the Javelin to run VPs in addition to the mainline code.

    The job of the JVM is to take the compiled bytecodes and execute the proper native instructions; this is why Java is called, "Write Once, Run Anywhere" -- in theory, the same set of bytecodes should run similarly on different machines because the individual JVMs handle the machine differences. Keep in mind, however, that we had to squeeze a JVM into 4K of code space, so it is not nearly as full-featured as the specialty Java chips or PCs. The small size is what limits the Javelin data types and prevents the use of garbage collection. For most (I said most) embedded applications the programmer can plan and code around these things.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
Sign In or Register to comment.