Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 6th, 2005, 12:10 AM   #1
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,885
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Would somebody please mind explaining to me what assembly is like?

When I'm done with Python, assembly sounds like my kind of language.

But what is it like? Like which languages does it relate to, and what kind of skill sets does it require? And what kind of things is it generally used to program?

Thanks for any help.
Sane is offline   Reply With Quote
Old Jul 6th, 2005, 12:26 AM   #2
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
It mainly relates to imperative languages like C or Python (minus the OOP.) It requires the same skills as other programming languages, namely math, logic, and problem-solving skills. It's generally used to program things that need extremely great speed. Because humans can optimize code to be as fast as possible much better than compilers can, programming in ASM is basically required for maximum speed.

Hope this helps.
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials.
--WilliamSChips on Slashdot
uman is offline   Reply With Quote
Old Jul 6th, 2005, 12:29 AM   #3
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,885
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Hmm, so basically I'd only want this language if I was looking to make an application of great power and flexibility to what the user gives it? Say a music composer program like Finale 2004 could be made quite efficiently in Assembly?

When I turn over programming into a hobby that's probably the first program I'll want to make (a music notation program).

Feel free to correct me. And thanks for your help.
Sane is offline   Reply With Quote
Old Jul 6th, 2005, 1:08 AM   #4
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Assembly is not well suited for general purpose things. It translates directly to machine code, making it even lower level than C. In C, you call a function without batting an eye. In assembly, you have to push all your parameters in reverse order, make the call, and perhaps adjust the stack. Just the tip of the iceberg. Assembly gives you a speed boost, which in some rare cases you might actually need, and gives you access to some low-level stuff you couldn't do in C. When Assembly becomes actually useful is writing an OS. Most C/C++ compilers allow you to write inline assembly. This makes it convenient, as you can embed asm into certain functions to perform certain tasks but retain the flexibility of the higher level language. And assembly is by no means portable. x86 assembly differs from PPC assembly, etc. So basically it would be a good idea to stick with higher level languages like C, C++, Python, .Net, Java, or any of the many others. Hope that helps.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Jul 6th, 2005, 1:29 AM   #5
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
Anything that the computer can do, quite literally can be done with assembly. This is not true of Python. I just want to point that out.

I don't know what Finale 2004 is, but anything can be made quite efficiently in assembly language. The problem is that assembly language is much harder and more time-consuming to both read and write. A big use of assembly is writing an application in C or C++ and then using the __asm keyword to insert assembly. That way you can write a certain bit of code that needs to run extremely fast in assembly, while using the high-level features of the language everywhere else.

Hope this helps.
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials.
--WilliamSChips on Slashdot
uman is offline   Reply With Quote
Old Jul 6th, 2005, 6:54 AM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
Because humans can optimize code to be as fast as possible much better than compilers can
This is a problematic statement in this day and age. The BEST assembly language programmers, with a detailed knowledge of the architecture of the machine, in terms of its pipelining and so forth, should be able to beat the compiler (which is, after all, written by programmers). The average "good" programmer really hasn't a clue about optimization, rarely knows what part of the program represents a bottleneck.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jul 6th, 2005, 7:16 AM   #7
omega_red
Newbie
 
omega_red's Avatar
 
Join Date: Jun 2005
Location: Poland
Posts: 5
Rep Power: 0 omega_red is on a distinguished road
Send a message via Yahoo to omega_red
Quote:
Originally Posted by DaWei
This is a problematic statement in this day and age. The BEST assembly language programmers, with a detailed knowledge of the architecture of the machine, in terms of its pipelining and so forth, should be able to beat the compiler (which is, after all, written by programmers). The average "good" programmer really hasn't a clue about optimization, rarely knows what part of the program represents a bottleneck.
This is especially true with CPUs like Itanium - features like RISC architecture, explicit paralellism, speculative execution, predication, pipelining, register stack/rotation make it very hard to write efficient code by hand.
__________________
Vulnerant omnes, ultima necat.
omega_red is offline   Reply With Quote
Old Jul 6th, 2005, 2:59 PM   #8
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
What's your point? I'm saying what assembly is used for in the real world, not what so-so coders can do with assembly. Of course anyone using assembly for real has to be good at it.
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials.
--WilliamSChips on Slashdot
uman is offline   Reply With Quote
Old Jul 6th, 2005, 3:14 PM   #9
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
His point is that micros today aren't anything like they used to be. The processing power has come from more than increasing the clock rate. For example, because of the slow access to memory (speed of light has been a consideration since frequencies were in the neighborhood of 30 MHz or so -- the characteristic impedance of circuit traces is a definite factor), as much code (data as well) as possible is put on-chip in the cache. A branch at the wrong time can invalidate what's on tap to execute and result in waits while additional instructions are fetched. Today's processors can be doing more than one thing at once, also, so long as it's reasonably predictable what they ought to be doing (and useful, I might add). It is so far from being a mere matter of footprint or the number of clock cycles per a given instruction that it isn't even funny.

Your statement that "anything the computer can do, quite literally can be done in assembler" is a given. Assembler is a mnemonic representation of the actual op codes and operands (machine code) that directly (or through microcode) control the hardware gating signals that implement the logic. All programming languages ultimately emit machine code whether it is via compilation, interpretation, or translation/interpretation by a VM/byte code mechanism.

The subset of programmers who can deal with the complexities of all that in an effective manner is small indeed.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jul 6th, 2005, 5:20 PM   #10
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
Yes I know it's a given for you, the guy with 35 years of experience or whatever. I was just pointing out how it contrasted with Python, that's all.
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials.
--WilliamSChips on Slashdot
uman is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:56 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC