View Single Post
Old 07 June 2010, 22:36   #7
absence
Registered User
 
Join Date: Mar 2009
Location: moon
Posts: 373
Quote:
Originally Posted by musashi5150 View Post
And failing that of course you could use a 68000 C emulator core (like Starscream) and feed that native code
Would I be able to clean up the code piece by piece that way? For example, if I have:

Code:
asm
asm
asm
asm
asm
I can't imagine it's easy to clean up a section in the middle like this:

Code:
asm
asm
C
asm
asm
But if it was converted into this:

Code:
spaghetti C
spaghetti C
spaghetti C
spaghetti C
spaghetti C
I could easily clean up code anywhere.

Quote:
Originally Posted by hitchhikr View Post
A better solution: using a custom assembler to convert 68k mnemonics into commands for a small virtual machine:

http://www.atien.net/?static2/frontier
http://tom.noflag.org.uk/glfrontier.html

The best solution would be to have an assembler directly converting into target machine native opcodes (from a fully working asm source code, of course).
That is not the best solution, as one would have to implement back-ends for all the wanted target platforms. If the custom assembler converts to C instead, the code can be compiled for any platform using the appropriate compiler. Interestingly, this is indeed what the code you linked to does, according to README:

Quote:
FrontVM2 has discarded the uae cpu core of hatari and instead compiles the
frontier 68k crap to native assembly language. This is done either by generating
a grotesquely huge C source file, or generating i386 asm directly.
I'll have a closer look, thanks for the heads-up.
absence is offline  
 
Page generated in 0.04538 seconds with 11 queries