From: | "James T. Sprinkle" <oicmrsnakes@hotmail.com> |
Newsgroups: | comp.compilers |
Date: | 6 Oct 2005 15:20:53 -0400 |
Organization: | City of Seattle NewsReader Service |
References: | 05-10-013 |
Keywords: | courses, books |
Posted-Date: | 06 Oct 2005 15:20:53 EDT |
"Veli-Pekka Tätilä" <vtatila@mail.student.oulu.fi> wrote
> Some things in computing seem like black magic untill you understand
> enough of the mysterious bits to realize they aren't. Compiling and
> parsing are two such things. Being very new to parsing, I was glad
> to discover a simple, hand-son tutorial called Let's Build a
> Compiler by Jack W. Crenshaw. It's available on-line at:
> http://www.freetechbooks.com/post-60.html
> [It's also at compilers.iecc.com with other comp.compilers stuff -John]
> The trouble is once he gets to assembler, it is Motorola 68k stuff and
> I'm using an X86 Win32 machine as usual. I was just wondering if
> anyone has re-written the assembler bits in x86? I tried Googling but
> didn't hit the jackpot just yet, though many posts do reference the
> book in one way or another.
>
> So far I've been programming in more or less high-level languages Java
> and Perl mainly but have a little C under my belt, too. I'm a total
> newbie in Assembler of any kind so it is unlikely I would be able to
> translate the Asm from one machine to the other even if given a lot of
> time, effort and material. Frankly speaking, even the more complex bit
> operations in C tend to make my head hurt, <smile>.
>
> I'm also somewhat reluctant to learn Pascal for various reasons,
> including lack of interest and accessibility concerns of old DOS IDEs,
> so I've been rewriting the first few examples in Perl with moderate
> success. At least I'll have to pay attention to the code. But
> sometimes I feel like the Pascal code isn't intuitive and i need to
> take a wild guess on what's going on. I can elaborate on this in
> further posts or off-list if it's considered OT. Are there any good
> Pascal tutorials for people coming from another C-like language? I
> found some Pascal references but they are a bit too complete and
> detailed, so to speak.
>
> Anyway, assuming I'll be able to produce X86 assembler, which
> Assembler should I use? I'd be perfectly happy if I could have the
> Perl code spew out assembler listings for a free program that would
> turn them to DOS -, or Win32 console apps. My understanding is that C,
> and apparently Pascal, has in-line assembler support, so this process
> would be a bit more transparent in those languages.
>
> Lastly, if there's no X86 equivalent, my plan b is to concentrate
> mostly on parsing, and implement any of the Assembler bits straight in
> Perl if I can. IT would be an interpreter rather than a compiler,
> then.
>
> My last question is, does the Crenshaw tutorial make sense without
> being able to implement and or fully understand the assembler bits? I
> suppose the principles of parsing are sort of target language neutral.
A couple years back, I started following this tutorial and ran into the same
problem. Written in Pascal and emits non x86 assembly code. I decided as I
read through it, I would convert the pascal code to c code and convert the
assembly code to x86. I didn't finish the tutorial, (very very busy I am)
but I did get a good way into it iirc. Heck, maybe I should even finish it.
I'll see if I can find my old code...
JaYmZ
Return to the
comp.compilers page.
Search the
comp.compilers archives again.