• Welcome to Valhalla Legends Archive.
 

Assembly early on?

Started by Master Of Puppets, February 13, 2004, 08:07 PM

Previous topic - Next topic

Master Of Puppets

I know a little bit of VB and C++. But should i focus on really understanding C++ thoroughly, or would it be safe/a good thing for me to start learning assembly? I have no knowledge of assembly at this moment, but I seen the new operating system that fits on a floppy disc that was made with assembly which is called MinuetOS or something it really sparked a lot of interest.

iago

I wouldn't recommend it, but if you think you can then all the power to you... :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Raven

#2
Assembly more or less depends on one's ability to solve problems using sequences of code. Most people wait until they've learned atleast the basic commands and strategies involved with C++ and VB before they move on to Assembly just because at that point, they'll have a more solid base and mastery of programming techniques and problemsolving. As iago said, it wouldn't be recommended to dive into assembly before you have a strong understanding of C++, but ofcourse, I believe it could be done. It's just a matter of having a mind capable of solving complex problems. Learning assembly terminology shouldn't be as difficult as learning when and how to implement it to accomplish your individual goals. Goodluck with all that. :)

tA-Kane

I learned to read PPC assembly while I was learning C/C++ simply because I wanted to be able to find exactly where bugs in my programs were, and my debugger allows for me to display the code as both Asm and source code, which is really nice. It allows me to see just exactly what instructions are generated for what lines of source code.

I was successful in making a simple event loop which quits the program when the user clicks the mouse, in Asm.

Note that PPC Asm (Mac Assembly) is different than x86 Asm (Windows Assembly), but a lot of the basic ideas can be carried between the two; it's just that the code is different.

Right now, I'm learning both C/C++ and Assembly at the same time: I'm writing an application that will display the mnemomic for a given hexadecimal value, which will allow me to later on read the values straight from an executable file (oh how fun...), and display the mnemomics for those values.

Anyways, iago hit the nail on the head: if you can do it, then more power to you!
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

iago

Quote from: tA-Kane on February 17, 2004, 08:47 PM
I learned to read PPC assembly while I was learning C/C++ simply because I wanted to be able to find exactly where bugs in my programs were, and my debugger allows for me to display the code as both Asm and source code, which is really nice. It allows me to see just exactly what instructions are generated for what lines of source code.

I was successful in making a simple event loop which quits the program when the user clicks the mouse, in Asm.

Note that PPC Asm (Mac Assembly) is different than x86 Asm (Windows Assembly), but a lot of the basic ideas can be carried between the two; it's just that the code is different.

Right now, I'm learning both C/C++ and Assembly at the same time: I'm writing an application that will display the mnemomic for a given hexadecimal value, which will allow me to later on read the values straight from an executable file (oh how fun...), and display the mnemomics for those values.

Anyways, iago hit the nail on the head: if you can do it, then more power to you!

I learned Intel, then 68k (which is very similar to Power PC).  Intel and 68k are fairly different in a lot of important areas, making it very hard to apply knowledge from one to the other.  On the other hand, SPARC and Intel are similar in many more ways, and I found SPARC exceptionally easy to learn after knowing Intel.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Adron

I learned both Intel and 68k, and they seemed rather similar to me. The registers are different, but the principles are the same.

iago

Quote from: Adron on February 18, 2004, 05:30 PM
I learned both Intel and 68k, and they seemed rather similar to me. The registers are different, but the principles are the same.

There's a lot of small differences which made it difficult, I found.  They both flow similarely, but, since I can't really remember 68k anymore (haven't touched it in almost a year) I can't say much more than that.  Sorry :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Adron

Quote from: iago on February 18, 2004, 05:56 PM
There's a lot of small differences which made it difficult, I found.  They both flow similarely, but, since I can't really remember 68k anymore (haven't touched it in almost a year) I can't say much more than that.  Sorry :)

The single most difficult thing I remember from going between them was using "move.l src, dst" in 68k and "mov dst, src" in x86.

But it was really just words and phrasings that differed, the basic ideas were the same. Like "move.l someval, -(A7); trap #12" instead of "push someval; int 57".

iago

Yeah, it was the functions that got me, now that I'm thinking about it.  The way the function calls and stacks and such work are much different.  

And the whole specifying the length of a register and the reversed src/dest didn't help.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Adron

Quote from: iago on February 18, 2004, 08:16 PM
Yeah, it was the functions that got me, now that I'm thinking about it.  The way the function calls and stacks and such work are much different.  

And the whole specifying the length of a register and the reversed src/dest didn't help.

Function calls and stacks aren't very different between the processors, but they may be different between operating systems/compilers...

Skywing

Quote from: Adron on February 20, 2004, 01:31 PM
Quote from: iago on February 18, 2004, 08:16 PM
Yeah, it was the functions that got me, now that I'm thinking about it.  The way the function calls and stacks and such work are much different.  

And the whole specifying the length of a register and the reversed src/dest didn't help.

Function calls and stacks aren't very different between the processors, but they may be different between operating systems/compilers...
Hmm.  I think IA64 works very different from x86 as far as function calls go...

Adron

Ah, that's possible. I know some RISC architectures have register windows that can be moved around or something like that. The 68k and the x86 are similar though. Feel free to elaborate on the differences for other architectures if you like ;)

iago

SPARC has something like a register window.

When you call a function, some of the registers are replaced with a fresh set, and after you return you get your old ones back.  
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*