Overclock.net banner
1 - 15 of 15 Posts

·
Preferred the old OCN
Joined
·
587 Posts
i'm pretty sure there are lots of tuto on the interwebz, however something that helped me alot in understanding assembly (and i'm far from being an expert) is comparing parts of the generated assembly code from the actual coding langage (c++ for exemple). then you can replace that part in your c++ program with the assembly instructions (asm{....}) and try to play with the intructions a bit. and use a very simple c++ hello world program

good luck
thumb.gif
 

·
Premium Member
Joined
·
3,688 Posts
Click

but seriously. The best way is by doing. Grab a book off Amazon or ebay and start from the beginning and doing the excersises in the book...The only way to learn the concepts are doing....No other way.
 

·
Registered
Joined
·
985 Posts
The basic concept of assembly is surprisingly simple. The key to doing it well is to train yourself to think like the machine. Break down every operation into its most basic sub-tasks, and do them one at a time, in order of operation.
Example: instead of doing 4x4, like a normal language. In assembly you would do 4+4+4+4.
The only other thing you really need to know is how FIFO and LIFO stacks work. As long as you get that, then you're ready to get started.

There should be plenty of assembly language simulators/trainers available online. Just search around and start experimenting. Start by creating some basic math functions first, that's a good way to learn. Then expand from there.
 

·
Registered
Joined
·
640 Posts
Like the others mentionned, best way is to learn trial and error by asking advice before each step or just collecting information. My advice would be, always calculate how much your theoretical build will need in regards to a PSU and add 100-150W. Always go for a high quality chassis with a lot of metal and little or no plastic (I have a preference for Mid-Towers) with plenty of cable management options.

When you have those in mind, think of your hard disk configuration, I go for SSD for C: and mechanical drive for D:, optical for E:

with all these parts, you can start thinking of your motherboard and processor and RAM trio. Minimum 8Gb in dual channel 1600mhz at the time of this writing.

When that is chosen, ask around for which graphics card would work best with the parts you chose.

If you chose a great case for your build, your experience building the computer will go very well if you follow instructions in the manual or advice from people like us.

Good luck!
thumb.gif
 

·
Registered
Joined
·
107 Posts
Write an emulator. To be fair, that's more likely to teach you machine code than assembly; but writing a simple assembler for your emulated chip should be simple after you've written the emulator itself.
 

·
Registered
Joined
·
6,119 Posts
Quote:
Originally Posted by PCWIZMTL View Post

Like the others mentionned, best way is to learn trial and error by asking advice before each step or just collecting information. My advice would be, always calculate how much your theoretical build will need in regards to a PSU and add 100-150W. Always go for a high quality chassis with a lot of metal and little or no plastic (I have a preference for Mid-Towers) with plenty of cable management options.

When you have those in mind, think of your hard disk configuration, I go for SSD for C: and mechanical drive for D:, optical for E:

with all these parts, you can start thinking of your motherboard and processor and RAM trio. Minimum 8Gb in dual channel 1600mhz at the time of this writing.

When that is chosen, ask around for which graphics card would work best with the parts you chose.

If you chose a great case for your build, your experience building the computer will go very well if you follow instructions in the manual or advice from people like us.

Good luck!
thumb.gif
What? He's not asking for PC assembly, he's asking about the Assembly programming language. There's a difference.
 

·
Pink Freud
Joined
·
2,699 Posts
I must say learning this alone might be hard, specially depending on your background.

Learning the syntax is one thing, another thing is learning how to write proper code with it, because it requires a lot of knowledge of the CPU architecture.

When I learnt it in the university the only books we used were the manuals for intel processors. The professors gave us all of the other material, made by themselves. So I recommend finding good material and to start by trying to integrate C and assembly to make your life easier: maybe try writing a hello world program only in asm, and then a hello world in asm using printf function from C, because that just makes life much easier to debug your code in the beginning.

Why do you want to learn it? I ask this because it can be pretty different depending on which architecture you are looking at.

I don't think it's simple as somebody above said. You must know your hardware and must know how to use it properly, this is the hard part. The syntax couldn't be simpler, though.
 

·
Premium Member
Joined
·
1,601 Posts
I would avoid x86 assembly at all costs. Most books cover only the most basic instructions and are somewhat out of date. Most of the important instructions are simply a matter of memorizing the thousands of instructions that make x86 work. RISC chips (like the ones below) have far fewer instructions and the principles of operation are probably easier to grasp.

MIPS -- here's the best free source I could find. MIPS is what you would learn in college. It is the best example of an architecture you're likely to find. You can find emulators so you can run the code on your PC. If you want a hobby board, chipKIT makes an inexpensive one that can use Arduino UNO components. There's a book called See MIPS Run that is a popular book on the topic of MIPS assembly.

AVR -- it's used for lots of hobby boards (especially the popular Arduino series). It is RISC (so is MIPS), but has some oddities due to it's being designed primarily for hobbyists.

http://www.avr-asm-tutorial.net/avr_en/

Ultimately, when you understand all the principles, all you need is the microprocessor datasheet which contains the list of instructions (and all the little details).
 

·
Pink Freud
Joined
·
2,699 Posts
Quote:
Originally Posted by hajile View Post

I would avoid x86 assembly at all costs. Most books cover only the most basic instructions and are somewhat out of date. Most of the important instructions are simply a matter of memorizing the thousands of instructions that make x86 work. RISC chips (like the ones below) have far fewer instructions and the principles of operation are probably easier to grasp.

MIPS -- here's the best free source I could find. MIPS is what you would learn in college. It is the best example of an architecture you're likely to find. You can find emulators so you can run the code on your PC. If you want a hobby board, chipKIT makes an inexpensive one that can use Arduino UNO components. There's a book called See MIPS Run that is a popular book on the topic of MIPS assembly.

AVR -- it's used for lots of hobby boards (especially the popular Arduino series). It is RISC (so is MIPS), but has some oddities due to it's being designed primarily for hobbyists.
http://www.avr-asm-tutorial.net/avr_en/

Ultimately, when you understand all the principles, all you need is the microprocessor datasheet which contains the list of instructions (and all the little details).
This.
 

·
Registered
Joined
·
378 Posts
I'd suggest AVR as well since it's RISC and you don't have to deal with the OS. AVR chips can also be obtained easily. x86 has hundreds of instructions which makes programming for it a task in memorization (June 2013 version of the Intel Developer Manual has 3251 pages). AVR has a handful of instructions that are easily memorized
 

·
Probably sleep deprived
Joined
·
5,586 Posts
A) I cant think of a good reason to learn assembly
If you are using assembly, there is usually a VERY good and VERY specific reason for doing so.
And those reasons usually have to do with specific hardware requirements or other constraints that are dependant on the situation.

Its only lightly touched on in Comp-Sci courses for a reason.
Its largely useless for completing a general programming task when compared to other languages that can do the same things.

B) If you really think you want to know assembly, look into AVR(as previously mentioned). Its far easier to understand and master than any x86 assembly.

C) Be warned, if your goal is to be able to say "I know assembly" to sound like an expert you want to be careful.
As evidenced in this thread, most programmers or people who know what they are doing wont be impressed, they will instead probably wonder why you wasted your time learning assembly when you could have been learning C++, Python, or any host of other useful languages instead.
 
  • Rep+
Reactions: CULLEN

·
Registered
Joined
·
1,784 Posts
Quote:
Originally Posted by PhilWrir View Post

Text
This is honestly the best advice in here. The only reason I regret literally mastering assembling computers are the hours I've "wasted" becoming good and really fast doing so. Sure it is good to be able to assemble a computer, but this will only take me so far in the future that I can save $50 every 5 years when I upgrade my computer since I don't have to buy the service from the computer store, if I would had only used my time to study any programming language at all it would take me so much further, and it's more fun (imo).

My advice to you go to http://www.codecademy.com/ and start rocking!

Edit I'm a moron, though you were asking how you could learn to assembly computers, wrote my rant, submitted, noticed you posted under Coding and programming. Have fun buddy!
 

·
Premium Member
Joined
·
8,041 Posts
Quote:
Originally Posted by CULLEN View Post

This is honestly the best advice in here. The only reason I regret literally mastering assembling computers are the hours I've "wasted" becoming good and really fast doing so. Sure it is good to be able to assemble a computer, but this will only take me so far in the future that I can save $50 every 5 years when I upgrade my computer since I don't have to buy the service from the computer store, if I would had only used my time to study any programming language at all it would take me so much further, and it's more fun (imo).

My advice to you go to http://www.codecademy.com/ and start rocking!

Edit I'm a moron, though you were asking how you could learn to assembly computers, wrote my rant, submitted, noticed you posted under Coding and programming. Have fun buddy!
It's also bad advice.

Learning to build PC's takes all of about 3 hours (it's pretty hard to plug something into the wrong hole since everything has strategically placed clasps, notches and uniquely shaped sockets). And I think saves a great deal more than $50 (ie if memory fails - easy and cheap to repair yourself - but expensive and time consuming to drive somewhere and pay them to do it). It also gives you a great skill for trouble-shooting software problems (is hardware can directly affect how software behaves).
 
1 - 15 of 15 Posts
Top