PDA

View Full Version : Wanna learn Assembly?



Pages : [1] 2 3

Garfield
06-14-2002, 08:46 PM
Assembly is the most low-level language a programmer (besides binary :rolleyes: ) a programmer can program in. It's rewarding, challenging, and most of all...it's fun!!! So, I can't see any down sides to it! Sure, it's hard to debug, but that's part of the challenge. So, why not learn this rewarding language?

See this sticky (http://64.91.238.78/forums/showthread.php?s=&threadid=1695) for Assembly sources. And, due to the fact that it's a hard language to learn and program in (the hardest! :D) you will need to ask questions. Here (http://64.91.238.78/forums/showthread.php?s=&threadid=1695) is a great board to ask those Assembly questions ;). So, think about it!

Shiro
06-15-2002, 03:27 AM
Yes, assembly is a nice thing. However, I only use it for the real low-level stuff, implement time-critical things etc. A disadvantage of assembly is that it is hard to maintain. Another disadvantage is that it is platform dependent. Therefore I prefer writing software in C or C++ so porting to a different platform is easier. But anyway, it is nice and you learn a lot about the archictecture of the processors and other hardware you're using.

golfinguy4
06-15-2002, 08:13 AM
Just out of curiousity, why are you recruiting? Things are not that empty there, are they??

Sorensen
06-15-2002, 08:19 AM
>So, I can't see any down sides to it!

Ok, give me an example of an advanced data structure using IA32 asm.

Sunny
06-15-2002, 09:35 AM
Well guys. You gotta admit, assembly is after all the basis of all programming. No assembly, no funny. All c programs are converted to assembly trough the compiler. And yes, assembly always comes in handy...:P


Stef

Sorensen
06-15-2002, 10:38 AM
>Well guys. You gotta admit, assembly is after all the basis of all programming.

Yep, but there's no common language called assembly and no rules that any assembly language has to follow. So following on from this, the basis of all programming could mean anything.

>And yes, assembly always comes in handy...:P

No, it doesn't.

tgm
06-15-2002, 10:40 AM
When using inline asm in a C/C++ program, do you think you actually get those lines translated exactly or do you think the compiler still tries to optimize what you've done?

Sorensen
06-15-2002, 10:44 AM
>do you think you actually get those lines translated exactly or do you think the compiler still tries to optimize what you've done?

If it did, it would mean inline asm was pointless.

mix0matt
06-15-2002, 10:48 AM
i agree with Sorensen...assmembly is a waste of time. Most decent C compilers generate code that is fast enough, and C is portable (more or less). Assembly programmer's are basement dwellers who enjoy avoiding the outdoors or fear time away from the computer....if you're into that, then go for it...

just ask your self this: why are the trends in software development moving towards cross compatibility (the future) and not toward "hard coding" into one processor (the sixties)?

Shiro
06-15-2002, 11:35 AM
>assmembly is a waste of time

Assembly is not a waste of time. There are a lot of things you can't do in a high level language, even C. For example, hardware interfacing and other low level stuff can usually only be done in assembly. C doesn't support such.

>Most decent C compilers generate code that is fast enough, and
>C is portable (more or less).

Modern C compilers do very good optimization.

>just ask your self this: why are the trends in software
>development moving towards cross compatibility (the future)
>and not toward "hard coding" into one processor (the sixties)?

There still is a very large variety of processors, so we still need assembly. I believe that coding for a specific processor will be necessary for a long time, since some applications just require a specific processor. Just think about the DSP's and microcontrollers.

There are still new processors introduced. Every new processor comes with it's own instruction set. Even the Intel x86 processors have instruction sets which are not equal to the older processors. To make optimal use of the new functionalities, code has to be rewritten, in assembly. And the Intel series is just one example of the many, many processors in the world.

golfinguy4
06-15-2002, 04:06 PM
Originally posted by mix0matt
...assmembly is a waste of time...

Would you like to explain to me how your great higher-level languages are made? Hint, they use a language that rhymes with bassembly.

ygfperson
06-15-2002, 07:48 PM
learning assembly is not essential, or even necessary most of the time. it's interesting, and its fun to know exactly what happens and why. hand-coded sections of code can be faster in time-critical tasks. but for most programmers, assembly is not needed.

vasanth
06-15-2002, 09:20 PM
well for normal computer application development etc etc you do not require ASM but forget the feild of computers.. There are many electronic feilds that use their own processor in devices.. ASM is required here.. In case you are good with it, it means you have a wide range of area to choose from......

Garfield
06-16-2002, 05:29 AM
I don't know, I don't like a compiler doing everything for me. And, mind you, a terrible Assembly programmer won't write a better and faster program than a great C/C++ program. It depends on the programmer and his ways...

vasanth
06-16-2002, 06:10 AM
Well i dont like playing around with my computers registers, memory and so on and scre it up.. Any way learning ASM is godd.. But it does not help me in building application...

Shiro
06-16-2002, 09:05 AM
>But it does not help me in building application...

The need for assembly is application dependent. I wonder if most programmers can really add something useful to the results a modern optimizing C compiler gives.

But anyway, going back to the original question of the thread, there is nothing bad in wanting to understand how a microprocessor works and how to use its instruction set. In fact, it is never bad to learn.

mix0matt
06-16-2002, 09:18 AM
>>The need for assembly is application dependent. I wonder if most programmers can really add something useful to the results a modern optimizing C compiler gives. <<

This is all I was trying to say...the "waste of time" comment was hyperbole.

>>But anyway, going back to the original question of the thread, there is nothing bad in wanting to understand how a microprocessor works and how to use its instruction set. In fact, it is never bad to learn.<<

couldn't agree more...in fact i think this is where the usefulness of assmebly should end for most programmers...

>>Would you like to explain to me how your great higher-level languages are made? Hint, they use a language that rhymes with bassembly.<<

yeah sure...most of the major compilers and interpreters are coded in C/C++...GCC, VC++, python, perl,...i could go on, but i think you get the point.

Garfield
06-16-2002, 09:51 AM
What you can do with Assembly, is write your own Operating System. That's what I'm doing with it...

vasanth
06-16-2002, 09:58 AM
I too want to lean ASM but i am not able to have a good start at it..

Shiro
06-16-2002, 10:11 AM
>What you can do with Assembly, is write your own Operating
System.

That's just one of the applications. I usually only use it when having to do low level stuff. For the other things I trust my compiler and I the libraries I'm using are highly optimized. At least, it is what their documentation say. :)

golfinguy4
06-16-2002, 05:11 PM
Originally posted by mix0matt
>>Would you like to explain to me how your great higher-level languages are made? Hint, they use a language that rhymes with bassembly.<<

yeah sure...most of the major compilers and interpreters are coded in C/C++...GCC, VC++, python, perl,...i could go on, but i think you get the point. [/B]

Did you read what I said? I said the languages themselves, not the compilers. i.e. C++, C, I could go on, but I think you get the point.

mix0matt
06-16-2002, 06:01 PM
>>Did you read what I said? I said the languages themselves, not the compilers. i.e. C++, C, I could go on, but I think you get the point.<<

maybe i'm the moron here, but can you explain to me how you "make" a language...

Hillbillie
06-16-2002, 06:28 PM
>maybe i'm the moron here, but can you explain to me how you "make" a language...<

"Making" a language simply involves writing a specification for programmers to go by. To get anywhere with the language though you'll need a compiler or another tool to translate your language source code into machine language. The compiler is defined _around_ the language, not the language around the compiler. Although, Basic is a different story...

Garfield
06-16-2002, 08:43 PM
>> Although, Basic is a different story... <<

Really? How so? I dont' really know the history of Basic...

billholm
06-16-2002, 10:47 PM
Oh no! I think I'm going to fart... PROOOT!!!

Shiro
06-17-2002, 11:53 AM
A programming language is just a mathematical concept. Designing a programming language requires developing an alphabet and grammar.

To make the language usable, you need to create tools like a compiler. The compiler translates your language to a language your machine understands, which is machine language. Or you can compile to assembly and let an assembler translate the assembly to machine language.

Garfield
06-17-2002, 12:18 PM
>> Or you can compile to assembly and let an assembler translate the assembly to machine language. <<

This would probably be easiest, but who's here writing their own language? I'd support you the whole way. That's pretty neat. When I get to it in my OS dev, I'm probably going to have to write my own API and, maybe, my own language :D...

VBprogrammer
06-18-2002, 04:41 PM
Hello! Get a grip!...

Sorry but you guys need some harsh words!

If we all took the same approach to programming we'd all be using VB. Slow, Weak but easy as hell to learn and maintain.

ASM gives you complete control, did you know C uses the stack to hold local varribles? Did you know how slow this is! I can use lots of techniques to avoid this (such as using special purpose regs as general purpose regs when i dont need them), C will just fire ahead without an e-thought. Byte for Byte any well writen ASM program will beat a C program hands down. Hech, if C's so high and mighty why, then, does just about every C compiler support in-line assembly!

Your line of argument reminds me of a car advert thats been on tv alot. "Why invent the light bulb when candles are OK." Come on guys your just being plain sad!

Compuboy
06-18-2002, 04:49 PM
&nbsp;&nbsp;I really can't understand anyone who says that ASM is now obsolete, which a lot of people here seem to think. I just couldn't believe my eyes!

&nbsp;&nbsp;ASM is at the heart and center of everything. Machine code and ASM are directly interchangable. That means that as long as there is machine code, there will always be assembly. No OS can ever be written without assembly and most decent programs have a good deal of ASM in them, as well.

&nbsp;&nbsp;I recently downloaded the new version of DJGPP. It may well be state-of-the-art or whatever, but it's completely changed its naming conventions and has just got too complicated for its own good. I've been forced to start work on my own little C-to-ASM converter. What's the programming world coming to?

Mario
06-18-2002, 05:04 PM
>> Hech, if C's so high and mighty why, then, does just about every C compiler support in-line assembly!

It seems to me rather ridicule to be discussing Assembly as the only and one answer to all the problems in life in a C/C++ forum.

I could understand it on an Assembly forum by people that never took the time to know exactly what C/C++ can do for them. Here? Well here it just looks silly.

>> Your line of argument reminds me of a car advert thats been on tv alot. "Why invent the light bulb when candles are OK." Come on guys your just being plain sad!

Well, conversely, yours seem a bit like "Why using jets, if cheaper cars can get you there?"... it may be cheaper. It may be powerful. It may allow for sight-seeing. But it's damn slow to code and hard to debug in comparison.
What is asked these days when coding a project? I'm sure I don't need to tell you. But nonetheless, do it as quickly as possible. Do it as I asked. Do it so that code can be easily changed/upgraded so that we can add new features on future (payable) versions.

Now do that in Assembly.

Note: I actually prefer cars to planes, mind you. But I'll leave the comparison at it.

Some embarrassing typos. Corrected...

Garfield
06-18-2002, 07:49 PM
Honestly, I can only think of a couple of reasons why one wouldn't want to program in Assembly...

-not up to (or afraid of) the challenge
-not willing to stare at code for a while (while program if you don't want to???)
-not wanting to write the fastest functions/programs possible

And, why are we programmers if you aren't 1) up to a challenge and 2) you don't want to spend time debugging challenging code and 3) you don't want to write the...best code!!!

Can somebody explain this to me??? :confused:

golfinguy4
06-18-2002, 09:29 PM
Assembly is good, but only when needed. For example, if C is fine, use C. Why not use the technology if it's there? However, there will almost always be a need for asm, so it is good to know. However, if one is writing a large complicated application, using asm (for the whole thing) would be ridiculous. It would make the code so long and painfully ugly to read that it would take much longer to complete the app and fix problems.

billholm
06-19-2002, 01:55 AM
>would make the code so long and painfully ugly to read that it would take much longer to complete the app and fix problems.

Yah painfully ugly! You said the best line I've heard in weeks. :)

Developing under assembly is very tedious. Furthermore, the resulting code won't be easily portable because it is hardware dependent.

That's why good programmers choose C for optimum efficiency-- it creates low-level, fast, and easily portable code. :cool:

billholm
06-19-2002, 01:56 AM
>would make the code so long and painfully ugly to read that it would take much longer to complete the app and fix problems.

Yah painfully ugly! You said the best line I've heard in weeks. :)

Developing under assembly is very tedious. Furthermore, the resulting code won't be easily portable because it is hardware dependent.

That's why good programmers choose C for optimum efficiency-- low-level enough to make fast but easily portable code. :cool:

Fordy
06-19-2002, 02:07 AM
I understand the thinking of people like Compuboy (who spends his time writing stuff that's about as low level as you can go :)), and people who use inline assemblers for games, but for most platform applications, ASM is too tedious......

Wow...I might have an app that takes virtually no disk space (when diskspace costs zip) and can do things in a few less cycles (as if its often noticable!)....but compare that with code that is hard to manage and has real portability problems (not just between platforms but between assemblers) then you should agree that C++ is the daddy!!.........

I started to write a notepad clone in TASM a few months back....did quite well...it came up on screen....had icons, menus and invoked a few system dialogs (for printing, text searching and opening files) and actually managed to open files and display them....but it got way too tedious after a while.....and I havent got anywhere near to finishing it.......

tim545666
06-19-2002, 02:15 AM
Wow...I might have an app that takes virtually no disk space (when diskspace costs zip) and can do things in a few less cycles (as if its often noticable!)....but compare that with code that is hard to manage and has real portability problems (not just between platforms but between assemblers) then you should agree that C++ is the daddy!!.........
Well, according to your logic, Java should be the daddy.

Fordy
06-19-2002, 02:23 AM
Originally posted by tim545666
Well, according to your logic, Java should be the daddy.

No need to go over the top now!!! :D

dirkduck
06-19-2002, 02:26 AM
"This would probably be easiest, but who's here writing their own language? "

Well im writing a compiler currently.

Troll_King
06-19-2002, 02:37 AM
I think that you might need to use some assembly to write device drivers. Other than that, you are much better off using an OOP language, infact C is basically too low level for large scale projects. Ofcourse it is impossible to get away from C, since all OS's that I know of are written in C.

The best course of action in my opinion is to use the UML and a process in order to document all of the details including the user needs and the scope. A process assists construction, they are using an interative and incremental approach these days, much better than the waterfal methodology.

Compuboy
06-19-2002, 03:39 AM
&nbsp;&nbsp;OK, I admit that C is often better when higher-level code is required. I often use C and C++ to write my more complicated programs. I do, however, believe that anyone who wants to become a decent programmer should have at least a basic understanding of ASM. Whenever I'm programming in C/C++, I'm constantly aware of how slow the code will run compared to an ASM equivalent. When it comes to very complex code, of course, C/C++ usually becomes easier to write and maintain.

Troll_King
06-19-2002, 03:53 AM
Speed is nonesence. The real issue is learning ASM or C for the sake of planning software architectures. If you are writting programs for embedded technology than that might be a different story, but to be honest I don't believe that anyone here is writing large scale programs, nobody seems to know screw all about project management and process.

Mario
06-19-2002, 04:45 AM
>> but to be honest I don't believe that anyone here is writing large scale programs, nobody seems to know screw all about project management and process.


Quite wrong there. But it's my word against yours :)
Now, you ask a programmer involved in the development of IBM's latest database management toy, DB2, what he knows about project and process management and he may reply he knows squat. And that doesn't mean he's not involved on a large scale project. That's why some of us are programmers and some of us are project managers.

Troll_King
06-19-2002, 04:55 AM
Still a programmer must know the requirements captured in the use case. Other programmers must integrate their classes into the system as a whole and they must follow construction guidelines. Being a developer is not all about writing code. Most of it is not about writing code, but instead planning.

Mario
06-19-2002, 06:17 AM
Case Tools are among us for a long time and the UML standard have already stabilized and become a defacto for a long time. First time I used Rational case software it was like what?... 5 years ago?

Trust me. There's a lot of people using it. There is still traditional analysis, mind you. Many developing teams still go from the usual ERDs and DFDs and such directly to code with few to no problems at all, even on large scale projects. UML is meant to ease the transition. It doesn't substitute any of the steps and it surely is not an absolute truth. It's there for those who are enlightened enough to appreciate the advantages.

But sticking to the subject line of this thread... it's somewhat amusing that by evolving the discussion to case tools we are indeed getting even further away from Assembly as an all-around solution for software development ;)

Garfield
06-19-2002, 08:18 AM
Originally posted by Troll_King
I think that you might need to use some assembly to write device drivers. Other than that, you are much better off using an OOP language, infact C is basically too low level for large scale projects. Ofcourse it is impossible to get away from C, since all OS's that I know of are written in C.

The best course of action in my opinion is to use the UML and a process in order to document all of the details including the user needs and the scope. A process assists construction, they are using an interative and incremental approach these days, much better than the waterfal methodology.

>> I think that you might need to use some assembly to write device drivers. <<

Device drivers are written in most assembly because of the necessary low-level ness needed of the hardware.

>> infact C is basically too low level for large scale projects. <<

C can do everything C++ can do. OOP is only for organization...

>> Ofcourse it is impossible to get away from C, since all OS's that I know of are written in C. <<

There have been operating systems written in full Assembly. In fact, I'm writing my OS in full Assembly! :D

Unregistered
06-19-2002, 11:03 AM
Why did this thread go into a debate between assembly and everything else? :(

>>> Ofcourse it is impossible to get away from C, since all OS's that I know of are written in C.<

Err...Menuet (http://www.menuetos.org/)? If you think C is a requirement in OS development, you might want to brush up. :)

tim545666
06-19-2002, 11:07 AM
>> infact C is basically too low level for large scale projects. <<

C can do everything C++ can do. OOP is only for organization... Yes, and asm can do everything c/c++ can do. But I think what he's saying is it's much easier and faster to write a large scale project in c++.

Shiro
06-19-2002, 11:36 AM
infact C is basically too low level for large scale projects.


Though C is still used a lot in very large scale projects. In embedded systems, C is still one of the most used languages, though C++ is coming up, since embedded software is growing and growing. Object orientation makes designing large systems easier. Design goals like re-use of software and maintainability are very well supported by object orientation. These and more reasons have lead to object oriented design methods being most used today. It is very well possible to implement object oriented designs in C or ASM, but more efficient is using a language which supports object orientation, like C++ or Java.



The best course of action in my opinion is to use the UML and a process in order to document all of the details including the user needs and the scope. A process assists construction, they are using an interative and incremental approach these days, much better than the waterfal methodology.


The purpose of a process is not to document all the details. Processes are defined to make clear how the project members should work, they can also be used to make the process measurable. A process also guarantees a certain quality of the product.



The real issue is learning ASM or C for the sake of planning software architectures.


A software architecture is language independent. It is a set of general rules and designs, software architectures are usually not developed for just one product, but they will be used as base for many products of the same kind. The software architecture and requirements are the base for the detailed design.

UML is only a modelling language. It is a tool for describing software models.

*
06-19-2002, 01:54 PM
infact C is basically too low level for large scale projects.


Untrue. C is fine for any size project you care to write, large or small. The absurdity of your statement shows either your ignorance, your lack of experience, or your age. The problem with "today's generation" is they, like Al Gore, seem to think they invented everything.

As for 'asm' .v. 'C', there is no such issue at stake. Both are valid, right place, right time.

As for why it is good to know assembler, if you aren't smart enough to understand why it is a good thing, then you have no business developing code. Choose something else, so you're not wasting our time.

As for developing code in assembler-- it's no harder than any other method. Simply more tedious until you build up a library of code to draw from.

I am apologizing, in advance, but it's got to be said: STOP bickering over crap practically none of you understand! That has got to be the _*biggest*_ turnoff on this board.

Mario
06-19-2002, 03:50 PM
>> The absurdity of your statement shows either your ignorance, your lack of experience, or your age

>> if you aren't smart enough to understand why it is a good thing, then you have no business developing code

>> STOP bickering over crap practically none of you understand! That has got to be the _*biggest*_ turnoff on this board.

Hehe... It's funny to see people like you being so stuckup when in fact none of your arguments indicate you understand it also.

It's not that I disagree with you on those parts you actually said something other than the above... It's the way you choose to make your point that really places you at another level. That of a...