In SX Microcontrollers, SX/B Compiler and SX-Key Tool, peterverkaik wrote: Talking about subset of JVM. This has been done by parallax using an SX48 and is known as Javelin. [url=http://www.parallax.com/javelin/index.asp]http://www.parallax.com/javelin/index.asp[/url] No way this is possible using an SX28 otherwise parallax may have done so. Smallc has alot smaller memory footprint than JVM, but then it also lacks some nice features of java. Smallc can be used with an SX28 as I showed in the first link I provided. Problem is that smallc as a language has no knowledge of ports, memory maps and all other sx features. That makes writing native compiled code (sx assembler) difficult, as there are many restrictions for the written code. The switch table as generated by the smallc compiler has the following layout: For each 'case' value there are 2 16bit entries: a code address (label) and compare value (case value). The last 2 16bit entries in this table are 0 ('default') and an address (default label). As the SX does not have a JMP M:W instruction, and there is no access to the call stack, the only way to jump to some label address indirectly, is by using secret sx instructions. However, for an interpreter, you can avoid this, because I showed in the bytecode interpreter thread, that all address references (labels) are within the generated table of tokens, that will represent your compiled code. I have attached my java class for the smallc interpreter as it shows how to interpret the smallc generated table. If you have specific question about this java program, please do so in the javelin forum. If you have specific questions about the smallc files I posted, please do so in the appropiate thread. regards peter ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=125768#m125794 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)