Re: Crenshaw's Compiler Tutorial: 68k Asm to X86 Vs Interpreting, Newbie Qs on Parsing and Pascal

"Veli-Pekka Tätilä" <vtatila@mail.student.oulu.fi>
4 Oct 2005 01:45:23 -0400

          From comp.compilers

Related articles
Crenshaw's Compiler Tutorial: 68k Asm to X86 Vs Interpreting, Newbie Q vtatila@mail.student.oulu.fi (Veli-Pekka Tätilä) (2005-10-02)
Re: Crenshaw's Compiler Tutorial: 68k Asm to X86 Vs Interpreting, Newb englere.geo@yahoo.com (Eric) (2005-10-03)
Re: Crenshaw's Compiler Tutorial: 68k Asm to X86 Vs Interpreting, Newb toby@telegraphics.com.au (toby) (2005-10-03)
Re: Crenshaw's Compiler Tutorial: 68k Asm to X86 Vs Interpreting, Newb cleos@nb.sympatico.ca (Cleo Saulnier) (2005-10-04)
Re: Crenshaw's Compiler Tutorial: 68k Asm to X86 Vs Interpreting, Newb vtatila@mail.student.oulu.fi (Veli-Pekka Tätilä) (2005-10-04)
Re: Crenshaw's Compiler Tutorial: 68k Asm to X86 Vs Interpreting, Newb oicmrsnakes@hotmail.com (James T. Sprinkle) (2005-10-06)
Re: Crenshaw's Compiler Tutorial: 68k Asm to X86 Vs Interpreting, Newb toby@telegraphics.com.au (toby) (2005-10-06)
Re: Crenshaw's Compiler Tutorial: 68k Asm to X86 Vs Interpreting, Newb vtatila@mail.student.oulu.fi (Veli-Pekka Tätilä) (2005-10-07)
Re: Crenshaw's Compiler Tutorial: 68k Asm to X86 Vs Interpreting, Newb herm@viabcp.com (Hugo Rozas) (2005-10-19)
Re: Crenshaw's Compiler Tutorial: 68k Asm to X86 Vs Interpreting, Newb jcrens@earthlink.net (Jack Crenshaw) (2006-01-26)
| List of all articles for this month |

From: "Veli-Pekka Tätilä" <vtatila@mail.student.oulu.fi>
Newsgroups: comp.compilers
Date: 4 Oct 2005 01:45:23 -0400
Organization: "University of Oulu"
References: 05-10-013 05-10-026
Keywords: courses
Posted-Date: 04 Oct 2005 01:45:23 EDT

Eric wrote:
> Check out Pete Gray's port to C:
> http://home.comcast.net/%7Epete.gray/TinC.htm
Thanks, that's the ticket. It is good to have a C-port available so I can
check possible ambiguities arising from my minimal knowledge of Pascal. So
far, I must say I like the approach of going with this tutorial but
translating things to Perl on the way.


It is a RAD language as they say and having to translate means I cannot just
lazily paste code thinking I ought to know what it should be doing. As to
the 68k asm, it is not as bad as I thought. I do know what registers are and
things like MOVE or MUL seem pretty self-explanatory.


Still, I've already made some newbie errors including:
1. Pondering whether move moves stuff rather than copying it. Most tutorials
don't even mention that it is a copy or assignment, not a move strictly
speaking.
2. Having to think of whether the first parameter is the source or the
destination. This is like endianness in the sense that I think no universal
standard exists.


I've been translating any ASM statements to Perl, eval'ing and
printing them. This way I can see the perl code that will be run and
unlike the original tutorial, will also get the desired output right
away without using an assembler. I've been using a perl hash to
emulate the registers and an array with pop and push as a stack. Works
great so far. I'm even using generic register names so all I need to
change are mapping basic Perl statements to whatever assembler I'm
targetting.


Still, I think I'd like to work on the basic examples to make them
manually Microsoft Assembler compatible. I'd appreciate a table of 68k
instructions mapped to the X86 equivalents or vice versa. Things like
adding, moving, poping and pushing so fairly basic stuff. I think I'll
Google for it after posting this.


> teach concepts, and not to make a commercial quaility compiler.


Well I don't intend on doing anything like that any time soon. I like
the hands-on approach and would be very happy to be able to even grasp
the basics. Sure I'll also consider other material once I've completed
the tutorial.


I've Googled a bit with Crenshaw and it seems many other people have found
his tutorial a great read. I've already found some that target a different
language or instruction set but are similar in philosophy.


> I learned about compilers by studying the James Hendrix Small C compiler.
> you can get it on cdrom from Dr Dobbs Journal.
Hey, this seems real interesting. Generaly I'd prefer electronic books and
tutorials. Being sight-impaired, electronic material is screen reader
accessible right away, where as if you buy a physical book you need to scan
it in and run it through OCR.


> also check out this online book:
> http://www.scifac.ru.ac.za/compilers/
Will do, thanks for answering newbie questions like this.


--
With kind regards Veli-Pekka Tätilä (vtatila@mail.student.oulu.fi)
Accessibility, game music, synthesizers and programming:
http://www.student.oulu.fi/~vtatila/


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.