Where can I learn assembly? | SoloLearn: Learn to code for FREE!


Where can I learn assembly?

I really want to learn assembly and I can't find anywhere where I can learn it

1/16/2021 9:53:47 PM


20 Answers

New Answer


As much as assembly is (*typo edited) dependent on the processor type, the different types of assembly are also very similar in many ways. The easiest assembly to start with is assembly for the CHIP8. CHIP8 is mostly an emulated toy nowadays but it is a full learning experience. Each instructions are a byte size. i am sure you could find one assembler and emulator on github somewhere. Then there is the 6502 which is another easy 8bit processor to program. Fairly small operations set. You can also find many emulators (eg a commodore emulator) for it and assemblers. For the old x86, many tutorial are still showing how to program on the x86 on msdos. It is actually very fun to do, you have a variety of interrupt codes to call for bios or msdos functions. For the modern x86, i learned GAS recently and is assemble by GCC (GNU C Compiler). Is very good and useful, as you can mix your assembly code with the C library.


The usual way to learn assembly language instructions is to the read the processor instruction set manual. In the case of the Intel x64 and IA-32 architecture it's a 10 volume set. https://software.intel.com/content/www/us/en/develop/articles/intel-sdm.html Atmel AVRs, Intel 8051s, Microchip PICs and ARM cores each have their own manuals too. Once you have studied the instruction set for your chosen processor you will need to learn the specific assembler you intend to use. Even assemblers for the same processor from different vendors can vary in features, functionality, and directives.


Hey Martin Taylor peace bro. it s just a matter of opinion. i like programming, all kinds of it. same goes with assembly, i like all kinds as well and of course i think msdos is great for novice. i truly believe it. i have seen great programmers, real rock stars that learned on old systems. the teaching power of older systems should never be underestimated.


Sonic pretty much. learning is not futile though. there is no quick road to programming success. why not take the scenic route then? also whoever is frustrated because of something i told, im sorry. just dont listen to me then. im not responsible of your confusion.


Assembly is specific to each processor and is not a common language that can be learned from a general tutorial site.


i ll drop this here. these examples would work on linux with x86-64 processors. https://cs.lmu.edu/~ray/notes/gasexamples/


while is also dependent on os, true but that is only changing the system calls (or API calls).


Martin Taylor one's reason to learn something mjght be of a personal value that you may not / won't understand. perhaps in this case is just to nurture curiousity. perhaps the guy wants to built his own esoteric language compilers. perhaps he wants to optimize to the bones his c code for faster excution.


yeah so if you have a raspberry pie, you will program ARM architecture assembly. the instructions will be very similar, some moves, some branching/jumps, etc.


ChillPill is that a typo? "assembly is independent on the processor type" Assembly language is specific to the processor type, not independent of it. Furthermore, assembly language is not usually portable between different assemblers for the same processor type. Different assemblers from different vendors can be very different in capabilities and may use vendor specific directives. Saying all assembly languages are the same because they have move and branch instructions is like saying all programming languages are the same because they have loops and procedures. RISC vs CISC cpus are as different as Python and Java, likwise using Von Nuemann vs Harvard architecture. How you go about programming a microcontroller with a restricted hardware stack vs a Raspberry Pi is very different. Even different ARM devices have different instruction sets for the different families, as do the different families of AVR microcontrollers. In fact some ARM devices have two completely different instruction sets within the same cpu. The ARM32 instruction set and the 16-bit ARM Thumb instruction set, and it is possible to switch between them. The old ms-dos assembly language tutorials found on the web are of no use today. Support for 16-bit ms-dos code was dropped from 64-bit operating systems so you won't be able to run such code on a modern machine. If you are going to use a dos emulator then you might as well learn z80 assembly language in a cp/m emulator. Assembly language code is also Operating System dependent. You spend as much time learning the low level OS API as you do the cpu instruction set. GASM/NASM code written for x64 Linux will not be portable, even at the source code level, to x64 Windows. One final thing to note is that a modern optimising C compiler will generate more efficient code than a bad assembly language programmer. Then again, I've only been writing assembly code since the 1980s, so what do I know?


with assembly you can also do what this guy does https://youtu.be/6Z6xMBbQdZw he programs pic that is worth less than 50 cents.


ChillPill why do you think I "may not/won't understand"? If you read my comment instead of being flippant I said that some of the reasons to learn assembly language were "writing the back end to a compiler" and "For laughs and giggles" i.e. out of curiosity or just for the fun of it. As for encouraging someone to learn ms-dos assembly language that's just irresponsible. The poor soul may end up trying to get ms-dos tools to work on a 64-bit system, which does not support them. Even if they get a cross compiler to work they will then find out that they can't run the code they have created without a dos emulator. Stepping through assembly language in a debugger is fascinating and gives a good insight into the workings of computer architecture, especially the use of the stack frame in languages like C/C++. However, being such a low level language it is difficult to work with, especially for novices. So advising people to write code that may not even run on their architecture will only frustrate and confuse someone. Which is why I asked why they wanted to learn assembly language. For all I know they want to program an Arduino or A PIC microcontoller, as the YouTube link you provided does. The PIC10F200 that he uses in the video only has 33 instructions, definitely a RISC core. An x64 device has almost 1,000 different instructions at the mnemonic level. It's like comparing 1960s Dartmouth BASIC with Java and saying they are the same because they both have variables and loops.


i guess i did a typo. i meant dependent because i meant to write your wirds more or less Martin Taylor that said, yes all assembly languages share similitudes. im not lying. what is diferrent mostly are the registers they have, how big the registers are, how many, and the names. but a register still is just a bucket of bits were you shuft bits, mov bits.


So are you saying I learn the type of assembly for the specific processor of my computer




So the 'conclusion' of this discussion for the average reader may be that learning msdos and assembly could be quite educational and enjoyable but it also could be a fairly frustrating and futile journey (depending on your goals and personality)??


Ok, thanks


Ben, The assembly language that you learn will depend on what you want to do. If you want to learn assembly language programming for Windows then you learn ia32 and/or x64 assembly for Windows. If you want to learn assembly language for ARM Linux on a Raspberry Pi then you learn NASM/GASM and, depending on the model, either ARM11, ARM-Cortex-A7 all the way up to a 64-bit Quad core A57 ARM instructions. The only reasons to use assembly language these days are... When no other language is capable of doing the job in the required time frame, You are writing the back end to a compiler. You are developing for extremely resource constrained embedded devices. For laughs and giggles. I wrote an embedded time triggered operating system for a microcontroller that had only 8KB flash (code) memory and only 256 bytes, yes bytes, of ram using C and never used a line of assembly language. So tell me, why do you want to learn assembly language? This isn't the 1980s with 8-bit cpus running at 4 MHz clock speeds.


Books, YouTube, Sites with information, platforms


you can completely understand assembly from here: https://www.tutorialspoint.com/assembly_programming/index.htm