Well, as the topic says, I am going to get a JVM to compile and run. So, my question is: Which JVM should I use?

I originally looked at leJOS because it uses a small environment, but then I saw http://en.wikipedia.org/wiki/List_of_Java_virtual_machines...

Porting for me would be a better start than writing from scratch. I see that TinyVM is very simple (threading, etc., but it lacks major features like floats and GC'ing). Since this will be a VM, I can already see the VM taking full advantage of all RAM pages, either 3 or 8.

So, which seems like a good place for a small VM?
Get something that at least attempts to follow the Sun specs. If it doesn't, like TinyVM appears to do, then throw it out the window.
Don't forget that this is z80 that is being targeted... There aren't many choices that would work well...

I am looking at a VM for the Apple ][ :-\ Looks promising so far...
I'm not forgetting that it's for z80, but you should be able to get a decent JVM running in no more than three app pages (1-2 expected) if written properly.
:-\ But still, I need suggestions!!

I am looking at either TinyVM (or bits from leJOS)

<edit>

VM02 is written in asm, oops!
AHelper wrote:
I am looking at a VM for the Apple ][ :-\ Looks promising so far...


Both the Apple II and TI-8x calcs make use of BCD arithmetic, so that's a potential plus if you had to port any assembly routines.
The 3 options are Jelatine JVM (a bit big :-\), TinyVM (perfect size, lacking features) and leJOS (retargatable for gbz80 in C and has more features than TinyVM)

I will stick with leJOS right now and try to port it as best as I can... I will need to read through and find out how the dirty hidden parts work, such as memory things, hardware, etc.
elfprince13 wrote:
AHelper wrote:
I am looking at a VM for the Apple ][ :-\ Looks promising so far...


Both the Apple II and TI-8x calcs make use of BCD arithmetic, so that's a potential plus if you had to port any assembly routines.
Except that this is likely for his own OS, which abandons BCB-based floating-point numbers. Smile
KermMartian wrote:
elfprince13 wrote:
AHelper wrote:
I am looking at a VM for the Apple ][ :-\ Looks promising so far...


Both the Apple II and TI-8x calcs make use of BCD arithmetic, so that's a potential plus if you had to port any assembly routines.
Except that this is likely for his own OS, which abandons BCB-based floating-point numbers. Smile

Which is silly, since I seem to remember from 83pasm28d that there are instructions on the z80 that make dealing with BCD much easier?
To quote from icarus.ticalc.org:

Quote:
Mathematical operations are more difficult to perform, however, the Z80 serves with the DAA instructions, which will correct BCD numbers after addition, subtraction, etc


But I support the decisions that he made, since he's writing in C.
Try Java Platform, Micro Edition. And aren't leJos and TinyVM for lego?
I can see this being really, really cool - but not feasible. Good luck, though.
Just to point out - lejos was designed in two parts: the JavaVM, and the nxt frontend/main java program. I am going to start porting the vm file-by-file now that I know how it works with the bytecode and hardware interaction. It shouldn't be bad for SDCC, but I may need to do some trickery in GlassOS to get everything working...

The VM itself will need RAM for the stack, local variables, etc., so I am thinking about having 32KB of ram available instead of just 16KB. Note that the VM itself will need to take up space for global variables, stack space, etc., but it should fit. The bytecode will be run from flash, which isn't a problem. Since the SP will start at 0xFF00-ish, then I can swap in the ROm page into 0x8000-0xBFFF (which normal C programs can't do) and read much faster.

I already noted places of interest in the VM, such as the gbz80 platform setup (which is OK I guess) and the other class loading functions. I hope that, since this is a VM with indirect memory access, I can be the VM to allow either 2 or 7 RAM pages to be the stack (shared of course) and threading will be included (since I can just swap pages out).

SirCmpwn wrote:
I can see this being really, really cool - but not feasible. Good luck, though.

I know, but if I can get a compiler to run on-calc and get more libraries included, then this would be the on-calc coding language, I guess...

I will start the bulk of the coding once my exams are done, Friday.
That sounds great! When will it be done after Friday? I'd be happy to do some debugging/testing.
Not sure... I am still learning Java (as I stopped learning before as my projects were in C and C++ and couldn't use Java). I am just wondering how well Java will be able to run with an extremely limited memory space...

Just a question that I didn't find yet: Is the heap for the JVM shared by all processes, or is it created per-thread? (I think that lejos does its own allocations in the heap as well, but I am not sure) Or is this JVM-dependent?
Try Head First Java to learn it. It's not a conventional book, and it really helps when leaning Java. It's a little pricy (All computer books are) , but it should be at your local library.

The Heap is shared (All objects can be used cross-thread)
I am camping on Oracle and reading their java docs (and doing what netbeans says what not to do).

I have a java book, but I usually don't learn that way... I would use it instead as a reference book (If I can find it)
You should really try this book. It's the best computer book out there. It's Insanely different from anything you have ever read before, it is "Brain Friendly"
Heh... My library doesn't carry much, and my closest bookstore decided to get rid of most programming books... Good-bye Cg shader books...

I would get it, but I can't right now
Here's as sample (Chapter 8) http://oreilly.com/catalog/hfjava2/chapter/ch08.pdf Oh, and the sidebars are helpful, don't skip 'em.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement