#AssemblyProgramming #LearnProgramming #ProgrammingLanguage #AssemblyLanguage #BeginnerCoding
π Hey there! If you’re new to the world of programming and wondering if you should dive headfirst into learning Assembly as your first programming language, you’ve come to the right place. This is definitely a hot topic in the programming community, with lots of varying opinions.
So, let’s address the big question: Should you learn Assembly as your first programming language?
Why Assembly?
Before we jump into whether or not you should start with Assembly, let’s talk a little bit about why some people are drawn to it as a first language. Assembly language gives you direct control over all of your computer’s resources, allowing you to truly understand how your computer works at a fundamental level. Plus, it enables you to debug programs without access to the original source code, which can be a pretty cool skill to have in your programming toolkit.
However, the consensus is that learning Assembly as your first language can be incredibly challenging and may not be the most practical choice for a beginner. It’s important to consider the potential roadblocks and frustrations you may encounter along the way.
Is Assembly the Right Choice for Beginners?
While it’s certainly possible to start with Assembly, many experts in the field recommend starting with a higher-level language first, such as Python or JavaScript. These languages are generally easier to learn and provide a solid foundation in programming concepts that can be applied to learning Assembly later on.
Here are a few reasons why starting with Assembly might not be ideal for beginners:
1. Steeper learning curve: Assembly language is low-level and can be difficult to grasp for those who are new to programming.
2. Limited practical application: While Assembly can provide a deep understanding of computer architecture, it may not be the most efficient language for completing everyday programming tasks.
3. Frustration potential: The intricate nature of Assembly programming may lead to frustration and discouragement for beginners.
Resources for Learning Assembly
If you’ve weighed the pros and cons and still want to take the plunge into learning Assembly, there are certainly resources available to help you on your journey. Here are a few options to consider:
1. Books: There are many books available that provide comprehensive and in-depth guides to learning Assembly language. Look for titles with good reviews that cater to beginners.
2. Online courses: Platforms like Udemy offer beginner-friendly courses in Assembly programming. Be sure to read the reviews and course descriptions to find the best fit for your learning style.
3. Community forums: Engaging with the programming community can be a valuable resource for finding tips, tutorials, and support for learning Assembly.
Ultimately, the decision to start with Assembly as your first programming language is a personal one. It’s important to consider your own learning style, goals, and the level of challenge you’re willing to take on.
In conclusion, while learning Assembly as your first programming language is not the most common approach, it’s certainly not impossible. With dedication, perseverance, and the right resources, it’s entirely feasible to embark on this path as a beginner programmer. Just be prepared for a challenging but rewarding journey ahead.
So, should you start with Assembly? The choice is yours to make. And if you do decide to take the plunge, there are plenty of resources out there to support you along the way. Good luck on your programming adventure! π
#ProgrammingLanguages #AssemblyLanguage #BeginnerProgrammer #LearningAssembly #UdemyCourses #AssemblyProgrammingResources
You can code in C for most of the usecases that assembly is useful for. Its a better low level(e.g. closer to the hardware) starting language.
Here are some usecases for assembly:
* Are you designing your own unique chip/CPU? (Understanding other assembly languages is useful to making your own)
* Are you writing your own Kernel from scratch and need to implement your own compiler for your new OS?
* Do you want to write driver code that is hand optimized?
* Are you looking to bypass compiler added security features to write exploits?
If yes to the above then assembly is for you. You can always write a simple program in C and then use a disassembler on it.
You can do it if you are really interested in learning how computers work. Assembly itself is not hard. There are hardly a few instructions, mov, add, sub, ldr, str, cmp, jmp and variations of it.
The hard part is that you will have to learn how computers really work at the lowest level, and that’s not a bad thing necessarily.
I would encourage to start with ARM assembly (if you choose to do it) as instruction set is simpler.
Once you learn it, you will realize how computers really work.
You can write inline assembly as well, do not have to compile .s or .asm files
There is an online emulator as well [https://cpulator.01xz.net/?sys=arm](https://cpulator.01xz.net/?sys=arm) and a youtube tutorial [https://www.youtube.com/watch?v=gfmRrPjnEw4](https://www.youtube.com/watch?v=gfmRrPjnEw4)
Nope. Definitely not– unless the only platforms you literally *ever* plan to work with are small embedded systems or the original NES or something like that? Even then there are easier ways to get into it.
If you want to dip your toes in assembly without getting a soaker, consider trying a toy assembler like [TIS-100](https://store.steampowered.com/app/370360/TIS100/), [Human Resources Machine](https://store.steampowered.com/app/375820/Human_Resource_Machine/) or [7 Billion Humans](https://store.steampowered.com/app/792100/7_Billion_Humans/). You’ll have fun, learn a bit and hopefully understand why assembly isn’t viable for serious, modern coding.
I see only discouraging comments it. However, I don’t really agree with them. Maybe it’s not ideal for the start, but learning assembly eventually is not bad. You will probably not write any serious project in that (there are some exceptions where it makes sense), but it helps you understand how does a computer work under the hood. It’s riddiculous how many professional programmers I met have no idea about some essential topics. The world needs more people that understand assembly at least on a basic level.
Only if you are interested in electronics and want to program a microcontroller or something
I’m actually doing this right now, sort of. The truth is I have played around a little bit with Javascript and Python in the past, so I can’t really say assembly is my first language. My background is in math, and earlier this year I made the decision to walk away from teaching at a high school in order to learn programming. A friend of mine who was a CS major has taken me under his wing, and is giving me his condensed, perhaps eccentric version of an undergrad CS curriculum.
We began with logic gates and computer architecture. I played through “The Nand Game” here: [https://nandgame.com/](https://nandgame.com/)
Next, we did some simple machine code using this Toy CPU emulator: [https://archive.fosdem.org/2023/schedule/event/learn_8bit/](https://archive.fosdem.org/2023/schedule/event/learn_8bit/)
Around this point, he got me set up with WSL and bash, Gitlab, and Emacs.
After that, my friend sent me the manual for Intel 8080 assembly language, and had me read through the entire thing: [https://altairclone.com/downloads/manuals/8080%20Programmers%20Manual.pdf](https://altairclone.com/downloads/manuals/8080%20Programmers%20Manual.pdf)
Then he got me set up with an Altair 8800 / Z80 CP/M 2.2 emulator. I think it came from here: [http://cpmarchives.classiccmp.org/cpm/mirrors/www.schorn.ch/cpm/intro.php](http://cpmarchives.classiccmp.org/cpm/mirrors/www.schorn.ch/cpm/intro.php)
He provided me with the following “Hello, world!” code and explained what’s going on (which required a brief intro to CP/M and BDOS system calls):
ORG 0100H
MVI C,9
LXI D,MESSAGE
CALL 5
RET
MESSAGE: DB 0DH,0AH,’Hello, world!’,0DH,0AH,’$’
Since then, I’ve learned about the stack, calling conventions, and have created a simple 4-function calculator.
I’m not gonna lie, it has been very confusing going at times, and this approach probably isn’t for everyone (or even most people). But I feel like I’m learning a ton and it was immensely satisfying when I got my calculator to work.
We’re moving on to C pretty soon, which I’m greatly looking forward to.
Anyway, I hope my story was helpful. The people saying “fuck no, bro” and “Are you insane” probably have good reasons for it, but it *is* in fact possible to fruitfully learn some assembly before higher level languages. And my friend, who is highly experienced, insists this is a better way to go than jumping into a Python bootcamp, if you really want to understand things.
Yes. I took that path and never regretted it. And I ended up knowing more about the inner workings of a computer than any of my colleagues. It widens your understanding in ways that will make you appreciate modern languages and compilers more, but will also make you care more about how things work, and not just how to use them.
My university started with logical gates, ALU operations/machine code then moved on to assembly, then C, then high level languages. It really gives you great low level understanding of the how a computer works. Itβs great if you want do do embedded dev. But it takes some focus
No. I’m taking Computer Organization this semester, after having some proficiency with Java and C++. I’ve had to write a couple SUPER basic programs in an ARM emulator.
Dabbling with assembly can be a great way to appreciate the hardware implementation of your code. You’ll learn how a CPU works, how multiplication and float math works, how memory cache and returning from fuctions works, how call stacks work. Assembly necessitate this knowledge.
But it fucking sucks to actually build something in. It will be extremely difficult. If you want a challenge, learn C++ as your first language.
If you’re curious about what assembly looks like, review the reverse engineered code for the original PokΓ©mon games. They were coded in pure assembly. Follow an online guide. Don’t code in it unless you have a good reason to.
Are you insane
How to speedrun burnout 101.
I’m pretty sure all materials about Assembly assume programming knowledge from the audience.
Also the knowledge will not translate to other languages as well as the way around.
If you want to learn Assembly, learn C first.
I say check out the course “From Nand to Tetris”. You can take it for free and design your own chip and learn to write software that run on it.
That will still give you a bunch of insight most people don’t have. While saving you the pain of trying to learn assembly on your own.
Automatic transmissions are popular in the US. Assembly isn’t stick shift. It’s manually controlling the ignition of the engine.
I would suggest learning how to write programs before learning how to debug them. I donβt imagine you will need to use assembly for any debugging in your early coding experience. If you are interesting in a language that uses hardware control then Iβd learn C.
I would say learn C and then learn assembly x86/64
Because when you use reverse software like ghidra, it will convert the assembly back to C so you have a correlation between them two
btw someone says “if you know really well assembly, every program is open source”
Hmm, probably not.
Modern computer architecture is very complicated, and unless you already know a lot of electronics you will need to learn a lot of technologies in parallel.
That being said, when I learned computers it was in the days of home computers, simple computers with no harddisk or operating system, just a BASIC interpreter and a (cassette) tape interface. I wrote some BASIC programs, but I didn’t really “get” how it all worked, until I set out to understand the Z80 processor and the machine language. We didn’t really have an assembler, so it was common practice to write the program on a piece of paper and then by hand translate it to hex code by looking the instructions up in a book. (I know that I sound like grandpa telling he walked ten miles to school through high snow.) Slowly I understood how the BASIC interpreter worked and why we could just write (almost) human language to the computer.
If you really want that kind of experience, then get an Arduino and learn the C dialect for it. You will definitely learn a lot and grasp a lot of the challenges related to the execution environment of a computer.
If you just want to learn to write programs, begin with Python. Read the official tutorial and work through the examples. You will have fun, and if you later feel like learning what a processor does, get the Arduino and a kit with thingies. As long as you have fun you can’t be wrong.
Do it let the world burn around you
If you start with Assembly you will emerge a god. You’ll probably hate it though and be overwhelmed.
>I’m new to programming and want to ask if is it a good idea to start with assembly?
**It is not.**
​
>but also a lot of people says it doesn’t matter what language you start with.
They’re not talking about assembly language.
​
>Why Assembly? I read online that assembly gives you direct control to all your computer resources…
It gives you such fine control that you have to tell the computer every single minute step of every single operation. Imagine that you’ve hired someone to paint a room in your house. In most modern high level languages, you’d say something like *paint the living room light blue*. In assembly, you have to tell the painter how to walk into the room, how to open the can of paint, when to grasp the brush, when to dip the brush into the paint, to move the brush to the wall, to move the brush up and down, and on and on.
Individual assembly instructions do very little; computers are only as powerful as they are because they can execute those instructions incomprehensibly quickly. An Apple M1 chip, for example, can supposedly run at 2.6 teraflops β that’s 2.6 *trillion* floating point operations *per second*. And because each instruction does so very little, you have to write *a lot* of instructions just to get anything useful done. And the more instructions you write, the more likely it is that you’ll make a mistake somewhere, which means more debugging…
​
>…and allows you to debug programs without source code…
Sort of. Machine code, which is what you get after you assemble your assembly language code, isn’t human readable; you’d need to disassemble that code first to turn it back into something that you’ll be able to understand, and even then you’ll still lack the names, comments, and other niceties that were in your original code.
​
>…which sounds really cool and I want to see whats possible with assembly.
I appreciate your enthusiasm! But believe me, there’s really nothing that’s possible with assembly that’s impossible from a higher level language. And the abstraction that’s available in a high level language makes a lot of things possible that just aren’t when you’re having to move individual bytes between memory and registers, check condition codes, perform address calculations, and so on.
Assembly language *is* really cool at some level. Once you get some experience with programming, you’ll be able to play with assembly a little bit at a time. You can write a program in a high level language, and then make it faster by identifying the part that takes most of the time and rewriting just that part in assembly. *If* a programmer uses assembly these days, that’s usually how they’ll do it β in tiny bits, and only cases where their compiler is missing some trick that would make a big difference. But these days, compilers are pretty smart, and they’ll almost always generate faster code than you will because compiler authors tend to know *all* the tricks.
​
>So, should I start with assembly?
Again, **no**. Learning your first programming language should be fun, and assembly language will *not* be fun, particularly when you’re trying to learn all the other things you need to know. Other languages like Python, Java, or Swift are much better starting points. You’ll get all the power you could possibly want, you’ll be able to actually *get things done* in a satisfying way, and you won’t be so hopelessly lost in minutiae that you give up.
Short answer: No
Longer answer: Absolutely not
no.. but also yes.. Writing any advanced program in assembly will be a big job, but don’t be discouraged in getting an environment set up and playing with it while you learn some other language. Controlling the hardware at that level is *fun* and programming for fun is ok
I learned some assembly in college after a couple years in my computer science degree. It’s really interesting and a complete nightmare. I would *never* recommend someone to start with it.
To my mind, you might as well tell an aspiring driver to start with a Model T if they want to learn how to drive. There’s no practical benefit and they’re likely to miss huge chunks of knowledge required to do things in a modern way. I’d stick with a more typical beginner language like Python. If you *really* want to go full neckbeard, maybe something like C++.
No don’t start with that. It’s true the language doesn’t matter, unless the language is assembly lol. Best way is to give you an example, let’s do a “hello world” program in python and assembly.
Python
print(“Hello World!”)
Assembly
section .text
global _start ;must be declared for linker (ld)
_start: ;tells linker entry point
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel
section .data
msg db ‘Hello World!’, 0xa ;string to be printed
len equ $ – msg ;length of the string
WTF definitely donβt! why would anyone learn assembly nowadays .
learn something practical JavaScript,Python,Java,c,c++
When I was first starting out (decades ago), assembly was one of the first languages I learned. However, there was a huge difference: back then, my code was sitting directly in real memory (not virtualized memory) on a system (Apple II+) that had no operating system, I had direct access to the hardware, and it was easy to make system calls into the Monitor ROM. You would just JSR to an address.
Unless you plan to learn assembly in a brutally low level embedded space (and now I’m wondering what those would be), you’re going to have to make calls out to functions in your enclosing OS in order to do anything useful. Back on my Apple computer, I could just write a 0x41 to 0x400 in memory, and an ‘A’ would appear on screen. I could make fun things happen all on my own. But when I was helping someone with more recent assembly, he had to push things onto the stack and worry about the calling conventions for higher level functions, calling into the same sorts of functions you’d be calling into from C, but with a lot more pain. I just don’t know if it’s worth it, besides as an exercise.
I think if you learn C first, since you’re looking to be “closer to the metal”, then you can also look into how that translates down to assembly/machine code (machine code disassembled). Once you do that, you may be really glad you didn’t start there.
I know assembly (generally), I enjoyed writing assembly code in the past (6502, Z80, 8086), and yet I don’t know if I’d want to try to code in assembly with modern processors in modern environments unless I had to.
Having said all that – it’s up to you what you want to do. If you do go that route, consider it more an exploration into how the computer works at a fundamental level rather than anything you’d really be doing in the future. Which is still a good thing, from a learning point of view; don’t get me wrong. Too many people seem to want to learn as little as they can.
Learning Assembly first would be like learning how to build an engine before you start learning how to drive a car
HELL NO. I knew about 6 languages before I started assembly and still couldnβt figure out that language. It is a very low-level language. Major props to anyone that can. Honestly one of the easiest languages to learn programming is python, since it is very pseudoesque in its syntax and considered a high level language. Then after python Iβd then learn Java as it gets a little lower level (still high level) and is a popular language. Then after that Iβd learn C (getting even lower). Youβll deal with more difficult concepts like pointers and how programs compile. Then after C do assembly. Id recommend learning x86-64 assembly code specifically.
There is nothing wrong with learning a bit of assembly for academic purposes.
This is actually a really good idea. I firmly believe that to be a real engineer you need to have a good understanding of the fundamentals. This is what separates the boys from the men
#BUT
Timebox Ur learning because ultimately u need to be proficient in the higher level languages to be a commercially valuable engineer.
Go with C instead since it just one step above assembly to βmachine codeβ and also it will help teach you memory management
Fuck no. Learn javascript
I think starting with higher level languages is easier to learn the basic concepts or start with C if you are more of a hardcore person. I started with JavaScript, then Python, and finally started working in Rust.
Do what you want, but itβs not the level of abstraction people typically work with. The assembly-knowers that I know of mostly got into it because of old video games. If your hobby demands it, go for it, otherwise itβs more curiosity than practical tbh.
I would suggest you start with C as that should be complex enough already.
However if you must use assembly, 8086 is a good start.
First of all there isn’t “assembly language”, there is assembler instruction sets (ie. ARM RISC, x86 CISC, 6502) and language of symbolic addresses.
> Why Assembly? I read online that assembly gives you direct control to all your computer resources
Lot of languages do this, ie. C, Pascal, FORTRAN, Zig, Rust etc. The difference is that all of those provide meaningful level of abstraction.
> allows you to debug programs without source code
I don’t even know what this means. You can grab a valgrind and do a lot of stuff and don’t need to know assembly for that, how useful that is is another question.
I would strongly recommend you to learn
standard C99 (learn-c is great ressource), you are still working with hardware very directly but it’s a lot easier to scale and maintain as well as port to other systems, but if you are dead set on learning asm start with 6502, you can run it on emulator (highly doubt you have CPU which supports it) and it provides good medium between all the quirks of CISCs and the DIY nature of RISCs. There is plenty of ressources for it on the internet like https://skilldrick.github.io/easy6502/
Almost everything can be done in C instead and usually the compliler will even produce faster (assembly) code than you. Debugging a program for which you have the source code is hard enough but it is not fun to debug based on assembly code.
So, for most people assembly is not useful and, particularly, it is not a good first language. Python is a typical first language and has great learning material; if control of hardware is really important, you can also learn C.
However, most important is to have some motivation, and if you feel that only assembly can motivate you, give it a try: Play some human resource machine (an assembly-like game), graduate to an assembly simulator and then maybe to Arduino. Learning materials however, are probably hard to come by.
Start with machine code if you wanna start from the very beginning, just type 00111011 etc for everything lol. On the real tho, start with a higher up language like python or something
fuck no, bro
​
>I read online that assembly gives you direct control to all your computer resources, and allows you to debug programs without source code, which sounds really cool and I want to see whats possible with assembly
to get to this point you don’t only need to be quite proficient in assembly (which is a lot to say) but you need to understand a lot of architecture, operative systems, etc.
wanna learn the basics and someday have a good grasp over the system? learn C.
Absolutely not.
First, no, assembly does not give you direct control of all your computer’s resources. They are still managed by the operating system, regardless of what language you are using. While there are some low-level things you can do in assembly you couldn’t do in, say, Python, there’s nothing really you could do in Assembly you couldn’t do in C. They also don’t allow you to debug without source code. Sure, you can run a disassembler on a program. But that’s not necessarily going to give you output that’s any more useful than running a decompiler. For a complex program, that output is going to be close to useless to a non-expert
Second, assembly languages (there’s not one assembly language, but a different one for each processor architecture) are absurdly low level. If you are new to basic programming concepts, you will just drown in assembly.
Learning to code assembly is a good skill for a developer, it gives you a better understanding of how computers actually *work.* But as a first language it is a terrible choice.
no, assembly is not a great starting language. it might be so hard that you end up hate programming.
maybe learn it if you want to learn to make a driver or are that interested..
seems more beneficial to learn something modern which can do way cooler stuff that just “take direct control of the the computer”. I can do that with c++ also.
Python is a great language to learn.
Only a few are able to read let alone write assembly code properly. Itβs like reinventing the wheel makes no sense IMHO others have the thought about this for you. Unless you are super into it than go for it. But otherwise start with C.
No. You will not have the basics for working on assembly. If you want to program in assembly start with C.
While it doesn’t really matter what language you start with, assembly is a big hurdle.