Re: A89: Re: Game Programming -- Pure Assembly vs. TI-GCC?


[Prev][Next][Index][Thread]

Re: A89: Re: Game Programming -- Pure Assembly vs. TI-GCC?




Daniel Wood wrote:
> 
> Well, I'm not a programmer, but I believe that the TI-GCC translates the C
> into ASM(Don't quote me on this).

Actually, what a compiler does (for ASM, C, or any other programming
language) is take the "source code" that the programmer writes and
translate it into "object code", which only the computer can understand
-- this is the end result of designing a program.

Languages like ASM are called "low-level" programming languages because
they are very "close" to the machine's language -- the programmer does a
vast amount of work using this language (he/she must be extremely
specific in telling the program what to do, which can get very difficult
and tedious), but the compiler doesn't need to translate it very far to
make it into the machine's own language.  This way, the programmer has
complete control over the program, and he/she can fine-tune (or
"optimize") it so that it runs very fast and efficiently.

At the other end, languages like C are called "high-level" programming
languages because they are closer, in a sense, to the programmer's
language (English, French, etc.).  It is far easier for the programmer
to understand and work in a language like this.  However, the compiler
must work harder to be able to translate this into the machine's
language.  The programmer doesn't have as much fine control over a
program written in this language -- as a result, it cannot be optimized
as much and may mot be as fast and efficient.

Here's an analogy: You are a native English speaker.  You meet a person
who speaks only Japanese (which you don't know a single word of). 
Obviously it is very difficult and inefficient for you to communicate
with him, since you must use tons of gestures and mime acts just to
convey simple concepts to him.  In addition, he is from a culture that
is quite unlike yours -- just one particular gesture that you may think
is appropriate for what you want to tell him may, to him, be extremely
offensive.  He may even become infuriated and refuse to communicate
further with you.  ASM is kind of like this -- and the refusal to
communicate further would be the program locking up ;)

Now you come across a German.  You notice that his language has many
similarities to yours, and you can even find some words in his speech
that are almost identical to your own.  His culture is also very much
like yours, so you feel more comfortable (and are more efficient) in
attempting to talk with him.  C is kind of like this.

That's just to give you a general idea of the concept.  And I imagine
this is far more than what you were expecting to hear, so I'll shaddup
now ;P


BeaT (Seth Peelle)
beat@drigon.com
http://www.drigon.com/~beat


Follow-Ups: References: