PDA

View Full Version : The Assembly Language



Déjà Vu
09-13-2003, 03:40 PM
I thought of trying to pick up the assembly language and learn it since everyone is
giving it credit. The problem is that I don't where to get it from, so can anyone help me??? :mellow:

4play
09-14-2003, 12:12 AM
hmm i would learn c or c++ before assembly mainly because asm is a very complex language.


here (http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=masm+download&btnG=Google+Search) microsfoft give away a free asm compiler called masn.

ilw
09-14-2003, 12:19 AM
The only things that I've really seen assembly being used for these days is cracking/disassembling programs. If you just want an easy way to start writing programs look into Delphi and if you plan on doing anything more advanced (games/graphics) go for C++.

Xilo
09-14-2003, 02:31 AM
Assembly is used in quite a few programs but they are usually only small parts where the speed of assembly is needed. The early DirectX shaders were written in assembly. It's just really impractical to make anything big in assembly, it would just take forever.

Déjà Vu
09-14-2003, 01:38 PM
I have tried to learn C++ a few months back but it seemed complex but now it looks like assmebly is much harder as you have said so i think i will try to learn C++ again. Anyway thanks for your help.

Is it true that Microsoft used Delphi to build Windows??? :o

ilw
09-14-2003, 01:42 PM
I doubt it, but delphi is very nice to use much better than visual basic and much easier to create windows applications (as opposed to command line) than visual C++.
I'd recommend you get an understanding of programming by getting something like sams learn c++ in 21 days and write some command line stuff and then if you are still hanging in there switch to delphi and write whatever programs you want. (Going from c to delphi is quite easy, its just some syntax changes you have to learn).

Amarjit
09-14-2003, 01:45 PM
Yes, Intel x86 was used to design K++, but C++ is a better alternative. Assembly involves using commands like MOV etc., to print an application saying "Hello World!" in ASM would take about a dozen lines whilst in C:


#include <stdio.h>
using namespace std;

 void main()
   {
     printf("Hello World!\n");
   }

In C++:


#include <iostream.h>
using namespace std;

 int main()
   {
     cout << "Hello World\n" << endl;
     return 0;
   }

C++ remains portable, ASM isn't but is faster.

monica_green_22
09-14-2003, 02:34 PM
Originally posted by Amarjit@14 September 2003 - 13:45
Yes, Intel x86 was used to design K++, but C++ is a better alternative. Assembly involves using commands like MOV etc., to print an application saying "Hello World!" in ASM would take about a dozen lines whilst in C:


#include <stdio.h>
using namespace std;

void main()
{
printf("Hello World!\n");
}

In C++:


#include <iostream.h>
using namespace std;

int main()
{
cout << "Hello World\n" << endl;
return 0;
}

C++ remains portable, ASM isn't but is faster.
C++ is a good language to learn as a first language, but learning assembly is also a good way to start. The learning curve is very steep, but the understanding of the architecture of modern computers that you will learn with assembly is worth it. Yes learning asm on segmented architectures is hard, but its also very interesting.

The code is faster, smaller, and very easy to debug with modern tools.

As for your code:
There is no "using" keyword in C, likewise, there are no namespaces, so your C program is incorrect. C has no concept of namespaces.

Your C++ example is very outdated (as of 1998), when the standard was published, code such as yours is no longer compliant. The header for the standard iosteam library is now <iostream> (no .h, likewise with any C++ headers).

Also, the "&#092;n" at the end of your string is redundant, as &#39;&#092;n&#39; is appended by the std::endl object, which also flushes the stream.

Portability is a key factor in deciding language, but how often have you had your cod ecompiled on a different architecture? asm remains a good choice to learn, especially seeing as the x86 architecture is not going anywhere. Itanium is still off in the distant future, and AMD Opteron/Athlon64 have full 32-bit compatibility.

Monica

monica_green_22
09-14-2003, 02:38 PM
Originally posted by Déjà Vu@14 September 2003 - 13:38
Is it true that Microsoft used Delphi to build Windows??? :o
No, it would not have been possible. Windows came first... besides, delphi requires windows (yes, with the exception of kylix and its offspring). Behind all the component architecture, and the VCL, there are still low level calls to the windows api functions, which are used the construct the components.

Microsoft did use Pascal for the early versions of Windows, before windows 3, which was a complete rewrite in C.

Monica

Ynhockey
09-14-2003, 02:45 PM
Learn Pascal first.

Benefits:

1) Easier than any of the aforementioned languages, but it&#39;s very similar to Delphi and C (in fact, Delphi uses Object Pascal).

2) You won&#39;t lose any functionality, just some freedom, but that&#39;s ok, VB gives you much less anyway.

3) Pascal was made for learning purposes, so when you learn Pascal, you&#39;ll have a really good understanding of programming (well, depends on how well you learn it...)

Pascal owns :D

monica_green_22
09-14-2003, 03:10 PM
Originally posted by Ynhockey@14 September 2003 - 14:45
Learn Pascal first.

Benefits:

1) Easier than any of the aforementioned languages, but it&#39;s very similar to Delphi and C (in fact, Delphi uses Object Pascal).

2) You won&#39;t lose any functionality, just some freedom, but that&#39;s ok, VB gives you much less anyway.

3) Pascal was made for learning purposes, so when you learn Pascal, you&#39;ll have a really good understanding of programming (well, depends on how well you learn it...)

Pascal owns :D
Pascal discourages pointer use, and has terrible array manipulation. A combination of these makes this a very bad language to learn, since you will find yourself not accustomed to using arrays efficiently.

Stick to learning from real world language, like C, C++, and perhaps if you are looking for a challenge, assembly.

Monica

Déjà Vu
09-15-2003, 12:37 PM
Is there any programming language apart from c and c++ that don&#39;t use command lines?

Ynhockey which pascal are you talking about i have found three different ones, borland pascal, turbo pascal and dev-pascal??

Amarjit
09-15-2003, 04:32 PM
Originally posted by monica_green_22@14 September 2003 - 14:34
C++ is a good language to learn as a first language, but learning assembly is also a good way to start. The learning curve is very steep, but the understanding of the architecture of modern computers that you will learn with assembly is worth it. Yes learning asm on segmented architectures is hard, but its also very interesting.

The code is faster, smaller, and very easy to debug with modern tools.

As for your code:
There is no "using" keyword in C, likewise, there are no namespaces, so your C program is incorrect. C has no concept of namespaces.

Your C++ example is very outdated (as of 1998), when the standard was published, code such as yours is no longer compliant. The header for the standard iosteam library is now <iostream> (no .h, likewise with any C++ headers).

Also, the "&#092;n" at the end of your string is redundant, as &#39;&#092;n&#39; is appended by the std::endl object, which also flushes the stream.

Portability is a key factor in deciding language, but how often have you had your cod ecompiled on a different architecture? asm remains a good choice to learn, especially seeing as the x86 architecture is not going anywhere. Itanium is still off in the distant future, and AMD Opteron/Athlon64 have full 32-bit compatibility.

Monica
Sorry, but I am not a C programmer, C++ ;). But I often get confused between the two (switching back and forth) but I found using VS .NET I find myself having to use ".h" but with ANSI C++ I do exactly as you say and use just plain "<iostream>", I find that the "&#092;n" escape character&#39;s fine with me though. :unsure: