Should I learn Assembly?

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

LakatosIstvan
Posts: 87
Joined: Tue Jun 03, 2008 5:54 pm UTC
Location: Sector ZZ9 Plural Z Alpha
Contact:

Should I learn Assembly?

Postby LakatosIstvan » Sun Oct 18, 2009 10:15 am UTC

Hi. I'm a budding computer scientist. I have gotten my hands in a lot of programming languages, and now that I'm comfortable with coding, I was thinking maybe I should Assembly, mainly the x86 type. My question is: Is it worth it? Do I gain something from it?
Sir_Elderberry wrote:Cords are not just bendy cylinders. They are flexible, animate beings possessed by spirits whose intentions are beyond our ken. They are Cthulu's tentacles intruding on our reality.

Parsifal
Posts: 113
Joined: Thu Feb 28, 2008 1:35 am UTC

Re: Should I learn Assembly?

Postby Parsifal » Sun Oct 18, 2009 12:43 pm UTC

Absolutely. It will give you a basic understanding of computer architecture and primitive data types. You will also get to take a nice nap in CSCI class while your friends are trying to wrap their heads around the concept of pointers. Plus, it's a fun hobby. On the other hand, I wouldn't look forward to getting a job in x86 assembly language coding right out of school. I think everyone should learn assembly language first.

LakatosIstvan
Posts: 87
Joined: Tue Jun 03, 2008 5:54 pm UTC
Location: Sector ZZ9 Plural Z Alpha
Contact:

Re: Should I learn Assembly?

Postby LakatosIstvan » Sun Oct 18, 2009 1:32 pm UTC

I hope it will be an enlightening experience like LISP was :)

Now, if only I could find a book or a tutorial to teach me... Any suggestions?
Sir_Elderberry wrote:Cords are not just bendy cylinders. They are flexible, animate beings possessed by spirits whose intentions are beyond our ken. They are Cthulu's tentacles intruding on our reality.

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Should I learn Assembly?

Postby Berengal » Sun Oct 18, 2009 2:43 pm UTC

LakatosIstvan wrote:I hope it will be an enlightening experience like LISP was :)

It'll be mind-boggling, but not the way LISP is.

Still, fun, in it's own kind of way.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

User avatar
Briareos
Posts: 1940
Joined: Thu Jul 12, 2007 12:40 pm UTC
Location: Town of the Big House

Re: Should I learn Assembly?

Postby Briareos » Sun Oct 18, 2009 3:05 pm UTC

Sure, do it. Learning assembly was instrumental in helping me understand, to give one example, the call stack. I think a lot can be gained from studying it.

(I'm waiting for EduardoLeon to show up and say, "You should have been studying x86 assembly all along!")
Sandry wrote:Bless you, Briareos.

Blriaraisghaasghoasufdpt.
Oregonaut wrote:Briareos is my new bestest friend.

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Should I learn Assembly?

Postby Earlz » Sun Oct 18, 2009 4:20 pm UTC

Yea.. assembly, though it may not give you any direct skills... it's definitely a learning experience to be able to look at

Code: Select all

*a=(*a)+1

and be able to say.. hmm

Code: Select all

mov ebx,[a] ;or esp+4 or somethign like that for local variables
inc [ebx]

and realize it's just 2 instructions.. so optimizing to use less pointer lookups is usually pointless..

I say the best way to get started with assembly is either write your own OS, or run your code in a DOS.. (both should be using only 16 bit code as a baby step)[and for that, http://osdev.org is a great reference]

It's really fun work to be in complete control of the computer.. though it can be a bit mind boggling when you have trouble debugging.. if your OS stays fairly simple though, bochs debugger should work fine..

edit:
Oh and please do us all a favor and just use yasm as your assembler.. don't for a second consider emu8086.. Oh.. and I wouldn't recommend fasm either because it doesn't support much.. I don't even think it has 64 bit support, and it isn't portable..
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

User avatar
Briareos
Posts: 1940
Joined: Thu Jul 12, 2007 12:40 pm UTC
Location: Town of the Big House

Re: Should I learn Assembly?

Postby Briareos » Sun Oct 18, 2009 4:53 pm UTC

Earlz wrote:Oh and please do us all a favor and just use yasm as your assembler.. don't for a second consider emu8086.. Oh.. and I wouldn't recommend fasm either because it doesn't support much.. I don't even think it has 64 bit support, and it isn't portable..
I've always used nasm ...
Sandry wrote:Bless you, Briareos.

Blriaraisghaasghoasufdpt.
Oregonaut wrote:Briareos is my new bestest friend.

Goplat
Posts: 490
Joined: Sun Mar 04, 2007 11:41 pm UTC

Re: Should I learn Assembly?

Postby Goplat » Sun Oct 18, 2009 6:51 pm UTC

Earlz wrote:and I wouldn't recommend fasm either because it doesn't support much.. I don't even think it has 64 bit support
Actually, fasm has had x86-64 support since version 1.60, released in March 2005.
and it isn't portable..
It supports DOS, Windows, Linux, and Unix (if it uses ELF objects and libc is available). What else would you be running on an x86?

Роберт
Posts: 4285
Joined: Wed May 14, 2008 1:56 am UTC

Re: Should I learn Assembly?

Postby Роберт » Sun Oct 18, 2009 8:00 pm UTC

Yes, to be a computer scientist, you should have some knowledge of assembly. It's important for understanding computers, even if you may not use it much. (Well, a web developer probably doesn't need to know it, but I don't think of web developers as computer scientists. Sorry.)
The Great Hippo wrote:[T]he way we treat suspected terrorists genuinely terrifies me.

User avatar
Dropzone
Posts: 405
Joined: Sun Dec 30, 2007 10:12 pm UTC
Location: North Lincs., UK

Re: Should I learn Assembly?

Postby Dropzone » Sun Oct 18, 2009 8:08 pm UTC

Regarding tutorials, you might want to look through this thread: Any good tutorials to learn ASM with?.

User avatar
Xanthir
My HERO!!!
Posts: 5426
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Should I learn Assembly?

Postby Xanthir » Sun Oct 18, 2009 8:09 pm UTC

Роберт wrote:Yes, to be a computer scientist, you should have some knowledge of assembly. It's important for understanding computers, even if you may not use it much. (Well, a web developer probably doesn't need to know it, but I don't think of web developers as computer scientists. Sorry.)

It's just as important to understand the machine when you're working in Javascript as it is when you're working in C. If you don't, you'll write horrible code either way.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

poohat
Posts: 230
Joined: Mon Apr 07, 2008 6:21 am UTC

Re: Should I learn Assembly?

Postby poohat » Mon Oct 19, 2009 12:54 am UTC

you could learn a less pathological architecture like MIPS instead, youll still pick up the basic concepts and itll be less frustrating than x86.

I dont see the point in learning assembly other than to understand how computer hardware works (which is admittedly important). C is basically just portable assembler so its not like learning asm is going to make you a better programmer if you already know C.

LakatosIstvan wrote:I hope it will be an enlightening experience like LISP was :)

Now, if only I could find a book or a tutorial to teach me... Any suggestions?

This is pretty classic, uses MIPS though.

User avatar
jroelofs
Posts: 77
Joined: Tue Apr 01, 2008 9:26 pm UTC
Location: Nashua, NH
Contact:

Re: Should I learn Assembly?

Postby jroelofs » Mon Oct 19, 2009 4:21 am UTC

poohat wrote:I dont see the point in learning assembly other than to understand how computer hardware works (which is admittedly important)


If you've ever wanted to know how a compiler works, you'll probably do so using assembly. My compilers classes have revolved around writing a subset of Java to MIPS compiler, which we built from the ground up.

Learning ASM gives you a very good sense of memory layout, as well as the structure of the run-time stack (and knowing this makes you a better programmer).

User avatar
Xanthir
My HERO!!!
Posts: 5426
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Should I learn Assembly?

Postby Xanthir » Mon Oct 19, 2009 5:31 pm UTC

poohat wrote:you could learn a less pathological architecture like MIPS instead, youll still pick up the basic concepts and itll be less frustrating than x86.

I learned assembly on MIPS, so +1 to that suggestion. It's rarely necessary to understand *actual* assembly, so learning a toy assembly is good enough. It gives you the gist of it, which is all you need if you stick with high-level languages.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

fleshBasedProcessor
Posts: 12
Joined: Sun Aug 16, 2009 10:26 am UTC

Re: Should I learn Assembly?

Postby fleshBasedProcessor » Mon Oct 19, 2009 10:14 pm UTC

I've also been thinking about learning assembly. I was thinking about learning assembly for AVR microprocessors, since I have one available. Should I just wait and learn it in the computer architecture class I'll be taking next year instead?

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Should I learn Assembly?

Postby Earlz » Mon Oct 19, 2009 11:58 pm UTC

fleshBasedProcessor wrote:I've also been thinking about learning assembly. I was thinking about learning assembly for AVR microprocessors, since I have one available. Should I just wait and learn it in the computer architecture class I'll be taking next year instead?


From what I've seen AVR assembly is fairly easy.. and it never hurts to be a little bit ahead of the rest of the class lol. Going from say AVR -> x86 will be a challenge enough.. you might get annoyed when they begin with "registers are like a special small memory area" though
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

User avatar
Nath
Posts: 3148
Joined: Sat Sep 08, 2007 8:14 pm UTC

Re: Should I learn Assembly?

Postby Nath » Tue Oct 20, 2009 12:15 am UTC

Xanthir wrote:
poohat wrote:you could learn a less pathological architecture like MIPS instead, youll still pick up the basic concepts and itll be less frustrating than x86.

I learned assembly on MIPS, so +1 to that suggestion. It's rarely necessary to understand *actual* assembly, so learning a toy assembly is good enough. It gives you the gist of it, which is all you need if you stick with high-level languages.

Another vote for MIPS. I wouldn't really call it a toy, though.

LakatosIstvan
Posts: 87
Joined: Tue Jun 03, 2008 5:54 pm UTC
Location: Sector ZZ9 Plural Z Alpha
Contact:

Re: Should I learn Assembly?

Postby LakatosIstvan » Tue Oct 20, 2009 3:20 am UTC

But how am I going to write programs in assembly for the MIPS architecture if I don't have one?
Sir_Elderberry wrote:Cords are not just bendy cylinders. They are flexible, animate beings possessed by spirits whose intentions are beyond our ken. They are Cthulu's tentacles intruding on our reality.

Carnildo
Posts: 2023
Joined: Fri Jul 18, 2008 8:43 am UTC

Re: Should I learn Assembly?

Postby Carnildo » Tue Oct 20, 2009 3:20 am UTC

Xanthir wrote:
poohat wrote:you could learn a less pathological architecture like MIPS instead, youll still pick up the basic concepts and itll be less frustrating than x86.

I learned assembly on MIPS, so +1 to that suggestion. It's rarely necessary to understand *actual* assembly, so learning a toy assembly is good enough. It gives you the gist of it, which is all you need if you stick with high-level languages.

Depends on what you're doing with it. If you're busy tracking down a bug in the compiler you're using, you'll need to understand the appropriate assembly language.

User avatar
Nath
Posts: 3148
Joined: Sat Sep 08, 2007 8:14 pm UTC

Re: Should I learn Assembly?

Postby Nath » Tue Oct 20, 2009 4:32 am UTC

LakatosIstvan wrote:But how am I going to write programs in assembly for the MIPS architecture if I don't have one?

Spell it backwards.

LakatosIstvan
Posts: 87
Joined: Tue Jun 03, 2008 5:54 pm UTC
Location: Sector ZZ9 Plural Z Alpha
Contact:

Re: Should I learn Assembly?

Postby LakatosIstvan » Tue Oct 20, 2009 5:14 pm UTC

I'm not so sure about MIPS... I might actually want to write a few nifty programs for the x86 in the future :P. Even though MIPS assembly might be simpler than the x86 one, I'll still stick to ye good ol'(or new) x86. Now, off to write my OS :P
Sir_Elderberry wrote:Cords are not just bendy cylinders. They are flexible, animate beings possessed by spirits whose intentions are beyond our ken. They are Cthulu's tentacles intruding on our reality.

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Should I learn Assembly?

Postby Earlz » Tue Oct 20, 2009 5:42 pm UTC

LakatosIstvan wrote:I'm not so sure about MIPS... I might actually want to write a few nifty programs for the x86 in the future :P. Even though MIPS assembly might be simpler than the x86 one, I'll still stick to ye good ol'(or new) x86. Now, off to write my OS :P

you poor brave soul.. lol

I say x86 is easier to learn with, even if its just because you can run it on your physical machine(assuming you have an archaic floppy drive)
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

LakatosIstvan
Posts: 87
Joined: Tue Jun 03, 2008 5:54 pm UTC
Location: Sector ZZ9 Plural Z Alpha
Contact:

Re: Should I learn Assembly?

Postby LakatosIstvan » Tue Oct 20, 2009 6:55 pm UTC

I am lucky to live in a country where let's just say technology is lagging by 5 to 10 years :P. Seriously, there are many computers in Romania which still have floppy drives, even I have in my home two older computers which I can use to practice on. One of them is even used on a day-to-day basis. We got our first computer back in 1995 I think, probably an Intel or an AMD running DOS, I'm not sure, I haven't seen that computer in years, but I'm glad I owned one back then (I was only like 4 years old) because now I'm uber proficient at using terminals, command prompts. I even did a little programming back then, messing arround with the scripts for those banana-throwing King-Kong themed cannon games... Those days were sure fun... I remember when 3D Voodoo graphics cards were considered to be the ultimate gaming experience... God I miss ye old times.
I guess it's time to dust off and plug in the old-timer. ( I'm shocked how reliable old technology is. The other computer we have that my mother uses regularly for accounting was bought in 1997 or 1998 I think, and even after more than 10 years of service it still works almost perfectly. We only updated the OS once to Windows 98, replaced an old CD reader with a DVD reader. Unfortunately all the software installed on the little 3 GB harddisk really wears down the computer, after long runs it comlains that it need more RAM, but the problem is that they don't manufacture these types anymore :P )
Sir_Elderberry wrote:Cords are not just bendy cylinders. They are flexible, animate beings possessed by spirits whose intentions are beyond our ken. They are Cthulu's tentacles intruding on our reality.

EduardoLeon
Posts: 111
Joined: Wed Sep 30, 2009 2:26 am UTC
Location: Lima, Perú
Contact:

Re: Should I learn Assembly?

Postby EduardoLeon » Tue Oct 20, 2009 10:56 pm UTC

Briareos wrote:(I'm waiting for EduardoLeon to show up and say, "You should have been studying x86 assembly all along!")


I'm too busy with the Forum Games. :)
Gott weiß ich will kein Engel sein!

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Should I learn Assembly?

Postby Earlz » Wed Oct 21, 2009 3:26 pm UTC

LakatosIstvan wrote:I am lucky to live in a country where let's just say technology is lagging by 5 to 10 years :P. Seriously, there are many computers in Romania which still have floppy drives, even I have in my home two older computers which I can use to practice on. One of them is even used on a day-to-day basis. We got our first computer back in 1995 I think, probably an Intel or an AMD running DOS, I'm not sure, I haven't seen that computer in years, but I'm glad I owned one back then (I was only like 4 years old) because now I'm uber proficient at using terminals, command prompts. I even did a little programming back then, messing arround with the scripts for those banana-throwing King-Kong themed cannon games... Those days were sure fun... I remember when 3D Voodoo graphics cards were considered to be the ultimate gaming experience... God I miss ye old times.
I guess it's time to dust off and plug in the old-timer. ( I'm shocked how reliable old technology is. The other computer we have that my mother uses regularly for accounting was bought in 1997 or 1998 I think, and even after more than 10 years of service it still works almost perfectly. We only updated the OS once to Windows 98, replaced an old CD reader with a DVD reader. Unfortunately all the software installed on the little 3 GB harddisk really wears down the computer, after long runs it comlains that it need more RAM, but the problem is that they don't manufacture these types anymore :P )


crap. A lot of the "newer" computers still have room for a floppy disk.. Like my dual-core AMD machine I bought 2 years ago.. it didn't have a floppy drive. But recently when I was switching out it's harddisk, I realized there was a little port on the mobo for floppy drive(but only 1 IDE channel port) so I kicked out a 3.5" piece of the case and stuck one in it..

Also, if you happen to be stuck on a computer without a floppy drive, if you stick to 16bit real mode, then flash drives are just as easy to use.. (just make sure to double check DL when your using int 0x13!)
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

User avatar
lulzfish
Posts: 1214
Joined: Tue Dec 16, 2008 8:17 am UTC

Re: Should I learn Assembly?

Postby lulzfish » Wed Oct 21, 2009 3:30 pm UTC

Floppy drive?

I thought for OS dev you could just test on a virtual machine?

User avatar
Briareos
Posts: 1940
Joined: Thu Jul 12, 2007 12:40 pm UTC
Location: Town of the Big House

Re: Should I learn Assembly?

Postby Briareos » Wed Oct 21, 2009 3:34 pm UTC

It's certainly way faster when you only have one machine to work with.

/me considers going to RW to start a "bochs vs. qemu" thread
Sandry wrote:Bless you, Briareos.

Blriaraisghaasghoasufdpt.
Oregonaut wrote:Briareos is my new bestest friend.

LakatosIstvan
Posts: 87
Joined: Tue Jun 03, 2008 5:54 pm UTC
Location: Sector ZZ9 Plural Z Alpha
Contact:

Re: Should I learn Assembly?

Postby LakatosIstvan » Wed Oct 21, 2009 4:34 pm UTC

So basically I could also use let's say Virtaul Box to test my OS in it? Neat!
Sir_Elderberry wrote:Cords are not just bendy cylinders. They are flexible, animate beings possessed by spirits whose intentions are beyond our ken. They are Cthulu's tentacles intruding on our reality.

User avatar
lulzfish
Posts: 1214
Joined: Tue Dec 16, 2008 8:17 am UTC

Re: Should I learn Assembly?

Postby lulzfish » Wed Oct 21, 2009 5:18 pm UTC

Probably.

You could at least write your files to a floppy image, use V-Box to mount that on a VM, then test it in there.
Should be faster than shuffling floppies around, and you can move right up to LiveCDs and hard disk images without any effort.

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Should I learn Assembly?

Postby Earlz » Thu Oct 22, 2009 5:22 pm UTC

lulzfish wrote:Probably.

You could at least write your files to a floppy image, use V-Box to mount that on a VM, then test it in there.
Should be faster than shuffling floppies around, and you can move right up to LiveCDs and hard disk images without any effort.


Yea, I wasn't saying do all your work on a physical machine. Rather that having a few physical machines to test it on is valuable
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

fazzone
Posts: 186
Joined: Wed Dec 10, 2008 9:38 pm UTC
Location: A boat

Re: Should I learn Assembly?

Postby fazzone » Fri Oct 23, 2009 2:08 am UTC

But...although it may certainly be a learning experience (I found it so) to write assembler on the bare metal, though it's not necessary to do so to be able understand assembly.
*/

User avatar
'; DROP DATABASE;--
Posts: 3284
Joined: Thu Nov 22, 2007 9:38 am UTC
Location: Midwest Alberta, where it's STILL snowy
Contact:

Re: Should I learn Assembly?

Postby '; DROP DATABASE;-- » Fri Oct 23, 2009 6:21 am UTC

poohat wrote:you could learn a less pathological architecture like MIPS
<3 R4300.

Z80 is nice too; make some Game Boy games. That was how I learned it.

Learning assembly is worth the bragging rights if nothing else. :D
poxic wrote:You suck. And simultaneously rock. I think you've invented a new state of being.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Should I learn Assembly?

Postby You, sir, name? » Fri Oct 23, 2009 5:27 pm UTC

LakatosIstvan wrote:Hi. I'm a budding computer scientist. I have gotten my hands in a lot of programming languages, and now that I'm comfortable with coding, I was thinking maybe I should Assembly, mainly the x86 type. My question is: Is it worth it? Do I gain something from it?


I'm not sure if it actually helps you with computer science, but it will make you a better programmer, as it is a surefire way of becoming intimately accustomed with the guts of both how programs you write in higher order languages are realized, and the workings of the processor.

If you don't want to actually take the time it takes to learn to write programs in assembly (since unless you find it really fun and fascinating, you could be spending that time doing something more useful), you can get a fair deal of the benefits out of skimming through the specifications of assembly language to the extent where you roughly understand how it's made up, and then go off examining compiler-generated assembly sources of simple language constructs like function calls and so forth.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

shieldforyoureyes
Posts: 342
Joined: Sat Apr 19, 2008 9:00 am UTC
Contact:

Re: Should I learn Assembly?

Postby shieldforyoureyes » Fri Oct 23, 2009 6:10 pm UTC

'; DROP DATABASE;-- wrote:
poohat wrote:you could learn a less pathological architecture like MIPS
<3 R4300.

Z80 is nice too; make some Game Boy games. That was how I learned it.

Learning assembly is worth the bragging rights if nothing else. :D


Aye. I've written a few graphics demo programs in LINC machine language. How many people can claim that?

Hectamatatortron
Posts: 40
Joined: Tue Dec 04, 2007 6:50 pm UTC
Contact:

Postby Hectamatatortron » Fri Oct 23, 2009 6:14 pm UTC

Just had to dig up my password so I could post here.

YES learn assembly. I got tired of lacking the haxpertise to reverse engineer things, so with no prior programming experience I said "I don't care if it's hard" and taught myself assembly by reading opcode documentation and hand-assembling programs in hexadecimal (couldn't figure out how to work an assembler when I first started, see >_>).

Was proficient within 2 months (read: it wasn't as hard as I expected!) and when I finally started learning a high level language (starting teaching myself C because I was "tired of lacking", heh) a year later, it all made perfect sense to me.

By the time I got to Java I was like "oh lawdy this is too easy".

Now I'm in an assembly CLASS and made a perfect score on the midterm, which is where the "nap in class while friends wrap their heads around pointers" part comes in. In my Computer Architecture class we're going over the function of a CPU and seeing how assembly instructions are broken down into opcodes and operands, how they are reformed into the "control word", and how the control word's bits are plugged into various circuit inputs to bring about the intended effect of the original instruction. This, too is insanely easy to comprehend because of prior knowledge with assembly.

tl;dr learning assembly ahead of time just makes everything much easier. More fun, too, if you put it to use in hacking various applications (video games in my case; that link is to a video of some GameShark codes I made in action on some old N64 game - required lots of assembly programming to complete).

As was said, assembly isn't exactly practical for the job market (that I know of, though perhaps supreme proficiency is?). But if you learn Z80, for example, you can do things like program your calculator with more control over it than using its BASIC language (talking TI calculators, here) and do various other things to already-compiled programs that aren't quite up to par (such as modifying an application's code such that an external debugger that only has break-on-execute functionality can simulate behavior of break-on-read or break-on-write functionality).

It's like carrying a roll of virtual duct tape everywhere you go.

Edit: @shieldforyoureyes: I haven't done anything quite that impressive, but I have written a lot of custom graphical display code for the Gameboy Advance in good ol' Thumb assembly (first assembly language I learned). ARM cores are my favorite. <3

Edit: HyperHacker/Drop Database, how did I not foresee you posting in this thread? :P

Oh, also, to be more accurate, Drop Database is the one who taught me C. Not myself. >_>

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re:

Postby Earlz » Sat Oct 24, 2009 4:58 am UTC

Hectamatatortron wrote:Just had to dig up my password so I could post here.

YES learn assembly. I got tired of lacking the haxpertise to reverse engineer things, so with no prior programming experience I said "I don't care if it's hard" and taught myself assembly by reading opcode documentation and hand-assembling programs in hexadecimal (couldn't figure out how to work an assembler when I first started, see >_>).

Was proficient within 2 months (read: it wasn't as hard as I expected!) and when I finally started learning a high level language (starting teaching myself C because I was "tired of lacking", heh) a year later, it all made perfect sense to me.

By the time I got to Java I was like "oh lawdy this is too easy".

Now I'm in an assembly CLASS and made a perfect score on the midterm, which is where the "nap in class while friends wrap their heads around pointers" part comes in. In my Computer Architecture class we're going over the function of a CPU and seeing how assembly instructions are broken down into opcodes and operands, how they are reformed into the "control word", and how the control word's bits are plugged into various circuit inputs to bring about the intended effect of the original instruction. This, too is insanely easy to comprehend because of prior knowledge with assembly.


This!!

I actually taught myself C and assembly at about the same time.. but by the time I fully understood assembly, I fully understand C also. (including pointers and all that.. didn't figure out variable size structs and unions and enumerations until I started learning java and C# and thought C for surely must have this)

dang it.. I kinda wanna do some assembly hacking just for the heck of it now.. lol
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Should I learn Assembly?

Postby Rysto » Sat Oct 24, 2009 9:27 pm UTC

If you're going to be programming in C or C++, learning assembly has another benefit. This may be different on Windows, but all too often I find that gdb does a terrible job at working out the value of a critical variable(this may be gcc's fault, not gdb's). When that happens, the only recourse is often to look at the disassembly and work it out from that.

poohat
Posts: 230
Joined: Mon Apr 07, 2008 6:21 am UTC

Re: Should I learn Assembly?

Postby poohat » Sun Oct 25, 2009 4:57 am UTC

LakatosIstvan wrote:But how am I going to write programs in assembly for the MIPS architecture if I don't have one?

You arent likely to write programs in either MIPS or x86, youre probably going to use them to learn how computer architecture works and then go back to using C for anything low-level.

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Should I learn Assembly?

Postby Earlz » Thu Oct 29, 2009 5:54 pm UTC

poohat wrote:
LakatosIstvan wrote:But how am I going to write programs in assembly for the MIPS architecture if I don't have one?

You arent likely to write programs in either MIPS or x86, youre probably going to use them to learn how computer architecture works and then go back to using C for anything low-level.


believe it or not, sometimes you need to go lower than C, it's a nifty skill that I think the OP is asking us about. (ever tried writing an OS? Sure you could generate HEX from C when you need to write interrupt stubs or a LGDT instruction, but thats just stupid.)

And if you want to write for MIPS, grab an emulator.. thats what you should always be doing anyway is emulating code except for everyone in a while, or if the actual device has something not easily emulated
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

chocolate.razorblades
Posts: 90
Joined: Wed Apr 01, 2009 6:11 pm UTC

Re: Should I learn Assembly?

Postby chocolate.razorblades » Fri Oct 30, 2009 5:23 pm UTC

I'm inspired to write my own OS as well!

Not right now, though. Not right now.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 15 guests