Good place to learn assembly?

Pages: 12
I'm going to be wrecking myself with a horrid math class, assembly, and a data algorithm course (along with a few courses). Was hoping for a link or such that someone has experience with that teaches assembly so I can potentially learn it before the course starts in about a month.

I have a few of my own sources, but I have no idea if they're good or not. Thanks!
A metasearch for "online assembly tutorials for beginners":

https://duckduckgo.com/?q=online+assembly+tutorials+for+beginners&t=ffsb&ia=web

As to how good the tutorial(s) are, I can't say.
You use duckduckgo? I've wanted to switch, but at the same time it doesn't seem too big a deal.
DDG is my browser's default search engine. I refuse to use Goolag.

One advantage touted about DDG. They don't track.

Something Goolag does as a matter or routine.
G is also politically motivated and has an agenda (there are many indicators of this but the fast and easy obvious one is to look at what 'news' sources it gives you as 'valid news' in their headline assembly page), on top of spying/tracking everything as their primary approach to everything. They barely even apologized for doing drive-by network break ins while doing their street view images.

Asm ... are you learning it to produce high speed snippits or some other reason?
Last edited on
I'd say it's nice to know assembly just be able to make sense of what the compiler outputs, not necessarily because you're trying to hand-write it yourself.

zapshe,
Note that "assembly" is not a language in itself. Most likely, your class will be on MIPS, ARM, or x86. If you know which one, I would search for that language specifically.
e.g. for x86:
https://www.nayuki.io/page/a-fundamental-introduction-to-x86-assembly-programming
https://www.cs.virginia.edu/~evans/cs216/guides/x86.html
Last edited on
that is why I asked.

beginner asm books/classes/code looks kinda like C and its as if the authors/students are expected to think C-like thoughts.

efficient asm for deep speed critical blocks will not remotely resemble the above style.

and the compiler has its own approach. which seems to be reusing the same tiny subset of instructions to do almost everything. I remember one asm file something of mine made that had about 200 lea commands in a row. I never did really unravel how that one worked.

also note that even the different assembly 'languages' may have slight differences in syntax here and there depending on the assembler being used, and possibly the OS. The chip commands are the same but the assembler may support some extras or alternates.
Last edited on
I remember one asm file something of mine made that had about 200 lea commands in a row
That reminded me of a funny video, jonnin.

"Movfuscator"
https://www.youtube.com/watch?v=R7EEoWg6Ekk
(long story short: Obfuscates a program to compile with only x86 mov instructions)
Last edited on
I remember one asm file something of mine made that had about 200 lea commands in a row.

Every time I see "asm file" I first read it as "ass file." :)
Interesting video Ganado, I didn't watch it all but it was interesting.

Note that "assembly" is not a language in itself. Most likely, your class will be on MIPS, ARM, or x86.

My university has no such nice description, it simply says that there will be conversion, buffering, device drivers, assemblers, and loaders and we'll use system services/macros/linkage conventions.

Perhaps there isn't much point in trying to get use to coding in it if the coding style of it may drastically change in the class itself. I'll simply be contempt with that what I've seen so far of assembly seems intuitive and will only require me to remember the keywords and their parameters.
I'll simply be contempt with that what I've seen so far of assembly

I'd wager you meant "content" instead of "contempt." :)

A typo, but one that is so rich in meaning.
require me to remember the keywords and their parameters.

This is going to be a BIG problem if you try to do much assembly coding. Assembly keywords have at least THREE things, not 2, to remember:
1) name and exactly what it does (this is not the same as what it was meant to do, by the way, many instructions can DO things that is radically different from what their name and suggested use imply)
2) parameters (some instructions operate on a specific register(s) and that 'parameter(s)' is hidden!) and this includes also alternate forms; some instructions have multiple forms to support memory vs register usage and so on.
3) side effects. Some commands impact the cpu status/flag register(s) and those changes are critical to the next instruction. Some have other side effects like dumping a result to a specific register (what if you had been using that one for something else in your code!) and so on. This stuff makes for exciting bugs if you miss the wrong side effect at the wrong spot in your code.

Last edited on
I wouldn’t waste time on trying to learn any assembly outside of what you will be taught.
If you can program in C++ (or any high-level language, really), you will easily pick up assembly.

The trick is that every machine type has a unique assembly set, and often classes are taught using an emulated or teaching-purposes assembly set. To wit — you don’t really know what you will get when class starts.

Honestly, I would sweat a few more bullets for the upcoming algorithms course. If done properly, that one will kick your butt.


[edit]
If you are lucky, you’ll play with SPIM.
Last edited on
Thanks for the information guys. I suppose I won't look into it further if it just means I'll end up relearning a different version of it.


Honestly, I would sweat a few more bullets for the upcoming algorithms course. If done properly, that one will kick your butt.

I hear it's easier than the class I just took, so I doubt they're going to make us do anything crazy. What I'm mostly worried about is my math course, which many fail. It's apparently all about proofs, which I and mostly everyone absolutely hate. Even in high school geometry I'd answer the problems and then lose points for the proof.

We'll see how the semester plays out, should be the highest workload one yet.

Thanks again!
proofs is good to stretch your mind, how to think about things and have some degree of certainty about the correctness of an idea.

that said, there are 2 problems with formal proof classes.
1) most of the professors are jerks. this means they take points off for messing up the symbols used in formal proofs, which are many, varied, and unusual. It also means that many of the professors delight in giving you stuff to prove that is like unto codechef problems: strangely worded and tricksy to see the answer.

2) hour long class tests are more high pressure than usual. You have to, in parallel, unravel the question, figure out the answer, and express that answer in confusing but very precise math language -- all in the time window.

Comes down to whether the professor is there to help you or there to fail you. I took a senior level (college senior) proofs class to get my math minor, and our prof was excellent, and made the class very enjoyable. I had tried to take it once before as a freshman vs the intro proofs class and the professor was a buttmonkey on a power trip: most of the students dropped the class after first test.
Last edited on
proofs is good to stretch your mind, how to think about things and have some degree of certainty about the correctness of an idea.

I usually have a pretty good understanding of how what I'm doing works. The issue is that you have to memorize the specific names and symbols. I'd much rather just write out the logic behind the proofs rather than pointless mathematical terms and such.
Mathematical notation is not pointless. If you can reduce a problem to symbolic manipulation in well-defined patterns then you can make your solution less error-prone. It's easy to see that this:

2x = 2y
x = y

is a valid transformation. Doing the same for this:

"If the double of one number is equal to the double of another number, this is equivalent to the first number being equal to the second number."

is more difficult. For one, a computer can do the former, but not the latter.
Mathematical notation is not pointless. If you can reduce a problem to symbolic manipulation in well-defined patterns then you can make your solution less error-prone.

Definitely not without its place, but it just seems stupid when you're in the classroom and you can literally hold the teacher's hand through every step in the problem, but because you didn't memorize a specific terminology you don't get the credit. It's pointless in the sense of having such a difficult math course specifically for it.

Coding mathematical equations like this may benefit from this knowledge, but it's nothing you couldn't figure out in a sitting. I just took a logics class that wanted to make logic as illogical as possible by doing proofs for logic. I heard this class was very similar to the math one I'm about to take.

It was taken online here, there's a free version anyone can try:

https://oli.cmu.edu/courses/logic-proofs/


Imagine the simplest of logic scrutinized and broken down so thoroughly, that it's comparable to coding in assembly. It's easy to see how it relates to programming since you have to program in this way, but it's overkill to the point where it's like "who would even do this and what practical application could this possibly have?"
but because you didn't memorize a specific terminology you don't get the credit
For example?

I just took a logics class that wanted to make logic as illogical as possible by doing proofs for logic. I heard this class was very similar to the math one I'm about to take.

It was taken online here, there's a free version anyone can try:

https://oli.cmu.edu/courses/logic-proofs/
From the table of contents it sounds like a perfectly standard logic course.

Imagine the simplest of logic scrutinized and broken down so thoroughly, that it's comparable to coding in assembly.
I imagine you're referring to the most basic transformations such as modus ponens, modus tollens, etc. The value of doing this is that it won't always be easy to, for example, transform one statement into another to figure out intuitively if they're equivalent. If you learn to do it step by step you ensure a higher level of rigor for yourself.
Not to mention, if you're trying to make an argument for something, it's always best not to skip steps in your reasoning, otherwise the other person can accuse you of non sequitur. Different people have different ideas of what's "obvious", so by following the most rigorous path you ensure that everyone's standards are satisfied.
For example?

In geometry, we'd need to know the names of theorems and such.

In my logics class, you may find a question worded like this, "could ____ be derived using the ___ rule?" So if you don't know the rule by name, you're screwed. Thankfully it was an online course.

From the table of contents it sounds like a perfectly standard logic course.

Maybe, it uses many symbols and such. Here's a link so you can take parts of the course without registering/paying:

https://oli.cmu.edu/courses/logic-proofs-copy/

Overall, the labs were what mostly were a pain. Doing them required understanding more than just the logic and rules. Moreover, the whole class just seemed extremely pretentious.

If you learn to do it step by step you ensure a higher level of rigor for yourself.
Not to mention, if you're trying to make an argument for something, it's always best not to skip steps in your reasoning, otherwise the other person can accuse you of non sequitur. Different people have different ideas of what's "obvious", so by following the most rigorous path you ensure that everyone's standards are satisfied.

Yea, this is the main (if not only) reason such a class exists. But it boils is down so barebones that I can't even say what I was doing resembled logic in the labs. The quizzes were for the most part very logical and straightforward, but the labs seemed to almost be an entirely different field where you stopped thinking about logic in terms of arguments and sequential logic, to almost just playing an overly complicated logic game.

It felt like learning Calculus in order to add 1+1, it was just overly complicated BS that I saw in the lab portions.
Pages: 12