A buddy of mine has been working on java for microcontrollers etc:
https://github.com/mikeakohn/java_grinderFor fun/learning I am doing the 6502 part. The idea is basically to compile the java byte code into assembly. There are limitations:
-integers are 16-bit, shorts are treated like integers
-stack is always aligned to 16-bit
-division/modulus is unsigned only
-you can have 8/16 bit arrays (byte/int)
-no floating point etc
He made it so you can extend a processor to a particular platform, and make corresponding java classes. Pretty cool. So I extended 6502 to the C64, and am working on an API for that. Not everything in java is supported, but basically you make one class file, and include static methods within that to do what you want.
There is a Mandelbrot demo for the C64. The latest naken_asm from github (see above) is required for this to work:
https://github.com/mikeakohn/naken_asmCode:
cd java
make
cd ..
That builds the API..
Code:
cp testing/CommodoreDemo.java .
javac -cp build CommodoreDemo.java
./java_grinder CommodoreDemo.class test.asm c64
Then use naken_asm to compile:
Code:
naken_asm test.asm -b -o test.prg
Now test.prg will run in a c64 emulator such as VICE:
Mike's pages for java_grinder and naken_asm with more information:
http://www.mikekohn.net/micro/java_grinder.phphttp://www.mikekohn.net/micro/naken_asm.php