Valhalla Legends Forums Archive | Assembly Language (any cpu) | Assembly early on?

AuthorMessageTime
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.
February 14, 2004, 2:07 AM
iago
I wouldn't recommend it, but if you think you can then all the power to you... :)
February 14, 2004, 6:23 AM
Raven
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. :)
February 17, 2004, 3:35 PM
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!
February 18, 2004, 2:47 AM
iago
[quote author=tA-Kane link=board=7;threadid=5285;start=0#msg44839 date=1077072444]
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!
[/quote]

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.
February 18, 2004, 2:06 PM
Adron
I learned both Intel and 68k, and they seemed rather similar to me. The registers are different, but the principles are the same.
February 18, 2004, 11:30 PM
iago
[quote author=Adron link=board=7;threadid=5285;start=0#msg44928 date=1077147055]
I learned both Intel and 68k, and they seemed rather similar to me. The registers are different, but the principles are the same.
[/quote]

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 :)
February 18, 2004, 11:56 PM
Adron
[quote author=iago link=board=7;threadid=5285;start=0#msg44939 date=1077148594]
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 :)
[/quote]

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".
February 19, 2004, 12:00 AM
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.
February 19, 2004, 2:16 AM
Adron
[quote author=iago link=board=7;threadid=5285;start=0#msg44971 date=1077156989]
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.
[/quote]

Function calls and stacks aren't very different between the processors, but they may be different between operating systems/compilers...
February 20, 2004, 7:31 PM
Skywing
[quote author=Adron link=board=7;threadid=5285;start=0#msg45181 date=1077305509]
[quote author=iago link=board=7;threadid=5285;start=0#msg44971 date=1077156989]
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.
[/quote]

Function calls and stacks aren't very different between the processors, but they may be different between operating systems/compilers...
[/quote]
Hmm. I think IA64 works very different from x86 as far as function calls go...
February 21, 2004, 5:11 PM
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 ;)
February 21, 2004, 7:27 PM
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.
February 21, 2004, 8:20 PM

Search