Doing assembly and really doing assembly 
Author Message
 Doing assembly and really doing assembly

In many programming forums you'll find fairly young programmers who
are willing to share their experience.  It often goes something like
this:

basic 13 yrs old
Pascal 14 yrs
assembly 15 yrs
c 16 yrs

Having just been struggling with 8086 & 386 adressing modes (thanks Mr
Hyde, AOA is an excellent book) I'd have to conclude that when people
say they've 'done' assembly they mean they've dabbled in it, maybe
called some interrupts, but no more.

I've written little mouse routines with inline ASM & Interrupts,
that's hardly the big time!

Unless I'm slow I'd contend that learning assembly in a meaningful
way, so as to produce useful applications, takes quite some time and
that most people who tackle it close the door before it get's really
hard, or really rewarding.

Is that a fair assessment?

Anyway, I'm really impressed by how very *tiny* and fast my little ASM
experiments become when compiled and pretty e{*filter*}d about how I could
use a mix of HLL and ASM to speed up and fine tune my programs.

To think some people say assembly is dead!



Sat, 08 Nov 2003 21:15:48 GMT  
 Doing assembly and really doing assembly

Quote:
> In many programming forums you'll find fairly young programmers who
> are willing to share their experience.  It often goes something like
> this:

> basic 13 yrs old
> pascal 14 yrs
> assembly 15 yrs
> c 16 yrs

Me:
basic: 11 yrs old
asm: 12 yrs old
pascal: 15 yrs old
c: 18 yrs old

And there may be many other examples, though I don't really believe a kid at
age of 10 can really understand asm, probably just basic. ...unless that kid
is indeed genius.

Quote:
> Having just been struggling with 8086 & 386 adressing modes (thanks Mr
> Hyde, AOA is an excellent book) I'd have to conclude that when people
> say they've 'done' assembly they mean they've dabbled in it, maybe
> called some interrupts, but no more.

> I've written little mouse routines with inline ASM & Interrupts,
> that's hardly the big time!

> Unless I'm slow I'd contend that learning assembly in a meaningful
> way, so as to produce useful applications, takes quite some time and
> that most people who tackle it close the door before it get's really
> hard, or really rewarding.

> Is that a fair assessment?

Seems to be... Indeed, assemblly language programming is far more than just
things like "hello world!" program or something very similar, w/o use of all
assembly language power and methods.

Quote:
> Anyway, I'm really impressed by how very *tiny* and fast my little ASM
> experiments become when compiled and pretty e{*filter*}d about how I could
> use a mix of HLL and ASM to speed up and fine tune my programs.

Yes it can. However, these days we have several very good c/c++ compilers
that produce very good optimized code, besides they provide special options
of optimization such that inline functions, register calling convention
(instead of stack) and others. So if you know what really consumes most of
the time, you may 1st optimize the algorithm and the data structures and
then use those specific optimization options to get more out of c/c++
program. Very often, the result is nearly same as if one wrote a complete
ASM implementation of the same function. I know that, I did that and was
quite surprised.
Btw, it seems that for CPUs that can process many multiple data items
(something similar to MMX, but not it), a compiler produced code can be much
better than hand coded asm. That's because there are many ways of
optimization and the compiler can try them all and find best, while a
programmer would spend lots of time to find nearly as good solution. So, if
you're not coding systems software (OS, whatever), stick to plain c/c++. If
not, you may use some assembly language to try to do better than the
compiler in time critical sections, but not anywhere else, it would be a
waste of time.

Quote:
> To think some people say assembly is dead!

It's not and never will be, but compilers are getting better and better.

Good Luck
--
Alexei A. Frounze
alexfru [AT] chat [DOT] ru
http://www.*-*-*.com/
http://www.*-*-*.com/
http://www.*-*-*.com/



Sun, 09 Nov 2003 03:16:57 GMT  
 Doing assembly and really doing assembly

Quote:
>Anyway, I'm really impressed by how very *tiny* and fast my little ASM
>experiments become when compiled and pretty e{*filter*}d about how I could
>use a mix of HLL and ASM to speed up and fine tune my programs.

Do you know things like 4k intro, 256 byte intro, 128 byte intro and
the Hugi size optimizing competitions ?

Quote:
>To think some people say assembly is dead!

Well, as long as CPUs work as they do today, being controlled by
opcodes processed by them, there will be assembly.
There might be self-reconfiguring neuronal nets, quantum or DNA
computers, but on such things any other common programming language
used today will be unsuitable as well.


Sun, 09 Nov 2003 05:47:50 GMT  
 Doing assembly and really doing assembly

Quote:

>In many programming forums you'll find fairly young programmers who
>are willing to share their experience.  It often goes something like
>this:
>basic 13 yrs old
>pascal 14 yrs
>assembly 15 yrs
>c 16 yrs
>Having just been struggling with 8086 & 386 adressing modes (thanks Mr
>Hyde, AOA is an excellent book) I'd have to conclude that when people
>say they've 'done' assembly they mean they've dabbled in it, maybe
>called some interrupts, but no more.
>I've written little mouse routines with inline ASM & Interrupts,
>that's hardly the big time!
>Unless I'm slow I'd contend that learning assembly in a meaningful
>way, so as to produce useful applications, takes quite some time and
>that most people who tackle it close the door before it get's really
>hard, or really rewarding.
>Is that a fair assessment?
>Anyway, I'm really impressed by how very *tiny* and fast my little ASM
>experiments become when compiled and pretty e{*filter*}d about how I could
>use a mix of HLL and ASM to speed up and fine tune my programs.
>To think some people say assembly is dead!

I've written several meaningful applications in Z80, 6809, x86, VAX MACRO, and
Series I assembler.  

I wish I could spend more of my time writing assembly code for a living.
Realistically, with today's bloated GUI interfaces, that isn't usually a
truly viable option, but when it comes to sheer performance, assembler beats
any high level language hands down if you know what you're doing.  The trick is
that writing highly optimized assembly code requires that one really understand
the architecture of the machine.  Unless you're willing to learn that,
you're probably better off using an optimizing compiler written by folks who
have done their homework with respect to the platform in question.

Another excellent reason for learning an assembly language is so you can
have your C/C++ compiler dump assembly listings and then you can use those
to optimize your HLL code.  When I was an undergrad, I had been using C for
maybe a month but was consistently turning in the smallest, fastest code
for the machine problems were were assigned to do in a class where we had to
program in C.  A friend who had been using C for years was amazed...until I
told him how I was using assembly language dumps to evaluate my programs.
He didn't know VAX MACRO very well so that wasn't an real option for him.

Regards,
Mark

--
  "There is a very fine line between love and nausea."
     -- James Earl Jones as King Jaffe Joffer in the movie "Coming to America"

  "Give a man a fish and you feed him for a day; teach him to use the Net
        and he won't bother you for weeks." -- unknown



Sun, 09 Nov 2003 06:27:05 GMT  
 Doing assembly and really doing assembly



Quote:


> > In many programming forums you'll find fairly young programmers who
> > are willing to share their experience.  It often goes something like
> > this:

> > basic 13 yrs old
> > pascal 14 yrs
> > assembly 15 yrs
> > c 16 yrs

> Me:
And me:
> basic: 11 yrs old
10
> asm: 12 yrs old

15 (I'm interested in it now, so I don't learn others too much (and I have
not any good compilator/help/etc. for others ones; I'm 16 now and I'm so
happy I can talk in this groups :-)
Quote:
> pascal: 15 yrs old
12 (still beginner)
> c: 18 yrs old

13 (also, still beginner)

Quote:

> And there may be many other examples, though I don't really believe a kid
at
> age of 10 can really understand asm, probably just basic. ...unless that
kid
> is indeed genius.

I don't know my opinion. Maybe - basic is very simple, because it's very
easy (variables, procedures, few commands etc. ); I don't like Pascal,
because I was learning at school (and its CRT library doesn't work on any
new comps)
C is the best choise for programming, but you have to spend a lot of time
reading helps etc. (and its not free, or not-easy-to-get-it) Also, any C
(Cpp) I've ever seen doesn't support 386+ instructions/registers.
And it makes ASM sequences slow. (sometimes, you can use 'asm db' for that,
but not every time)

I've started learning ASM because I thought it can produce the fastest
programs. (I wanted to edit code in games just typing some texts to code
when I was younger, to do some changes :-)
Also, ASM is the best way to create viruses/OSs (who didn't try to do it?
:-)
But in our country is not good chance to learn asm - there are not many
students as old as me which would like to learn it. (I've found only two
people...)
(hm - at basic school, we were learning Word and Excel for 3 years. (and one
year C or Pascal).

(our school was one which had some comps - at many others, there are noones
yet - but now, our Ministry of Schoolship (?) wants to do a grandious
project - to equip all schools with comps (its really only plan now-any
informations such as OS, types of computer, speed of internet access etc.
are not known yet). It would have to cost around 3 billions Kc (90 millions
USD). (our country has a turnover of over 1300 billions Kc per year (350
billions USD) with deficit of around 70 billions Kc per year (20 billions
USD) ) So it doesn't seem to happen in next years :-(
) I hope, everything will be better few years later.
(when there's no support from politicians, any better cannot be :-(

Now, at high school, we do the same (two years Word, Excel, Access and other
MS products, one year Pascal and one Visual Basic)
(MS sponsors many schools with its product for lesser money (our school
CANNOT use any other OS (as said our teacher) ); I've not seen ANY
basic/high school, where is any other OS than ms one :-(

I would like to study some college which would be more technical (CVUT? - I
don't know) :-(

IMHO learning assembly can be started after understanding basic of computer
architecture (memory, ports, microprocessors, add-on cards etc.) and after
learning any HLL (to understand bacics of programming - to know, how to
write effective algorythms (basic can be enought, but it won't help good to
learn data types) )
Assembly was simple at beginnings (up to 80286 w/out 'protected mode
instructions'), so imho it can be learned at school (but it isn't, because
there are any teachers at basic/high school (when is somebody good
programmer etc., he doesn't want to have as little salary and goes abroad
:-)
Now, there are many 'extended' instruction sets (starting with 'protected
mode instructions' (ltr, lgdt, ...), going over 3DNow! and MMX, ending at
SSE (which are these?) and SSE2. These instruction sets have little meaning
for standart programming (except cmov, which is imho very useful) )

Quote:
> > To think some people say assembly is dead!

It isn't - and it never wont :-)

But - now, in these ages, it's better to learn Perl, Java, HTML, VB, JS and
similiar...

With assembly, you can optimize 'real' (HLL) programs.

But now, you cannot make programs w/out good HLL (to call system routines in
PM)

Quote:

> It's not and never will be, but compilers are getting better and better.

Also, to write an compiler :-)

Quote:
> Good Luck
> --
> Alexei A. Frounze
> alexfru [AT] chat [DOT] ru

(I've written this mail in my best, I hope I've not made any important bugs
:-)

(do you know Czechia (Czech Republic) ? --- it's a post-communist country
among Deutschland, Austria, Polland and Slovakia :-)

Regards

Zdenek Sojka
zsojka [AT] seznam [DOT] cz :-)

www.volny.cz/zsojka (only in Czech)

- Show quoted text -

Quote:
> http://alexfru.chat.ru
> http://members.xoom.com/alexfru/
> http://welcome.to/pmode/



Mon, 10 Nov 2003 04:40:20 GMT  
 Doing assembly and really doing assembly


Quote:
> In many programming forums you'll find fairly young programmers who
> are willing to share their experience.  It often goes something like
> this:

> basic 13 yrs old
> pascal 14 yrs
> assembly 15 yrs
> c 16 yrs

> Having just been struggling with 8086 & 386 adressing modes (thanks Mr
> Hyde, AOA is an excellent book) I'd have to conclude that when people
> say they've 'done' assembly they mean they've dabbled in it, maybe
> called some interrupts, but no more.

Probably at least reasonably accurate.

Quote:
> Unless I'm slow I'd contend that learning assembly in a meaningful
> way, so as to produce useful applications, takes quite some time and
> that most people who tackle it close the door before it get's really
> hard, or really rewarding.

> Is that a fair assessment?

I mostly agree.  In reality, I doubt anybody can really learn any one
language really well in only a year unless it's nothing more than a
trivial variation on something they already know.  I've been writing
assembly code (for various and sundry processors) for over 20 years,
and I still routinely learn new things.  Of course, processors don't
stand still either, so even on a long-lived line like the x86, there
are still new instruction sets to deal with on a regular basis.

--
    Later,
    Jerry.

The Universe is a figment of its own imagination.



Mon, 10 Nov 2003 09:01:20 GMT  
 Doing assembly and really doing assembly

Quote:

> > asm: 12 yrs old
> 15 (I'm interested in it now, so I don't learn others too much (and I have
> not any good compilator/help/etc. for others ones; I'm 16 now and I'm so
> happy I can talk in this groups :-)

If you don't have good ones but want to, go to my site and get links for
FPC, DJGPP. The two are very good and yet free.

Quote:
> > And there may be many other examples, though I don't really believe a
kid
> at
> > age of 10 can really understand asm, probably just basic. ...unless that
> kid
> > is indeed genius.

> I don't know my opinion. Maybe - basic is very simple, because it's very
> easy (variables, procedures, few commands etc. ); I don't like Pascal,
> because I was learning at school (and its CRT library doesn't work on any
> new comps)
> C is the best choise for programming, but you have to spend a lot of time
> reading helps etc. (and its not free, or not-easy-to-get-it) Also, any C
> (Cpp) I've ever seen doesn't support 386+ instructions/registers.
> And it makes ASM sequences slow. (sometimes, you can use 'asm db' for
that,
> but not every time)

Now, let's stop for a few minutes and think well...
Basic is a pretty simple thing that basically has no relationship to the
computer architecture in the sense it lacks pointers, sizes of variables can
be known only from tech notes (if any :), etc etc. It's simple, it's *basic*
but as I mentioned there are side effects of such a simplicity, you may know
it but you can't really say can program well (in it, or at all if you don't
know anything else but basic). Besides, basic syntax is self-inconsistent.
Pascal is much more advanced than basic and offers quite a lot of features
and it can be used for real serious programming, syntax is nice, consistent,
whole thing reflects basics of computer architecture, type casting is
strict/strong so if you write a silly/crappy code the compiler won't compile
that stuff and force you to write up things correctly and unambigously. All
these things together bring up a very nice thing in terms of
studying/learning, it's very easy to understand Pascal (especially after
doing something in basic), I'd say it's a beautiful programming language to
start with, start doing some more advanced things.
C is even more advanced than Pascal, offers lots of various functions (I bet
at least 10 times as many than in Pascal), it has support for pointers which
is very powerful and it doesn't require strict type casting. The syntax is
also consistent and very reach, more reach than in Pascal and basic added up
together. But here is the main problem. It's really hard to start
programming in C and takes time to do things right (or one may never learn
how to do things right in C), that's all because of its complexity, type
casting (the compiler lets some crappy code with obvious bugs to compile but
the programmer is driven mad because he has no clue what's wrong until he
learn how things must be and must not be done) pointers (normally, pointers
are heavily used in advanced programs and quite often they are used in
standard libraries or other libraries that may be included into the compiler
package or can be available from somewhere else), but I haven't seen many
newbies that would perfectly understand requirements of correct type
casting, the idea and mathematics behind pointers and multi-dimensional
arrays. Besides, there are things like those /=, *dst++=*src++ and it's hard
to understand what this code is supposed to do. Or, it may be hard to
understand from the book and the code which includes these things is more
likely to be buggy. Yet another thing to consider... All of us know
precedence of ^,*,/,+,-,= in mathematics. When it comes to C and things like
&, |, ^, !, what may seem to be logical, is not. There is a difference
between precedence of these operators in basic/pascal and C. One has to know
exactly what has higher priority, what lesser, and what is between the two.
If all of these things are not taken in account, powerful C is basically
useless...

Just for a record, C makes me thinking much more than Pascal or ASM does,
it's not something I like very much...
And last month I went to brainbench to see my performance in C and ASM. I
passed C test with grade of 3.25 out of possible 5. >4.0 means master level,
<2.75 (or 2.25?) = not certified, >2.75 and <4.0 is standard level. I
answered about 2/3 of questions right (total of 40 q's). And I was given a
comment like: "performance is better than 80% of all previously tested ppl".
Now, let's take ASM. I've got there 4.65 out of same 5.0, I guess I answered
about 36-37 questions right out of 40. The comment was: better than 77%
(??? - can't check, brainbench has maintainance hours right now), if I'm
correct... anyway...
Just to make a point... Ppl don't program in C well. If I don't feel
comfortable with C and get performance better than 80% of all previous
testees, this certainly means something (especially if I do program very
well in Pascal and ASM). Ppl don't program well in C but what's the most
scary thing in this story, most of ppl choose C, not Pascal, Ada or
something similar which doesn't hide problems and is not that reach to make
troubles of using that reachness correctly.
It's the fact...

Quote:
> I've started learning ASM because I thought it can produce the fastest
> programs.

*It* can't. *You* can with use of it. It's not just a matter of chosing a
right/good compiler, it's a matter of being capable to write efficient code.
In ASM, you may do basically whatever you want, but if you don't know enough
details, your code is more likely to be either slower than that of produced
by a good compiler or just as fast.

Quote:
> (I wanted to edit code in games just typing some texts to code
> when I was younger, to do some changes :-)
> Also, ASM is the best way to create viruses/OSs (who didn't try to do it?
>:-)

Ppl, who have things to do and not much time to waste. :)

Quote:
> But in our country is not good chance to learn asm - there are not many
> students as old as me which would like to learn it. (I've found only two
> people...)
> (hm - at basic school, we were learning Word and Excel for 3 years. (and
one
> year C or Pascal).

So what? When I came to the university in Moscow, I saw that actually I know
Pascal and ASM better than the teacher. And there were no ASM lessons in my
life at school or university. There were no such things on regular basis at
all. What was there, about 3 lessons from my dad, who programs in ASM pretty
much well. Those 3 lessons were enough to get me started, to read books on
the subject, to search for the information I need but don't have and most
importantly to *think*. Thanks god, I can think of many problems and solve
most of them myself with probably some help from books or docs on the
internet (btw, now it's easy to go online and find lots of stuff, ready-made
examples, FAQs, but when I was learning ASM, I didn't have such a thing, I
did almost everything by myself and if I couldn't understand what's written
in a book, I reread it as many times as required for me to understand the
damn thing or realize that the topic is described umbigously and take
another book or have an experiment to test certain statements in the book).

As for how many ppl are willing to learn computer related stuff... This is
all simple. About 20% of *all* ppl are physically capable of doing math and
technology, related things, understanding them and their purpose and finally
willing to mess with them. The rest 80% aren't, they don't like that stuff
to do and prefer completely different things. This is real life, no wonder
that you don't see many ppl in your class/school doing same kind of things
like programming.

- Show quoted text -

Quote:
> (our school was one which had some comps - at many others, there are
noones
> yet - but now, our Ministry of Schoolship (?) wants to do a grandious
> project - to equip all schools with comps (its really only plan now-any
> informations such as OS, types of computer, speed of internet access etc.
> are not known yet). It would have to cost around 3 billions Kc (90
millions
> USD). (our country has a turnover of over 1300 billions Kc per year (350
> billions USD) with deficit of around 70 billions Kc per year (20 billions
> USD) ) So it doesn't seem to happen in next years :-(
> ) I hope, everything will be better few years later.
> (when there's no support from politicians, any better cannot be :-(

> Now, at high school, we do the same (two years Word, Excel, Access and
other
> MS products, one year Pascal and one Visual Basic)
> (MS sponsors many schools with its product for lesser money (our school
> CANNOT use any other OS (as said our teacher) ); I've not seen ANY
> basic/high school, where is any other OS than ms one :-(

I guess in US most of schools use Mac. :)

Quote:
> I would like to study some college which would be more technical (CVUT? -
I
> don't know) :-(

IT way... :) Well, hopefuly, you will enter a good institution after the
school and find a good job...

Quote:
> IMHO learning assembly can be started after understanding basic of
computer
> architecture (memory, ports, microprocessors, add-on cards etc.) and after
> learning any HLL (to understand bacics of programming - to know, how to
> write effective algorythms (basic can be enought, but it won't help good
to
> learn data types) )

E.g. somewhere being a senior in undegraduate school at age of 19 :)
I think you even don't imaging how many things should be learned to know
computer architecure... :) and how much time they take to learn and
understand... I guess perfect understanding comes after taking courses such
as CMOS circuits (requires good knowledge of waves and fields, electric
stuff, math is also a must), Logic Design (brings you conceptions of tiny
logic details inside a computer/processor/etc, requires very good skills in
bare logic, it's tricky)... Then I guess we can put on top of this that
Computer Architecture ...

read more »



Tue, 11 Nov 2003 03:34:52 GMT  
 Doing assembly and really doing assembly
But for good experience you need to learn programming with older compiler
releases;

I've learnt pascal at the age of 15;
                 c/c++ at the age of 16 and assemby a little bit earlier;
                 fortran at the age of 18;

Quote:

> In many programming forums you'll find fairly young programmers who
> are willing to share their experience.  It often goes something like
> this:

> basic 13 yrs old
> pascal 14 yrs
> assembly 15 yrs
> c 16 yrs

> Having just been struggling with 8086 & 386 adressing modes (thanks Mr
> Hyde, AOA is an excellent book) I'd have to conclude that when people
> say they've 'done' assembly they mean they've dabbled in it, maybe
> called some interrupts, but no more.

> I've written little mouse routines with inline ASM & Interrupts,
> that's hardly the big time!

> Unless I'm slow I'd contend that learning assembly in a meaningful
> way, so as to produce useful applications, takes quite some time and
> that most people who tackle it close the door before it get's really
> hard, or really rewarding.

> Is that a fair assessment?

> Anyway, I'm really impressed by how very *tiny* and fast my little ASM
> experiments become when compiled and pretty e{*filter*}d about how I could
> use a mix of HLL and ASM to speed up and fine tune my programs.

> To think some people say assembly is dead!



Tue, 11 Nov 2003 10:00:16 GMT  
 Doing assembly and really doing assembly

Quote:

> In many programming forums you'll find fairly young programmers who
> are willing to share their experience.  It often goes something like
> this:

> basic 13 yrs old
> pascal 14 yrs
> assembly 15 yrs
> c 16 yrs

> Having just been struggling with 8086 & 386 adressing modes (thanks Mr
> Hyde, AOA is an excellent book) I'd have to conclude that when people
> say they've 'done' assembly they mean they've dabbled in it, maybe
> called some interrupts, but no more.

In some cases, I'm sure this is true...because I have met people who claim
"I've done assembly" or "I've done C", so I think: "Oh great, someone to
talk to about this stuff"...so, then I say something that I'd consider
pretty simple and just get balnk stares...now, I know I often talk such {*filter*}
that even a major expert would give me the odd blank stare but I was talking
simple stuff clearly with none of my usual mad ideas or anything...and they,
basically, didn't have a clue...

And I wouldn't say this is an "assembly only" thing because I find similar
things with C and BASIC and PASCAL...and it's almost guaranteed with C++
because the amount of people who use C++ as just C with some more keywords
is embarassingly big...they don't seem to get the OO stuff at all (this is
even with the people who I met at university doing advanced courses in the
subject, for Pete's sake :)...I'd look at their C++ code and see every
single OO "sin" possible in there...you know, pieces of code that invalidate
proper code re-use or spoil making the code modular...and then I'll give
them the benefit of the doubt and assume it's a design decision, maybe (code
doesn't have to be theoretically perfect, yeah? :) but then I ask them about
why they did such and such and, again, blank stares met with "what's
blah-blah-blah mean?"...

So, yes, I've seen this with some people...so you might have a point here
but I'm not sure about how often this happens...or that it's a "newbie" only
thing...I mean, some newbies are really cool and seem to take to ASM like a
duck to water...you say something and it's instantly and properly
understood...and, within weeks, you're almost starting to panic that they're
going to be better than you pretty soon...hehehe ;)

Quote:
> I've written little mouse routines with inline ASM & Interrupts,
> that's hardly the big time!

I suppose...but then what's the requirements here? If we're learning to
program for your average common or garden "database programming using Access
and some C" then you're way too overqualified for that job description, just
by knowing what an interrupt actually is...hehehe...you see what I mean?
These things are somewhat relative...it might be "small time" compared to
writing an entire OS in assembly but it's "big time" for the sorts of
programming requirements you'll find in a majority of programming
projects...most programming out there is about clicking on icons in Access
or simple SQL queries or making pretty HTML pages...so, to a majority of
people, you are certainly "the big time" with that program :)

Quote:
> Unless I'm slow I'd contend that learning assembly in a meaningful
> way, so as to produce useful applications, takes quite some time and
> that most people who tackle it close the door before it get's really
> hard, or really rewarding.

> Is that a fair assessment?

Well, going only by the sorts of things I see around me (which hardly
constitutes proof...I'm not looking for these things, I'm trying to remember
if there's any pattern in hindsight :)...I would guess assembly does have a
quite high "drop out" rate to it...well, I've met people who think things
like: "Yeah! Assembly is cool...things go really fast and it's a clever
thing to do" and then get disappointed because they can't immediately get to
grips with it...some will try to persevere for a bit...bnt those that stay
the distance aren't as much as you'd get with other programming languages,
I'd guess (as I say, no real proof, just the feeling I get from things I've
seen:)...

I can't remember where I heard this but there's a saying (or is it a song
lyric? I have a terrible memory at times) that sums this - and other things
in life - very well: "Expectation is the surest way to spoil a party"...they
expect miracles of assembly and when they find out it's quite awkward and
the CPU is a bit dumb, they get disillusioned and disappointed and lose
interest...a pity because those "miracles" they were expecting means they
have big imaginations and lots of enthusiasm and big dreams..which, if
they'd stay the course, would be handy things to have in our "genepool" :)

Quote:
> Anyway, I'm really impressed by how very *tiny* and fast my little ASM
> experiments become when compiled and pretty e{*filter*}d about how I could
> use a mix of HLL and ASM to speed up and fine tune my programs.

Good; The e{*filter*}ment and enthusiasm is there _after_ you've had a
go...that's a good sign...the people who just dabble get all e{*filter*}d
beforehand, have a minor go at things and give up (but mentally justify this
as: "I've 'done' it now" :)...

I think the perfect analogy would be to term this as "premature
ejaculation"...got a little bit too e{*filter*}d and wore themselves out before
anything had really got started...hehehe :)

Quote:
> To think some people say assembly is dead!

Yes, but then people often confuse being not very fashionable with the term
"dead"...not quite the same thing...if you caught the "Latin" thread in here
before, then there was pages upon pages of reasons to suggest this is dumb
thinking...it's a bit too fresh to repeat them so soon but, rest assured, we
whipped that "professor"'s {*filter*}that said assembly was as dead as
Latin...hehehe:)

Beth:)



Wed, 12 Nov 2003 10:12:18 GMT  
 Doing assembly and really doing assembly
Quote:
>C is the best choise for programming, but ... its not free, or

not-easy-to-get-it

Not true!

Get yourself a free Unix shell acount at:
http://grex.{*filter*}space.org  or
http://www.*-*-*.com/

Those websites should explain how to telnet to their computers and run a
newuser program to create your account.  Just run telnet from your DOS prompt,
or run Hyperterminal from Windows, or whatever terminal emulation you care to
use.

Then you have access to C compilers for free, and the accounts ARE easy to get.

If you eventually decide that you can deal with the hard-to-get part, get DJGPP
for free at:
http://www.*-*-*.com/

There's a lot of rigmarole to go through to figure out what you need to
download, what directories you need to put it in, and how to set up an
environment variable correctly.  Not insurmountable, but it will probably take
some trial and error to get the whole thing working right.  But then you don't
need to figure it out again!  And you have a free C compiler on your local
system for life!   Yayyyy

Nelson



Sat, 15 Nov 2003 04:30:33 GMT  
 Doing assembly and really doing assembly


Quote:


> C is even more advanced than Pascal,

No it's not. The original (K&R) is more like portable assembler, and the
modern language is similarly lax in terms of error checking. What are your
criteria for 'advanced'?

Quote:
> offers lots of various functions (I bet at least 10
> times as many than in Pascal),

Which Pascal? I do believe that C, when written as Brian & Dennis originally
intended, is quite elegant (with the exception of the type declaration
syntax and unary prefix asterisk (*) being the dereference operator). The
library complements this elegance; in particular, the string functions are
brilliant simply because they *do so little*, and are so reusable.

Many of the advantages that C has are better implemented in a more type-safe
pattern: pointers replaced by (say) iterators in C++, etc.

Quote:
> it has support for pointers which is very powerful

Overloading arithmetic operators to work with pointers doesn't make the
language any more powerful; it can increase or decrease readability
depending on how it is used, and certainly opens up many more traps for the
unwary.

Quote:
> it doesn't require strict type casting.

This is not an advantage.

Quote:
> The syntax is also consistent and very reach, more reach
> than in Pascal and basic added up together.

(Your use of 'reach' in this context is ungrammatical; 'reach' can be a noun
(my reach is longer than yours) or a verb (I reach for the cup), but not an
adjective (like 'consistent' is); I think you mean to say that the syntax
has a broader scope (i.e. allows more interaction with the machine). Sorry
for my pedantry :).

I'm afraid I disagree! :) Pascal can do anything C can; just do a little
typecasting.

Quote:
> But here is the main problem. It's really hard to start
> programming in C and takes time to do things right (or
> one may never learn how to do things right in C), that's
> all because of its complexity,

C is not a complex language. It is in fact a very small, simple language. It
is the library that gives it power. C++ on the other hand...

Quote:
> type casting pointers (normally, pointers are heavily used
> in advanced programs

C forces the use of pointers where other languages have wrapper libraries; C
is really only a little above assembler in the freeness of its syntax.

Quote:
> When it comes to C and things like &, |, ^, !, what may seem to
> be logical, is not. [...] One has to know exactly what
> has higher priority, what lesser, and what is between the two.

Brackets come first, then multiply & divide, then add & subtract. If it gets
more complex than that then add brackets to make the syntax clear. Unclear
syntax attracts bugs.

Quote:
> If all of these things are not taken in account, powerful C
> is basically useless...

Pointers? Sure - but understanding them applies to most imperitive
languages. Operator precedence? No. 'Funny' operators? Hardly.

These things are not making C 'powerful'.

Quote:
> Just for a record, C makes me thinking much more than
> Pascal or ASM does, it's not something I like very much...

C has a broken function pointer declaration syntax; in general, type
declarations and pointer dereferencing need to be changed to make the
language easier to understand. Type declarations as they stand have to be
read from the inside out and from right to left; the situation isn't nearly
as bad as it is in C++ though.

-- Barry
--
  One must sometimes choose between expressiveness, safety, and
  performance. But a scarcity of one isn't always excused by an
  abundance of another. - Thant Tessman
Team JEDI: http://www.delphi-jedi.org
NNQ - Quoting Style in Newsgroup Postings
  http://web.infoave.net/~dcalhoun/nnq/nquote.html



Sat, 15 Nov 2003 09:34:13 GMT  
 Doing assembly and really doing assembly

says...

[ ... ]

Quote:
> No it's not. The original (K&R) is more like portable assembler, and the
> modern language is similarly lax in terms of error checking. What are your
> criteria for 'advanced'?

No, it is not.  Modern C uses prototypes for functions, which means
the compiler can (and will) catch mismatches between types of real
and formal parameters, just like Pascal does.

Quote:
> I'm afraid I disagree! :) Pascal can do anything C can; just do a little
> typecasting.

Pascal, as originally defined by Jensen and Wirth (and I believe also
as defined by the ISO and ANSI standards) doesn't HAVE type-casting
at all.  The closest you can get is to use a discriminated union,
which (according to J&W) does not give defined results.  Even then,
you get only the equivalent of what C++ would calls reinterpret_cast,
not the equivalents of static_cast, const_cast, etc.

Quote:
> Brackets come first, then multiply & divide, then add & subtract. If it gets
> more complex than that then add brackets to make the syntax clear. Unclear
> syntax attracts bugs.

I'm guessing you mean parentheses rather than brackets.  Brackets are
the square ones ("[" and "]").  The curly ones ("{" and "}") are
braces, in case you care.

Quote:
> C has a broken function pointer declaration syntax; in general, type
> declarations and pointer dereferencing need to be changed to make the
> language easier to understand. Type declarations as they stand have to be
> read from the inside out and from right to left; the situation isn't nearly
> as bad as it is in C++ though.

What, exactly, do you see about C++ type declaration syntax that's
any different?  About the only difference I can think of at all is
the (rather minor) addition of references.

--
    Later,
    Jerry.

The Universe is a figment of its own imagination.



Sun, 16 Nov 2003 09:06:11 GMT  
 Doing assembly and really doing assembly

Quote:





>> C is even more advanced than Pascal,
>No it's not. The original (K&R) is more like portable assembler, and the
>modern language is similarly lax in terms of error checking. What are your
>criteria for 'advanced'?

I learned Pascal quite well before I ever even looked at C code.  I knew
several assembly languages before I learned Pascal.  C is more powerful
than Pascal.  Pascal protects lame programmers from their own ignorance
much better than C does.  

The trade off os simple.  If you want tight, very fast code, write it in
assembler, but plan on spending a lot of time doing the job.  If you don't
give a damn about efficiency COBOL or Pascal or interpreted BASIC will do
and you can write the code in a jiffy.  C falls somewhere in between.  It's
what I consider a "mid-level" programming language.

Quote:
>> offers lots of various functions (I bet at least 10
>> times as many than in Pascal),
>Which Pascal? I do believe that C, when written as Brian & Dennis originally
>intended, is quite elegant (with the exception of the type declaration
>syntax and unary prefix asterisk (*) being the dereference operator). The
>library complements this elegance; in particular, the string functions are
>brilliant simply because they *do so little*, and are so reusable.
>Many of the advantages that C has are better implemented in a more type-safe
>pattern: pointers replaced by (say) iterators in C++, etc.

One of the main problems with C is that it can get very hard to follow.
It takes work to make a typical Pascal program hard to read.  Assembly
language code may be difficult to read at a glance, but if you just walk
thorough it, there is not much of a problem figuring it out.  C offers
just enough abstraction opportunity to allow for needlessly unfathomable
code.

Each language has its place, IMHO.

Regards,
Mark

--
  "There is a very fine line between love and nausea."
     -- James Earl Jones as King Jaffe Joffer in the movie "Coming to America"

  "Give a man a fish and you feed him for a day; teach him to use the Net
        and he won't bother you for weeks." -- unknown



Sun, 16 Nov 2003 12:06:11 GMT  
 Doing assembly and really doing assembly


:The trade off os simple.  If you want tight, very fast code, write it in
:assembler, but plan on spending a lot of time doing the job.

This is a myth which I am tired of hearing. It has some element of truth
for people who have only a casual knowledge of assembler, or who have
never taken the time to set up a proper assembly development environment.
However, a good assembly language programmer working with a good
development environment can code, test, and debug a program in assembler
just as fast as he or she could in C. If you have some evidence to the
contrary, please share it with me.

-- Chuck Crayne
-----------------------------------------------------------

-----------------------------------------------------------



Sun, 16 Nov 2003 12:31:17 GMT  
 Doing assembly and really doing assembly

Quote:

> > C is even more advanced than Pascal,

> No it's not. The original (K&R) is more like portable assembler, and the
> modern language is similarly lax in terms of error checking. What are your
> criteria for 'advanced'?

Have I ever referred to K&R?
To advanced I'd inlude the following:
- many data types (signed/unsigned, byte/word/dword/qword-long, special
types like wchar_t, size_t, etc)
- unions in addition to structures
- ability to deal with bit fields
- postfix notation
- assignment of initial values to variables, assignment of several variables
at once and doing assignment+comparison in single line
- preprocessor
- pointers to functions, function prototypes (especially for forward
referencing, however this might be present in pascal compilers too)
- things like volatile, static and const
- functions with arbitrary number of parameters
- ...
- and as I mentioned elsewhere, lots of functions in the standard library
with possibility of doing same (or nearly same) things several ways

Quote:
> > offers lots of various functions (I bet at least 10
> > times as many than in Pascal),

> Which Pascal?

Dunno. Give me something like c99, but for pascal, I'll tell you... Still, I
have never seen in pascal that many functions. I guess there have not been
many changes in it sice it appeared 1st time... Borland added some custom
stuff to suite needs of MSDOS programmers, then made some improvements in
Delphi, but it looks like Pascal is still rather small thing if we don't
take in account particular implementations.

Quote:
> I do believe that C, when written as Brian & Dennis originally
> intended, is quite elegant (with the exception of the type declaration
> syntax and unary prefix asterisk (*) being the dereference operator). The
> library complements this elegance; in particular, the string functions are
> brilliant simply because they *do so little*, and are so reusable.

I haven't said anything about C being elegant or not elegant, though it is
indeed quite elegant.

Quote:
> Many of the advantages that C has are better implemented in a more
type-safe
> pattern: pointers replaced by (say) iterators in C++, etc.

I'm not talking about C++ and OOP.

Quote:
> > it has support for pointers which is very powerful

> Overloading arithmetic operators to work with pointers doesn't make the
> language any more powerful; it can increase or decrease readability
> depending on how it is used, and certainly opens up many more traps for
the
> unwary.

Pointers make it powerful. Compare with basic :) Then go to pascal and see
intermidiate variant of having support for pointers but not very good,
though definetely better than nothing.

Quote:
> > it doesn't require strict type casting.

> This is not an advantage.

Right, and many ppl abuse this property thereby putting bugs into the
software.

Quote:
> > The syntax is also consistent and very reach, more reach
> > than in Pascal and basic added up together.

> (Your use of 'reach' in this context is ungrammatical; 'reach' can be a
noun
> (my reach is longer than yours) or a verb (I reach for the cup), but not
an
> adjective (like 'consistent' is); I think you mean to say that the syntax
> has a broader scope (i.e. allows more interaction with the machine). Sorry
> for my pedantry :).

I've never pretended to have an absolutely correct English (spelling,
grammar, pronon... <- finish this word yourself :) And I will not. I'd
probably go further and tell you that my native language is time to time
incorrect :) but of course the difference is huge between the two.
Anyway, this is an irrelevant issue here.

Quote:
> I'm afraid I disagree! :) Pascal can do anything C can; just do a little
> typecasting.

Again, I've never told one can't do same things in Pascal as in C. It's
possible to do exactly same things in both though this may require some
additional tricks or just extra lines in the source code. I do know that
very well, you're not telling me something I'm not aware of.

Quote:
> > But here is the main problem. It's really hard to start
> > programming in C and takes time to do things right (or
> > one may never learn how to do things right in C), that's
> > all because of its complexity,

> C is not a complex language. It is in fact a very small, simple language.
It
> is the library that gives it power. C++ on the other hand...

You tell me... Have you ever tried yourself to get started with let's say
Turbo C after using Turbo Pascal for several years? I bet the answer is no.
As I mentioned, there's lots more features in C in comparison to Pascal,
there's lots more functions in standard and OS specific libraries in C than
in Pascal. Of course, if we limit us to use just a small fraction of all the
facilities of C, then we can say it's small and simple. But in whole, it's
not.

Have you actually read the part about me going to Brainbench.com and trying
there to pass a C test? If you have, you should have actually thought about
what's been written... The point is simple, vast majority of programmers
choose C and yet they can't program in it right. This is close to the
disaster, however, I hope visual/rapid/whichever development will hide from
programmers most of dirty stuff they may naver manage to do right on their
own.

Quote:
> > type casting pointers (normally, pointers are heavily used
> > in advanced programs

> C forces the use of pointers where other languages have wrapper libraries;
C
> is really only a little above assembler in the freeness of its syntax.

So your last sentense just proves the fact of C being complex. Doesn't it?
:)

Quote:
> > When it comes to C and things like &, |, ^, !, what may seem to
> > be logical, is not. [...] One has to know exactly what
> > has higher priority, what lesser, and what is between the two.

> Brackets come first, then multiply & divide, then add & subtract. If it
gets
> more complex than that then add brackets to make the syntax clear. Unclear
> syntax attracts bugs.

That's what I do because to me it's easier to enclose an expression into a
pair of brackets. But as I mentioned, since the precedence is different in
different languages and it's not obvious how it works in C if we don't read
the book first, problems come quickly.

Quote:
> > If all of these things are not taken in account, powerful C
> > is basically useless...

> Pointers? Sure - but understanding them applies to most imperitive
> languages. Operator precedence? No. 'Funny' operators? Hardly.

Pointers and multi-dimensional arrays is the most obfuscated part of C. I'd
never need to see a book to declare any construction involving
pointers/arrays in assembly language or Pascal. That's because I know
precisely what I want and I know how to express that thing in ASM. Pascal
doesn't allow such terrible constructions as "int *(*(*i)())[5]" or similar
and requires that each construction be ...how to say... simple? and
therefore that "int *(*(*i)())[5]" thing would normally be broken down into
several type defenitions, each one is as simple as "type tarr = array of
integer;" and "type parr = ^tarr;" or something but not altogether in the
same place like in C. Again, in Pascal variable declaration is clear and can
be read from left to right in the source code w/o requiring you to go back,
for example:
pascal: var pi : ^integer; {pi is pointer to an integer, absolutely clear,
like reading a book, from left to right}
c: int *pi; // pi is a pointer to an integer, but the thing is written
backwards, hard to get used
Just make a survey among C newbies and ppl, who have programmed in other
HLLs or ASM before, what they think of such obfuscated details of C...
You'll see what I'm talking about more clearly. Or try to remember yourself
many years ago when you started C. The picture must be somewhat similar.

Quote:
> These things are not making C 'powerful'.

lol :) see the beginning of this text, there's a list of things that make it
more suitable for serious programming.
The only thing in C besides this damn pointers which I don't like is absense
of sets or to make it clear, something like sets in Pascal.

Quote:
> > Just for a record, C makes me thinking much more than
> > Pascal or ASM does, it's not something I like very much...

> C has a broken function pointer declaration syntax; in general, type
> declarations and pointer dereferencing need to be changed to make the
> language easier to understand. Type declarations as they stand have to be
> read from the inside out and from right to left; the situation isn't
nearly
> as bad as it is in C++ though.

yeah.... 75% - left to right, 25 - right to left. nice isn't it? :)

No wonder, Pascal and Ada are easy to read and fast to compile (remember
postfix notation and other similar things in C :).

Good Luck
--
Alexei A. Frounze
alexfru [AT] chat [DOT] ru
http://alexfru.chat.ru
http://members.xoom.com/alexfru/
http://welcome.to/pmode/



Sun, 16 Nov 2003 20:55:06 GMT  
 
 [ 100 post ]  Go to page: [1] [2] [3] [4] [5] [6] [7]

 Relevant Pages 

1. Doing assembly and really doing assembly

2. How much assembly language programming is done?

3. WHAT ARE THE KIDS REALLY DOING ONLINE..

4. WHAT ARE EMPLOYEES REALLY DOING ONLINE^^^

5. PIL+Tkinter query (I must be doing something _really_ stupid)

6. Assembly or .... (really multiple assignments)

7. very lethal assembly question (not really...)

8. do i really need to learn assembly?

9. Help: Really confusing C / Assembly mixing code

10. Help: Really confusing C / Assembly mixing code clax86-submit@crayne.org

11. Metacompile assembly source to assembly source ?

12. Assembly Language for TI-86 or the Z80 assembly Language

 

 
Powered by phpBB® Forum Software