Welcome to Emulationworld

Forum Index | FAQ | New User | Login | Search

Make a New PostPrevious ThreadView All ThreadsNext Thread*Show in Threaded Mode


SubjectAnyone tried writing a CPU core in Jasmin? new Reply to this message
Posted byfinaldave
Posted on02/11/04 07:54 AM




Anyone tried writing a CPU core in Jasmin? http://mrl.nyu.edu/~meyer/jasmin/

Looks possibly interesting - I wonder if there is anything you can do in Jasmin you can't in normal Java (in analogy between C and machine code)




You learn something old everyday...



SubjectRe: Anyone tried writing a CPU core in Jasmin? Reply to this message
Posted byMrJeff
Posted on02/26/04 07:38 AM



>
> Anyone tried writing a CPU core in Jasmin? http://mrl.nyu.edu/~meyer/jasmin/
>
> Looks possibly interesting - I wonder if there is anything you can do in Jasmin
> you can't in normal Java (in analogy between C and machine code)
>

I've written some javavm asm before (we had to do for a uni project). There are quite a few things that are much easier to do in javavm asm than actual java, however there are a couple of minor things to consider.

1) Programming stack machines sucks
2) Nowadays most java VMs basically decompile the java bytecode back to sudocode so they can do wizzy recompiling, so I'm not sure how much it would help to write things in java asm.


SubjectRe: Anyone tried writing a CPU core in Jasmin? new Reply to this message
Posted byfinaldave
Posted on02/27/04 08:17 AM



> >
> > Anyone tried writing a CPU core in Jasmin? http://mrl.nyu.edu/~meyer/jasmin/
> >
> > Looks possibly interesting - I wonder if there is anything you can do in
> Jasmin
> > you can't in normal Java (in analogy between C and machine code)
> >
>
> I've written some javavm asm before (we had to do for a uni project). There are
> quite a few things that are much easier to do in javavm asm than actual java,
> however there are a couple of minor things to consider.
>
> 1) Programming stack machines sucks
> 2) Nowadays most java VMs basically decompile the java bytecode back to sudocode
> so they can do wizzy recompiling, so I'm not sure how much it would help to
> write things in java asm.
>

depends i guess - do you reckon you could do an opcode jump table or something in Java Asm?
Or in MSIL?


to tighten up the execute loop maybe?



You learn something old everyday...



SubjectRe: Anyone tried writing a CPU core in Jasmin? new Reply to this message
Posted byR. Belmont
Posted on02/27/04 06:03 PM



> depends i guess - do you reckon you could do an opcode jump table or something
> in Java Asm?
> Or in MSIL?

You definitely can in MSIL - MSIL can do anything C can (and unlike with Java, there's even a supported assembler for it). VC++.NET can compile "pure" C/C++ programs to MSIL (so-called "managed C/C++") as long as you're careful what external APIs you call. MS has demonstrated DOOM 2 recompiled in this way with the same exe running on 32 and 64 bit machines.





SubjectRe: Anyone tried writing a CPU core in Jasmin? new Reply to this message
Posted byVideoman
Posted on06/27/04 03:33 AM



> > depends i guess - do you reckon you could do an opcode jump table or something
> > in Java Asm?
> > Or in MSIL?
>
> You definitely can in MSIL - MSIL can do anything C can (and unlike with Java,
> there's even a supported assembler for it). VC++.NET can compile "pure" C/C++
> programs to MSIL (so-called "managed C/C++") as long as you're careful what
> external APIs you call. MS has demonstrated DOOM 2 recompiled in this way with
> the same exe running on 32 and 64 bit machines.
>

Huh. Hmm.

XNA!

Now I get it. :)

(Btw, whatever happened to TAOS, and their virtual-machine technology? That looked really, really promising. I saw something released a couple of years back, the Amiga Digital Environment, with a Windows' download, even, but then nothing more. Apparently ADE used some of their tech. The writeup about their company in EDGE years ago even pointed out that they wanted to use it for arcade games and stuff too, not just computers. Anyways, sorry to ramble again.)





SubjectRe: Anyone tried writing a CPU core in Jasmin? new Reply to this message
Posted byerikduijs
Posted on07/07/04 09:41 PM



> > >
> > > Anyone tried writing a CPU core in Jasmin? http://mrl.nyu.edu/~meyer/jasmin/
> > >
> > > Looks possibly interesting - I wonder if there is anything you can do in
> > Jasmin
> > > you can't in normal Java (in analogy between C and machine code)
> > >
> >
> > I've written some javavm asm before (we had to do for a uni project). There
> are
> > quite a few things that are much easier to do in javavm asm than actual java,
> > however there are a couple of minor things to consider.
> >
> > 1) Programming stack machines sucks
> > 2) Nowadays most java VMs basically decompile the java bytecode back to
> sudocode
> > so they can do wizzy recompiling, so I'm not sure how much it would help to
> > write things in java asm.
> >
>
> depends i guess - do you reckon you could do an opcode jump table or something
> in Java Asm?
> Or in MSIL?
>
>
> to tighten up the execute loop maybe?
>

If you write an ordered switch/case, it will compile to a jump table.
I don't think writing java asm will really help since the VM will do all sorts of recompiling and optimizing on the fly so that the executed code probably looks nothing like the original bytecode anymore. I could even imagine that if you write java asm, you could give the VM a hard time doing that; I suppose the VM recognizes some typical javac output.
The thing that *really* pissis me off with java when it comes to emulator programming is the lack of unsigned data types.




Previous ThreadView All ThreadsNext Thread*Show in Threaded Mode