java_grinder icon indicating copy to clipboard operation
java_grinder copied to clipboard

X86_64 Support

Open JL2210 opened this issue 5 years ago • 6 comments

This is an issue to track the progress for java_grinder on x86_64

  • [x] registers
  • [ ] data types/sizes
  • [ ] code generation
  • [ ] enabling support

Please edit as progress continues, and feel free to add more goals.

JL2210 avatar Feb 07 '19 16:02 JL2210

@mikeakohn How do I use this? It seems like it's not quite fully implemented yet, even on x86. Example: I'm trying to compile a simple Hello, World! program and it's giving me an error about println_X when I'm using println.

Note: I'm a C guy. I'm not very experienced in Java.

JL2210 avatar Feb 09 '19 20:02 JL2210

The API's that are in standard Java aren't implemented. Java Grinder pretty much just takes the Java assembly instructions and generates assembly code for other CPUs. After that, different APIs can be written depending on the platform.. like C64 has its own API for manipulating its hardware.

In the samples/x86 and samples/x86_64 directories I put samples that work with x86 and almost work with x86_64. It's basically C calling the generated Java functions.

mikeakohn avatar Feb 09 '19 21:02 mikeakohn

And actually, the Java instructions aren't complete either. The core of Java Grinder has implementations just for the instructions that were needed for the things I (and others) needed.

mikeakohn avatar Feb 09 '19 21:02 mikeakohn

Would it be possible to use something like GNU Classpath to implement this? I know it's deprecated, but you could register the latest version of their Savannah Git repository as a submodule.

JL2210 avatar Feb 09 '19 21:02 JL2210

I had to look that up... seems like it could be possible. It's kind of out of the scope of what I was thinking Java Grinder would be. I started it as more out of a learning experience.. plus I thought it would be neat to have the ability to write code in Java on MSP430 or other systems that most people would have never thought about using Java for. For programming standard Java code, there are already JVM's with really fast JITs that can use all the standard Java APIs.

mikeakohn avatar Feb 09 '19 21:02 mikeakohn

Let me attach a log as an example:

java_grinder.log

JL2210 avatar Feb 09 '19 21:02 JL2210