|
-
Oct 11th, 2005, 02:30 PM
#1
Thread Starter
Addicted Member
New to assembly
Hi, im thinking of learning assembly, but i cant figure out what program do you use to do that. I'm pretty sure that you can do it in VS.NET 2003 or 2005, but i cant figure out where, plz help.
Thx
-
Oct 11th, 2005, 04:43 PM
#2
Re: New to assembly
Start using it in C++ like so:
Code:
#include <stdio.h>
int Addition(int val1, int val2){
_asm{
mov eax, val1
mov ebx, val2
add eax, ebx
}
//function automatically returns whats in the eax register
}
int main(void){
printf("%d\n", Addition(10,20));
return 0;
{
And the best website to learn assembly is www.artofassembly.com . Start in the 16 bit DOS section. The instruction set is introduced in Chapter 3 and 6, with more instructions introduced in the later chapters.
Last edited by Jacob Roman; Oct 11th, 2005 at 05:53 PM.
-
Oct 12th, 2005, 04:20 AM
#3
Re: New to assembly
Well I found that website pretty useless, way too much info and no obvious starting point.
I'd suggest you grab yourself a copy of "Assembly Language for Intel-Based Computers" (Author: Kip Irvine, Publisher: Prentice Hall, ISBN: 0-13-049146-2).
It comes with a CD and its everything you need to learn ASM. Teaches you how the hardware works first so you can start coding easily. Jumping into the code without appreciating the hardware makes it 10x harder to learn.
It covers a LOT of different techniques and has an excelltnt instruction set reference and comprehensive glossary and index.
I would have happily paid twice as much for this book. Go and buy it.
I don't live here any more.
-
Oct 12th, 2005, 05:03 AM
#4
Re: New to assembly
Once done with what wossname said, I would suggest MASM for GUI windows based stuff.
(I really should get paid for how much I promote MASM here).
Others may disagree, as there are easier syntaxes for Windows Based ASM, but meh.
chem
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Oct 12th, 2005, 05:14 AM
#5
Re: New to assembly
That book I suggested uses MASM al the way through It has the compiler on the CD too.
Very very cool indeed.
I don't live here any more.
-
Oct 12th, 2005, 09:13 AM
#6
Thread Starter
Addicted Member
Re: New to assembly
 Originally Posted by Jacob Roman
Start using it in C++ like so:
Code:
#include <stdio.h>
int Addition(int val1, int val2){
_asm{
mov eax, val1
mov ebx, val2
add eax, ebx
}
//function automatically returns whats in the eax register
}
int main(void){
printf("%d\n", Addition(10,20));
return 0;
{
And the best website to learn assembly is www.artofassembly.com . Start in the 16 bit DOS section. The instruction set is introduced in Chapter 3 and 6, with more instructions introduced in the later chapters. 
You mean the only way to program assembly in VS is in C++? I hope it doesn't use anything of C++ itself, cause i've never studied it, i only know VB.NET.
And thx for all the links on books and stuff
-
Oct 12th, 2005, 11:08 AM
#7
Re: New to assembly
I wouldn't know, never tried it in VS, but: If thats the case, all you'd need is the basics of C++ knowledge like the main procedure and you can have the rest as ASM:
Code:
int main()
{
__asm {
xor eax,eax
}
return 0;
}
..for example.
chem
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Oct 12th, 2005, 11:52 AM
#8
Thread Starter
Addicted Member
Re: New to assembly
 Originally Posted by chemicalNova
I wouldn't know, never tried it in VS, but: If thats the case, all you'd need is the basics of C++ knowledge like the main procedure and you can have the rest as ASM:
Code:
int main()
{
__asm {
xor eax,eax
}
return 0;
}
..for example.
chem
Thx for info
-
Oct 12th, 2005, 04:04 PM
#9
Re: New to assembly
Even so, the basics of C++ is still a lot to learn in order to learn ASM. It would be a major obstacle.
There's little advantage to using VS as a debugger anyway. I find it much easier to use notepad and the console. It gives you a better idea of how things work. The book covers EVERYTHING you need to know.
I don't live here any more.
-
Oct 13th, 2005, 04:43 AM
#10
Re: New to assembly
Why would you bother with VS anyway. The MASM "IDE" is pretty much just notepad anyway 
chem
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Oct 14th, 2005, 02:17 AM
#11
Addicted Member
Re: New to assembly
 Originally Posted by chemicalNova
Once done with what wossname said, I would suggest MASM for GUI windows based stuff.
(I really should get paid for how much I promote MASM here).
Others may disagree, as there are easier syntaxes for Windows Based ASM, but meh.
chem
I would also try fasm - its really good as well. You can do almost the same amount of things with fasm macros as with masm macros unlike most other assemblers. http://flatassembler.net/
But of course masm has a nice code library and some pretty good ides:
http://www.easycoder.org/English/index.htm (For MASM and looks like Visual Basic 6)
http://radasm.visualassembler.com/ (Supports a wide range of assemblers but support for FASM is minimal)
http://www.winasm.net/ (Supports MASM and FASM (with Shoorik's add-in))
-
Oct 15th, 2005, 02:15 PM
#12
Re: New to assembly
 Originally Posted by chemicalNova
I wouldn't know, never tried it in VS, but: If thats the case, all you'd need is the basics of C++ knowledge like the main procedure and you can have the rest as ASM:
Code:
int main()
{
__asm {
xor eax,eax
}
return 0;
}
..for example.
chem
You didn't have to return 0. It automatically returns whats in the eax register. So you pretty much zeroed the result. But since theres no value in the eax register anyways...
-
Oct 15th, 2005, 07:12 PM
#13
Re: New to assembly
Sif pick something like that up in a small example 
I assumed that he would have stored other values in eax 
chem
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Oct 16th, 2005, 12:57 PM
#14
Re: New to assembly
 Originally Posted by Jacob Roman
You didn't have to return 0. It automatically returns whats in the eax register. So you pretty much zeroed the result. But since theres no value in the eax register anyways...
1) Nothing "automatically returns" eax. The return code is STORED in eax.
2) Since this is main(), you don't want to return a value. 0 is the successful application return code.
-
Oct 16th, 2005, 01:55 PM
#15
Re: New to assembly
 Originally Posted by penagate
1) Nothing "automatically returns" eax. The return code is STORED in eax.
You just controdicted yourself. The return code is stored in eax, hence it did it for ya, and the user didn't have to do it 
It's automatic like I said
-
Oct 17th, 2005, 02:00 AM
#16
Re: New to assembly
 Originally Posted by Jacob Roman
You just controdicted yourself. The return code is stored in eax, hence it did it for ya, and the user didn't have to do it
It's automatic like I said 
No, you contradicted yourself in saying that... the return code is stored in eax, but nothing did it for you, you moved it there yourself 
I think you are being unnecessarily confusing when you say "automatically returns". Returning a value is an action. In C you use the "return" statement to both set the return value and exit the procedure in one hit. In ASM you just exit the procedure and the value in the eax register, whatever it is at the time, is taken to be the return value.
So, we are both trying to say the same thing anyway
-
Oct 17th, 2005, 03:41 AM
#17
Re: New to assembly
"Semantics gennelmen, semantics"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|