Search the web
Sign In
New User? Sign Up
staticrecompilers · Static Binary Translation
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
6502 recompiler news   Message List  
Reply | Forward Message #318 of 326 |
Re: [staticrecompilers] 6502 recompiler news

On Sat, Jul 4, 2009 at 1:58 PM, Neil Bradley <nb@...> wrote:
>> Not that the translated code looks all that great yet, but using an
>> optimising compiler backend is exactly the way to go.

>Are you referring to AST + target or just target? I would think the AST
>route is the way to go.

Of course! LLVM is a compiler back-end - you feed it your AST and it does
all the optimisations on the AST for you, and has a choice of target code
generators.
It would actually be a good fit with Orion, although I'm not suggesting
going that
route (at least not unless it becomes more obvious how to output more
approachable C)

>> Apple 1 basic is a 4K file. He hasn't posted the source of the translated
>> version, though a lot of people are asking for it. I thought it might be
fun
>> to push it through Orion and see what it looks like. There are a couple
of
>> partial disassemblies of apple1 basic out there already (although
reportedly
>> not 100% accurate copies of the code) which will give most of the labels
and
>> jumps.

> Does someone have a copy of the Apple 1 EPROM? I'd be willing to run it
> through Orion to see what comes out the other end.

Thanks! I did try it myself but was stymied by some basics like it was
assuming
an entry point at 0000 and i couldn't see how to override that.

I copied the bin to www.gtoal.com/apple1/ for you.

This is my half-assed attempt at starting a template.

/* Template for Apple I basic (4K)
See...
http://www.pagetable.com/?p=32
http://www.brouhaha.com/~eric/retrocomputing/apple/apple1/basic/
http://home.comcast.net/~mjmahon/AP1BASIC.txt
http://gloonk.com/programming/images/wozbasicvars.txt
*/
cpu 6502;
moduleprefix apple1basic;
coderegion 0xe000-0xefff;
ramregion 0x0000-0x1000; // Work RAM
loadimage 0xe000, "3rdparty\\roms\\apple1basic.bin";
entry 0xe000, apple1basic;
inlinedata 0xec1e-0xec1f;
inlinedata 0xec20-0xec3f;
inlinedata 0xec53-0xedff;



> .
>
>
>


[Non-text portions of this message have been removed]




Sat Jul 4, 2009 8:59 pm

graham_toal
Offline Offline
Send Email Send Email

Forward
Message #318 of 326 |
Expand Messages Author Sort by Date

Michael Steil, the guy who did the Pear dynarec for Macs and who discussed the recompiler howto in his document, has written a recompiler for Apple I and...
Graham Toal
graham_toal
Offline Send Email
Jul 3, 2009
8:51 pm

... As far as I understand it, SSA is part of LLVM so using LLVM provides you with SSA optimised code for free, which is good. On the other hand, I prefer a...
Laurent DESNOGUES
ldesnogu
Offline Send Email
Jul 4, 2009
11:15 am

... Are you referring to AST + target or just target? I would think the AST route is the way to go. ... Does someone have a copy of the Apple 1 EPROM? I'd be...
Neil Bradley
nb@...
Send Email
Jul 4, 2009
6:59 pm

... Of course! LLVM is a compiler back-end - you feed it your AST and it does all the optimisations on the AST for you, and has a choice of target code ...
Graham Toal
graham_toal
Offline Send Email
Jul 4, 2009
9:00 pm

... It's looking for the vectors at 0xfff8-0xffff, which is probably all 0s unless you load something there. Try adding: loadimage 0xf000,...
Neil Bradley
nb@...
Send Email
Jul 4, 2009
9:04 pm

... Well, that wouldn't have worked as it hit several opcodes that weren't implemented. Here is a new recomp.exe, template, and ROM image for the Apple1: ...
Neil Bradley
nb@...
Send Email
Jul 4, 2009
10:10 pm

... That's pretty good! Comparing it manually to http://www.brouhaha.com/~eric/retrocomputing/apple/apple1/basic/a1basic.dis all I've seen so far is a missing...
Graham Toal
graham_toal
Offline Send Email
Jul 5, 2009
12:06 am

... and when I made the $FF opcode into data, it generated an output file just fine, and the few missing code sections all look to be there now... My copy of...
Graham Toal
graham_toal
Offline Send Email
Jul 5, 2009
12:41 am

... Sweet! Can you send me the latest template? ... I haven't implemented the opcodes for anything more than a disassembly, so if you try to emit C code,...
Neil Bradley
nb@...
Send Email
Jul 5, 2009
12:50 am

... just ... http://www.gtoal.com/apple1/template.apple1 The updated disassembly is http://www.gtoal.com/apple1/apple1.asm.txt ... so ... Well, first priority...
Graham Toal
graham_toal
Offline Send Email
Jul 5, 2009
1:53 am

... Well, that's lucky! Usually it completely goes off into the weeds when it attempts to disassemble data. ... The 6502 module wasn't complete and probably...
Neil Bradley
nb@...
Send Email
Jul 5, 2009
12:44 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help