Currently I am a VB programmer... I was thinking about exploring ASM, but I need to know, is it worth my time? Would you recomend a VB programmer to switch to ASM?
Printable View
Currently I am a VB programmer... I was thinking about exploring ASM, but I need to know, is it worth my time? Would you recomend a VB programmer to switch to ASM?
Of course it is, every college in the world requires computer science majors to learn asm. They do that because you'll never know "why" until you learn asm.Quote:
Originally Posted by Oblivion02
Ignore the people who say no, they probably have never written a line of asm in thier life.
You probably wont use ASM often (if ever after you've learnt it), but there is no question that it helps you write better/more efficient code. I only used it briefly when I was at school, but it is still helping my code about 10-15 years later.
VB hides so much from you that you cant see where some issues (mainly speed related) arise. Each VB command converts into multiple ASM statements, and it is useful to see what is effectively going on "behind the scenes".
True :)Quote:
Originally Posted by Maven
I took one look at an asm tutorial and ran back to my beloved vb and c++
:wave:
LOL don't let the syntax scare you off. ASM is very straight forward after you get the idea of it.Quote:
Originally Posted by ice_531
I learned it on the IBM 370, which is called BAL. It helped greatly, seeing how everything breaks down into little pieces, which are put together to make more powerful instructions possible.
MASM is so awesome, you should definetly learn it. And the syntax is not really that difficult. The only real challenge is learning how to use the registers effectively.
This is coming from someone that first learned VB, then C++. Even though it's one of the last languages I have learnt, it's still my favorite.
In ASM you are 'free' so to say. Even C++ does some default processing that you don't know about until you get into MASM32.
ASM is also alot faster than any langauge, not to mention it can generate a executable with a output of around 2kb-3kb.
See, Assembly is like the last thing left, next to the raw code that the processing unit understands.
Here's how it basically works when a program written in another langauge executes.
1) C++,VB,etc is broken down into ASM code
2)The Processing unit can understand ASM and it's OPCODES,etc, so
the ASM is then translated into raw code.
3)Now the code is raw code
That's why ASM can generate such small executables, and why it's syntax seems a little foreign.
Anyone that programs should learn ASM.
It all about "generation of the language"
Here's a quick quote from the net.
Since each generation layers on top of the prior generation, the only way to remove the "magic" is to learn the lower layer. Knowing a bit (no pun intended) about "NOR GATES" allows you to understand the chip level. Having an ASM understanding allows you to realize what the higher level languages do. Understanding 3GL allows you to create your own 4GL and 5GL syntax - that's when commercial development becomes truly efficient.Quote:
Some examples of generation languages:
2nd GL, assembler
3rd GL, FORTRAN, C, C++
4th GL, MATLAB, Mathcad
5th GL, Labview, MATLAB Stimulant
The higher the GL:
More structure is built into the language
Easier implementation
Less skill needed of implementers (users can create program, less dependence on programmer)
Less typing (built in functions)
More limited you are by the built in functions, but generally can go to a lower GL and write a routine that you need for the more specialized capabilities
Less control over bit manipulation
Quicker learning of GL
4th & 5th (and some 3rd) GL's keep track of data structure (will tell you if you get your data types mixed up)
More graphical
The lower the GL:
More instructions you will have to write
More capabilities you can create (however YOU have to CREATE them)
You can program the more complicated (unique) parts of your system
Seems like the early projects talked about in the VB forums is the "calculator". Implementing this in a 3GL is silly (efficiency wise) but smart UI wise. In my opinion VB is really a 3.5GL language - maybe even higher.
Back in my salad days I developed an "equation processor" - this would take database fields, and using my own home-grown version of RPN, evaluate a mathematical formula upon them. We eventually made it real RPN - added more than +,-,/,* capabilities and eventually put it into assembler. At that point it was a true object compiler/execution run-time.
Coding it in mainframe BASIC first was in a way a prototype, and then doing it in assembler made it quite real.
I believe my first mainframe ASM program was a routine to "swap" the case of a sentence from UPPERCASE to PROPERCASE - but do it in place, as opposed to moving it from one string space to another. Back in those days speed was a true issue, so using memory properly could be a real boost.
Learning ASM is something like learning Latin. You probably won't use it much, but if you are familiar with it, you understand what other languages are doing better.
One exception to that would be C++, where you can readily look at the ASM generated, which helps with debugging. Probably wouldn't be of much use for .NET, though.
I have to echo that. It is great to know for debuggin, and optimization of C++, so you can see why one solutiuon is faster then an other and so on.
But in real life today it is more or less only used in building the first steps in an operating systems, and for some math oddities in a game. Not much more then that. So if you don't need that, then it is more or less a waste of time to take a deep step into it. The C++ compilers are so powerfull these days that you have to be REALY good in ASM to beat it.
So my advice would be. Better to be realy good in a higer level langauge then ASM, then use a lot of time to learn it.
ØØ
That's almost a myth actually. The proper way to say it would be "Can be made faster then any other language". It takes a lot of work to optimize code in asm, some algorithms more then others. You usually end up doing some binary math to really speed up algorithms.Quote:
Originally Posted by Ambid
And if you are still not covinced. Here is my exprediment trying to speed up the C++ function sqrt(). Enjoy the reading....:)
http://vbforums.com/showthread.php?t...highlight=sqrt
Quote:
Originally Posted by NoteMe
Here is a good one:
http://www.azillionmonkeys.com/qed/sqroot.html