6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Jul 08, 2024 2:55 pm

All times are UTC




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sun Jul 29, 2012 12:56 am 
Offline

Joined: Tue Jul 24, 2012 2:27 am
Posts: 672
There's been an update posted a few days ago. Unfortunately, I think he's missing the point.

Quote:
Alright, so the campaign is public now, and I’m slowly recovering from being the nervous wreck I became five minutes after I pressed the “Go Live” button. The whole project has so far been met with a lot of enthusiasm, a couple of amusing anecdotes, and a really large amount of skepticism. Decompilation still seems to have an air of witchcraft to many people.

I’m planning to post a write-up of how the decompiler prototype works on the blog, in the hope that this will convert a few non-believers. For those that need no conversion, I’d like to ask you to go forth and tell a few people about it, because I won’t be able to do all this on Joe Decuir’s contribution alone. ;)


Every technical feature that he's discussed adding is possible to implement to some degree, but doesn't help with the real problems. :?

_________________
WFDis Interactive 6502 Disassembler
AcheronVM: A Reconfigurable 16-bit Virtual CPU for the 6502 Microprocessor


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 29, 2012 6:11 am 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10839
Location: England
Hi White Flame (and welcome!)
I saw a rather unseemly mob, but I'm not sure I saw 'real problems' with the project.

The negative posts seem to be attacking a straw man: take a difficult example, suppose it to be necessary, and pronounce the project as hopeless.

In fact, I think the project has a loose goal, of producing C which is accurate and to some degree more useful for study than the machine code. (One might argue that C could never be useful, but again I don't see that as helpful - a decompilation will always have more potential readers than a disassembly.) Six months of full time effort by someone who knows what they are doing has every chance of producing something impressive. Much less time went into any of these forum posts than into that prototype, and yet the prototype actually does something interesting.

(As for my mob comment: I'd much rather see comments pitched as "I don't see how..." instead of "You can't possibly...", and "I wouldn't support this" instead of "This is hopeless and wrong-headed". If a friend comes up to a bunch of friends with a wild idea for building something, is rubbishing the idea the best response? Even if you know them well and have good reason to judge it over-ambitious, that seems unnecessarily hostile to me. In this case, we don't know well.)

Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 29, 2012 6:36 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8464
Location: Southern California
Quote:
The negative posts seem to be attacking a straw man: take a difficult example,

Those are the ones that will hold the unexpected secrets we want. Can we get them? I'm not sure. You can't make a program look for something that's entirely different from what you think it is. I'm not very optimistic, but I will say that I was all the more motivated to develop my method of servicing interrupts in high-level Forth with zero overhead on 65C02 when people said it couldn't be done but I already knew what I was going to do. It did not discourage me, but instead fired me up. I won't attack him, but I will say he has set the bar awfully high for himself, as I have done sometimes, and recognized that I had bit off a big chuck and I was going to have to come through for my employer. I had to perform. There was no choice.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 29, 2012 7:44 am 
Offline

Joined: Tue Jul 24, 2012 2:27 am
Posts: 672
I will simply say that his list of "Use $TECHNOLOGY to reveal $INFO" features that he plans to include do not close the gap between hand-written assembly and his goal of "Derive readable C that can be ported", even if he implements them completely.

_________________
WFDis Interactive 6502 Disassembler
AcheronVM: A Reconfigurable 16-bit Virtual CPU for the 6502 Microprocessor


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 29, 2012 10:02 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8256
Location: Midwestern USA
BTW, I wonder what Samuel would have to say about this effort. He's definitely the language guru around here. :)

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 29, 2012 10:06 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8256
Location: Midwestern USA
GARTHWILSON wrote:
Quote:
The negative posts seem to be attacking a straw man: take a difficult example,

Those are the ones that will hold the unexpected secrets we want. Can we get them? I'm not sure. You can't make a program look for something that's entirely different from what you think it is. I'm not very optimistic, but I will say that I was all the more motivated to develop my method of servicing interrupts in high-level Forth with zero overhead on 65C02 when people said it couldn't be done but I already knew what I was going to do. It did not discourage me, but instead fired me up. I won't attack him, but I will say he has set the bar awfully high for himself, as I have done sometimes, and recognized that I had bit off a big chuck and I was going to have to come through for my employer. I had to perform. There was no choice.

Garth is right. Not only has the bar been set (to turn phrase on current events) to Olympic heights, the activity itself is not well defined. Over which part of the bar do you leap? How do you land? How is your performance scored? What's the ultimate goal? From what I've read on this project to date, it seems much of it is fuzzy and ill-defined.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 30, 2012 6:04 am 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10839
Location: England
BigDumbDinosaur wrote:
BTW, I wonder what Samuel would have to say about this effort. He's definitely the language guru around here. :)
No need to wonder! He said:
"I do like how it can already detect do/while loops. That's really cool. :)"

(This was actually my internal prompt for the claim that the prototype can already do interesting things.)

(I'm not suggesting that gplus has become the place for 6502 discussions, but it's where he and I interact most these days)

Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 30, 2012 7:06 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8256
Location: Midwestern USA
BigEd wrote:
BigDumbDinosaur wrote:
BTW, I wonder what Samuel would have to say about this effort. He's definitely the language guru around here. :)
No need to wonder! He said:
"I do like how it can already detect do/while loops. That's really cool. :)"

I don't do Google, so I didn't know that Samuel had seen and commented on this project.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 30, 2012 7:32 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10839
Location: England
Quote:
I don't do Google, so I didn't know that Samuel had seen and commented on this project.

Indeed - I was being helpful, for you and anyone else who might be interested.
Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 27, 2012 3:53 pm 
Offline

Joined: Tue Jul 24, 2012 2:27 am
Posts: 672
Well, the fundraiser is over and didn't draw much money. I feel kind of bad for the guy; if he just focused on the technical features he wanted to put in, but didn't frame it with generating "high-level, readable" handwaviness, he might have successfully raised funds.

_________________
WFDis Interactive 6502 Disassembler
AcheronVM: A Reconfigurable 16-bit Virtual CPU for the 6502 Microprocessor


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 27, 2012 4:51 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8256
Location: Midwestern USA
White Flame wrote:
Well, the fundraiser is over and didn't draw much money. I feel kind of bad for the guy; if he just focused on the technical features he wanted to put in, but didn't frame it with generating "high-level, readable" handwaviness, he might have successfully raised funds.

BigDumbDinosaur wrote:
While I would never discourage anyone from working on whatever it is that floats their boat, I stop at the point where funding is requested for something that will most likely prove to be an exercise in futility.

Case closed.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 20, 2012 11:30 am 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10839
Location: England
I see Ulrich has released his state-of-play code as open source:
https://github.com/uli/decomp#readme

There are pointers there to a few articles he's written about the techniques he used.

(As the crowdfunding didn't get any significant money, I would suppose future progress, if any, will be at a slow pace.)

Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 20, 2012 1:43 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
I gave it a try with some of my own code. It's pretty impressive what it can do, but on the other hand there's still a lot that it can't. One particularly amusing bit:
Code:
inc     second         
lda     second         
sbc     #60             
bcc     @1             
sta     second         
inc     minute         
lda     minute         
sbc     #60             
bcc     @1             
sta     minute         
inc     hour           
lda     hour           
sbc     #24             
bcc     @1             
sta     hour           
inc     day           

This is part of my code that keeps track of the time. Apparently, the decompiler doesn't understand that the code after the 'bcc' always has the carry flag set, leading to:
Code:
        sec = tmp2 = sec + 1;
        if (sec >= (1 - c) + 60) {
            sec = sec - c - 61;
            minute = tmp3 = minute + 1;
            if (minute >= (1 - (sec >= (1 - c) + 60)) + 60) {
                minute = minute - (sec >= (1 - c) + 60) - 61;
                hour = hour + 1;
                a = hour - (minute >= (1 - (sec >= (1 - c) + 60)) + 60) - 25;
                c = hour >= (1 - (minute >= (1 - (sec >= (1 - c) + 60)) + 60)) + 24;
                if (c) {
                    hour = a;
                }
            }
        }

I edited the code to fix the numbered variable names back into the original names.


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 20, 2012 1:48 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10839
Location: England
Yes, he mentions the detection of branch-always idioms in his pieces. Doubtless you could never get 100% correct, so the question would be how often you get it wrong, and how your progress is in improving that. Also, what interactive tools you might have to assist.

Cheers
Ed


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 19 guests


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 post attachments in this forum

Search for:
Jump to: