you can become a GIGACHAD assembly programmer in 10 minutes (try it RIGHT NOW)

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 969

  • @LowLevelTV
    @LowLevelTV  5 місяців тому +26

    you can learn assembly at lowlevel.academy 😵😵(get 20% off with code ARMASSEMBLY20)

    • @worldwarwitt2760
      @worldwarwitt2760 3 місяці тому +1

      make a small boot loader, assemble it, pump it to an ISO, then boot the ISO in a VM, and make sure the asm uses the bios teletype to hello world.

  • @lennarth.6214
    @lennarth.6214 Рік тому +2753

    I agree that Assembly itself is easy. The hard part is understanding your hardware, all the opcodes and the memory to name a few.

    • @Rin-qj7zt
      @Rin-qj7zt Рік тому +132

      i mean, I wouldn't call the need for table lookups hard. just tedious and unwieldy. Which is probably the point. I would add that a good general rule is probably that if it's meant to be an industry skill, it's likely not hard because it would therefore not be profitable. That of course doesn't mean it doesn't require a bunch of learning preparation as boilerplate or require an ungodly amount of tedious work. An exception might be something like surgery that is just so fundamentally important that we do it no matter how hard it is and just retroactively structure things to make it profitable. Like give surgeons protections against lawsuits when their patients die in surgery, provided malpractice wasn't happening.
      A lot less stuff is hard than people think, and it discourages a lot of people from learning.

    • @tonysofla
      @tonysofla Рік тому +72

      The hard part is when it becomes large you are ending up creating macros and functions, that you reinvent the wheel with your own custom crappy version of pseudo-C.

    • @bpark10001
      @bpark10001 Рік тому +46

      The hardware of the CPU is not the hard part, that's outlined on 10 pages; it's the rest of the system: operating system, viruses, security, disk drives, web portal, libraries (you need to know the interfaces to the libraries to use them). That stuff requires a LIFETIME to master, & it is constantly changing.

    • @anon-fz2bo
      @anon-fz2bo Рік тому +15

      The syntax is gibberish tho
      mov eax, dword ptr ss:[esp+] some shit, wtf? I'm trying learn it for hacking games but I find c++, rust etc far easier

    • @reynoldskynaston9529
      @reynoldskynaston9529 Рік тому +11

      Yeah it’s much easier to let compilers write assembly for you

  • @sempersolus5511
    @sempersolus5511 Рік тому +2108

    The problem is how time-consuming it is to write everything because it's all broken down into little tiny steps.
    I considered writing some macros or something before I realized I was inventing C from first principles.

    • @tonysofla
      @tonysofla Рік тому +186

      So true, your own custom crappy version of pseudo-C. Assembly is fun to know and is a must if you play around with a 6502
      On Arm I only use it now when I needed to preset values for a reset (reboot) to a new fixed address.

    • @igorthelight
      @igorthelight Рік тому +96

      I think you can write C code, then ask compiler to generate Assembler code out of it - now you could learn from it or modify ;-)
      Fast and tweakable!

    • @malsdenmd
      @malsdenmd Рік тому +22

      Yeah I've been running into that issue myself lately. The thing is, I haven't touched anything besides Assembly in my life yet, and it still happened

    • @jrstf
      @jrstf Рік тому +40

      Not everything should be written in assembly but some problems are easily solved that way. I've been programing an Arduino in C and I'm quite sure it would be easier in assembly. I have no way of knowing if the C will even work reliably because I have no way to know what code it generated, it is quite possibe my interrupt routines will take longer to execute than time available. This is not something easily tested because the errors will only show up under certain load conditions.

    • @charlesmayberry2825
      @charlesmayberry2825 Рік тому +19

      @@igorthelight The nature of compilers in general, they create the intermediate files which are assembly, then feed that through the linker to produce machine code, you are correct that you can set a flag to preserve the assembly code. Generally the compiler toolchain is configured so the compiler breaks down the code, produces an efficient assembly then it will write the object files, run it through a linker then produce a final runnable file.

  • @leon_De_Grelle
    @leon_De_Grelle Рік тому +286

    Learning Assembly isn't nowadays just for embedded, driver, kernel, etc. programmers but for anyone that wants to understand the WHY and HOW of your higher level programming language and your operating system. You'll develop a better understanding of what's happening under the hood so to say.

    • @homeopathicfossil-fuels4789
      @homeopathicfossil-fuels4789 10 місяців тому +19

      Thanks for saying this! When you throw away all high level knowledge in computing in favor of learning it all again bottom up, it suddenly becomes scary how many people in software development work with a system they dont understand on any concrete or essential level. It is kinda equivalent to taking your car to your mechanic and they dont even understand basic concepts like torque or gear ratios.

    • @e_c6324
      @e_c6324 7 місяців тому +3

      Agreed! Plenty of people “showing” assembly, nobody teaching how to use it and accomplish things.

    • @SirusStarTV
      @SirusStarTV 4 місяці тому +1

      High level languages can abstract away things for a time being, then you must know more than high level stuff to optimize your program in memory consumption and how many cpu cycles your algorithms take.

  • @JacobdelaRosa
    @JacobdelaRosa Рік тому +497

    I still can't believe Chris Sawyer made Roller Coaster Tycoon entirely in assembly. Possibly the biggest chad move in coding ever

    • @travis8106
      @travis8106 6 місяців тому +20

      That just blew my mind

    • @SMGJohn
      @SMGJohn 6 місяців тому +33

      Coding games in assembly was common in the day

    • @travis8106
      @travis8106 6 місяців тому +75

      @@SMGJohn Although it was common, it wasn't used for games as complex as this

    • @tigros999
      @tigros999 6 місяців тому +10

      also Anders Hejlsberg's Turbo Pascal compiler, will forever be impressive!

    • @anonyash
      @anonyash 6 місяців тому +1

      They are my inspiration

  • @metroidnerd9001
    @metroidnerd9001 Рік тому +86

    I use Assembly for ROM Hacking, and I was really intimidated to learn it at first, and it took me taking a class in ARM Assembly to realize that it's actually not that bad. Once I figured out how 65816 Assembly interacts with SNES hardware and the game itself, I've been able to pull off a lot with it. It's a lot of fun, and it makes you feel really smart when your code works exactly as intended!

    • @costelinha1867
      @costelinha1867 Рік тому +12

      6502, the language used in NES rom hacking, there's an youtube channel dedicated to Nes 6502 Assembly btw. It's called NesHacker.

    • @technicolourmyles
      @technicolourmyles 9 місяців тому

      Which class did you take?

    • @Munakas-wq3gp
      @Munakas-wq3gp 2 місяці тому

      I started to code my own car game to C64 but had to abandon the project because there was no internet to search from and all the books on the subject were either outdated or full of errors...

  • @LogicEu
    @LogicEu Рік тому +435

    Completely agree! Assembly is much simpler than most programming languages, learn the basic operations and registers and that's pretty much it. The hard part is keeping track of all what’s going on in your head!

    • @michaelstoeckel2954
      @michaelstoeckel2954 Рік тому +55

      Sure. Assembly is easy, because the opcodes are simple commands. I think what it makes it hard is the real programming. Like, if you want to sort an array .. pretty easy in Python, Java, .... in Assembly not so much, because you have to programm every tiny step of the algorithm.

    • @maxmuster7003
      @maxmuster7003 Рік тому +22

      You have to understantd how the CPU works, how to use the memory addressing and how to control hardware components like interrupt controler, timer chip, keybord, mouse, sound card, how to use BIOS software interrupts from mainboard and graphic card, network cards and a lot more. I do this for many years, but it never end. Actualy i try to learn to program ADLIB 3 register for sound.

    • @PFnove
      @PFnove Рік тому +16

      @@michaelstoeckel2954 thats the fun part in my opinion, reinventing stuff that already exists is fun for some reason

    • @tomasfiorentini4126
      @tomasfiorentini4126 Рік тому +11

      That's why it's useful to use a simulator that runs step by step and shows you the value of your registers.

    • @maxmuster7003
      @maxmuster7003 Рік тому +2

      @@tomasfiorentini4126 Yes, it is very importent for beginner to know what a single instructions exactly is doing. I began to learn assembly on 6502 CPU with three 8 bit register before i switched to 80286. There are some tiny diffences on how some instructions works and if a flag in the flag-register is touched or not touched for example. I used debug from MS DOS in the first half year. I take a while to understand that to build a routine on x86 is more simple. Only 8 bit instructions is the hell if you have to handle almost with 16 bit calculations.

  • @genericyoutubechanneluwu
    @genericyoutubechanneluwu 5 місяців тому +113

    "assembly isnt that hard..."
    18 lines for a simple hello world program

    • @baconheadhair6938
      @baconheadhair6938 2 місяці тому +15

      🎉18 lines of pure love🎉

    • @PAYNE-r8z
      @PAYNE-r8z Місяць тому

      @@baconheadhair6938 bro get some help and don't forget to touch some grass ✌️😉

    • @hodayfa000h
      @hodayfa000h Місяць тому

      Yes it is just time consuming

    • @biocta
      @biocta Місяць тому

      I mean people who've never touched assembly tend to think hello world is hundreds of lines of pure binary. It's really not THAT bad, there are only 8 real instructions here.

    • @amynagtegaal6941
      @amynagtegaal6941 28 днів тому

      That's literally why it's not a hard language, because it's simple, minimal.. well not as-in the code you write but the language itself is minimal-ish, the actual hard part about it is understanding the hardware

  • @ristekostadinov2820
    @ristekostadinov2820 Рік тому +104

    My understanding of assembly is fairly trivial, but not gonna lie i had fun time learning Intel 8086 assembly in college.

    • @therealb888
      @therealb888 Рік тому +3

      How long ago was this? Intel 8086 brings back memories

    • @ristekostadinov2820
      @ristekostadinov2820 Рік тому +14

      @@therealb888 the course officially stopped being taught last year. I think it was picked that assembly because we studied in depth the architecture in the theory lessons and that processor is relatively simple to explain to newbies comparing to more complex processors.

    • @Alguem387
      @Alguem387 Рік тому +3

      Well I didn't, but nevertheless I felt compelled to implement printf in 8086 16bit assembly, i felt proud and miserable at the same time

    • @shadowchasernql
      @shadowchasernql Рік тому +1

      Good for you! For simple stuff, x86 asm has basically stayed the same, it's just as brain-bustingly poorly designed as always!

  • @minhquando100
    @minhquando100 Рік тому +130

    This is why I recommend people take a compilers class. Understanding the intricacies of compilation really helped me to understand how assembly worked; especially when it comes to how the registers are managed and how it interacts with the stack during function calls.
    Someday I’m going to try to implement Donald Knuth’s MIX computer architecture (emulate it on qemu), build an assembler for it, and maybe even build an LLVM backend for it and a small compiler to compile a toy programming language down into mix.

  • @mage3690
    @mage3690 Рік тому +126

    FINALLY, A TUTORIAL I CAN FOLLOW. Not that I couldn't follow along on all the other ones, but I have been banging my head against this wall for years. Somehow, I've never been able to get so much as an actual error message out of the assembler. Seeing "syntax error" because I forgot the leading periods in the asm file made my whole week.

    • @infiniteplanes5775
      @infiniteplanes5775 Рік тому +8

      I have occasionally created CPU simulations before, and I create custom versions of machine code. Programming anything was pretty awful.

    • @anon_y_mousse
      @anon_y_mousse Рік тому

      I recommend learning either nasm or fasm as they're far easier to use and understand than GNU `as`. They also implement a much better syntax.

    • @91722854
      @91722854 Рік тому +1

      is the wall finally broken? have you finally proved that your head is harder and tougher than the wall?

    • @KarolinaRiddle111
      @KarolinaRiddle111 8 місяців тому

      @@kipchickensout hihi. xd Like in here: mov rdi, qword ptr[rsi]? ;)

  • @sendut
    @sendut Рік тому +37

    The only difficulty of assembly is the fact that is the most machine-like language u'll ever have, If u turn your mind into that and consider what a computer actually does, it turns far easier (it's not easy btw) to learn.

  • @elstink
    @elstink Рік тому +54

    I've been learning 32 bit assembly for a uni class and this has been way more helpful than anything my prof has taught even if 64 bit is a little different

    • @ufufuawa401
      @ufufuawa401 Рік тому

      x86 stuff is so much different with x64. I just sugeest you to learn x64 directly not after learning x86

    • @airstrike5062
      @airstrike5062 Рік тому +2

      I'm learning 32-bit assembly in class too (MIPS-flavored, idk why...) and this video has been more meaningful than 4 hours in class...

    • @khatharrmalkavian3306
      @khatharrmalkavian3306 Рік тому

      MIPS is pretty easy to work with, and it's the architecture of PlayStation, so if you ever want to hack PSX games you've got a head start.

  • @mrsquiggles1379
    @mrsquiggles1379 9 місяців тому +9

    Awesome now time to build roller coaster tycoon from scratch with 0 references

    • @rajarshibiswas9424
      @rajarshibiswas9424 3 місяці тому +1

      bro you just gave the clear defination of fear and frustration 😂😂😂

  • @silicalnz
    @silicalnz Рік тому +26

    tis-100 is honestly where most of my assembly knowledge comes from. It''s definitely not the full writing in assembly meme, but it's close enough to understand the high level of how it's working and you get to solve some cool puzzles along the way.

    • @williamdrum9899
      @williamdrum9899 Рік тому +1

      Good grief, that game is something else. I think it's much harder than any 8 bit micro I've ever worked with!

    • @simonw3858
      @simonw3858 Рік тому +4

      I was thinking about trying that game. I have played shenzhen IO which is fun.

    • @khatharrmalkavian3306
      @khatharrmalkavian3306 11 місяців тому

      Exapunks is good too

  • @GBA8GEHWJWE
    @GBA8GEHWJWE Рік тому +105

    Huh, you managed to make asm acctually understandable. I'll acctually try to pick it up after this considering I am into electronics. Cheers lad. Takes special skill to explain like this.

    • @Maric18
      @Maric18 Рік тому +12

      the fun thing about asm is that its not hard, it is as easy as it can get. but its so incredibly detailed that doing anything big in it takes a lot of work. Not an inhuman amount of work, mind, roller coaster tycoon was written in asm back in the day :D

    • @Zcooger
      @Zcooger Рік тому

      @@Maric18 Locomotion too obv. and it's currently rewritten into C++ OpenLoco.

  • @mikegofton1
    @mikegofton1 Рік тому +79

    Assembly is really useful when you need optimal performance from your hardware, but it's much more time consuming than C or higher level languages.
    Back when CP/M and the Z-80 ruled, you'd use inline assembler in Turbo Pascal to speed up graphics calls.
    It was also used to emulate hardware peripherals - software serial ports, cassette tape drive IO or composite video outputs ( e.g. Sinclair ZX-80).

    • @LunaticEdit
      @LunaticEdit Рік тому +9

      Absolutely. Assembly _was_ useful when you needed optimal performance. But Intel chips are CISC and these days there's over a thousand opcodes, one of which may do what you're trying to do 10x faster.

    • @maticz3923
      @maticz3923 Рік тому +4

      No its not useful anymore
      Compilers write way faster code then one could write by hand

    • @williamdrum9899
      @williamdrum9899 Рік тому

      REPT 1024
      LDI
      ENDR

    • @jeffspaulding9834
      @jeffspaulding9834 Рік тому +1

      Huh. TIL Turbo Pascal had versions for 8-bit machines. I always assumed it started out life as a DOS program.

    • @yancgc5098
      @yancgc5098 Рік тому +4

      @@maticz3923 Well yeah, if you’re a mediocre programmer then of course a compiler can write code just as good if not better than yours. If you’re one of those master assembly programmers like Randy Linden or Chris Sawyer though then no, a compiler is still slower.

  • @AlexESR71
    @AlexESR71 9 місяців тому +3

    what i've noticed since i started learning to code and web dev for one year is all languages and coding structures are just a matter of time. The most time consuming aspect of it though is all technologies revolving around them, from ides to frameworks to practical examples. That's the stuff most people skip over in these "guides".

  • @MrDaneshdaroui
    @MrDaneshdaroui 8 місяців тому

    Perfect! Thanks for keeping Assembly alive! I believe most of the young programmers won't really appreciate it, but this is a great initiative! Thanks again!

  • @bitmasked
    @bitmasked Рік тому +6

    This is great - thanks for putting it together. Minor nitpick: "\" = backslash (per iso8859 and utf-8), "/" = slash

  • @amosnimos
    @amosnimos Рік тому +13

    that's actually one of the cleanest hello world i have seen in assembly.

  • @deanlhouston
    @deanlhouston Рік тому +19

    The most exciting part about assembly language is discovering the different ways different chip manufacturers implement their code, such as the classic little-endian vs big-endian memory addressing, or even how the internal registers look - Microchip PICs are a good example of a totally different strategy from Intel based register architecture.
    The point of all this is you can "say" you know how to write code in assembly language, but any other experienced assembly coder will ask you "which one?", as there are as many assembly languages as there are types of CPU. I was fortunate enough to get to learn the assembly language for the AP-101S CPU used on the Space Shuttle!

    • @khatharrmalkavian3306
      @khatharrmalkavian3306 Рік тому

      Once you understand modern computer architecture it's pretty trivial to learn a new flavor. Going from 6502 to x86 would probably be difficult, but going the other direction can be done in about an hour. It's more like learning a accent than learning a language.

    • @allanpatterson7653
      @allanpatterson7653 9 місяців тому

      Copyright part of it.

  • @olafbaeyens8955
    @olafbaeyens8955 Рік тому +10

    I got inspired by your assembly course, got myself a risk-v board and I am now trying to create an assembly only project.
    First steps, creating macro's for push, pop and basic string functionality so at least I have some way to debug my code. 🙂
    I actually cheat a bit, chatGPT is a big help in assisting me to get the macro's. However sometimes it gives me wrong information.
    I could not manage to get my Windows 10 set up correctly, but used an Raspberry pi 4 instead, VS code that can remote connect to the Raspberry pi and off I go.
    Programming in pure assembler, you have no idea how easy it is compared to bloated higher level languages that have a steeper learning curve than assembler.

  • @KayOScode
    @KayOScode Рік тому +8

    Asm is very simple in principle, but to use it effectively, you really have to know the hardware you’re working in. Not to mention you have to keep a lot in your head at once such as which registers you can write to, and which registers hold the values you need, and which registers will be overwritten by another op. Not even getting into things like the question of whether your stack is aligned or not, if you popped all registers you pushed off the stack and where your parameter is located in stack relative to the current stack ptr (if you don’t have a base ptr). Add those things together and you end up with a kind of difficult to use effectively language

    • @olafbaeyens8955
      @olafbaeyens8955 Рік тому +1

      It is just a a habit. You learn these habits pretty fast.
      And you create macro's, functions for it, inventing a language that is optimized for the code challenge.
      C is way harder to to learn and write. And there us a lot of bloated historical technical depth in C.

  • @thomaswesleyscott4555
    @thomaswesleyscott4555 Рік тому +14

    Great, great video. Having learned some ASM 6502 this past year made this video feel very accessible. It gets easier with time and practice! Who knew? Thanks for making this.

  • @igomesigomes
    @igomesigomes Рік тому +5

    Assembly applications in real world can be divided in two categories: 1) learning/fun purporses. The code here will be relativelly small, simple to understand and maintain. Nothing special. 2) real applications/demo scene/games. These WILL require a lot of discipline and patterns to organize files, procedures and naming conventions. In this case, it is also mandatory to grab a good set of libraries to not reinvent the well every single time you start a new project. But that is true for any other language; imagine writing anything in C or C# or Java without any packages/libraries!

  • @IlyesCodes
    @IlyesCodes Рік тому +59

    You are such an inspiration man

    • @LowLevelTV
      @LowLevelTV  Рік тому +17

      :)

    • @kissinger2867
      @kissinger2867 Рік тому +3

      @@LowLevelTV It's true, I learned a lot from you. it's extremely hard to find someone passionate and knowledgeable about low level stuff. Almost everyone and their mothers talks about Web Dev and front ends developments but only few talk about the nitty gritty stuff of OS and low level programming.
      Hope you delve more into assembly programming and reverse engineering.

  • @SteveAB4EL
    @SteveAB4EL Рік тому +6

    I wrote my first Motorola 6809 ASM program in 1984 on a SWTPC running the FLEX OS. I've been brain-dead ever since.

  • @MayMachina
    @MayMachina 3 місяці тому

    Honestly, I came here to learn a bit of assembly but I stayed for your unintended sass i love it

  • @baaz5642
    @baaz5642 Рік тому +6

    If you want to see how all this "assembly" works under the hood i suggest you watch the Ben eater 6502 series.

  • @supernenechi
    @supernenechi Рік тому +11

    With the sort of stuff people (including me) program in nowadays, programming in C and even knowing what a pointer is is already impressive by those standards.
    I tried to explain pointers to my JS dev friends, but it's a hopeless endeavor

    • @MH_VOID
      @MH_VOID Рік тому +2

      I had to use JS for my course, and coming from a primarily Rust background (basically Rust, Z Shell, and random tiny patches in other languages), I just could not understand how and when something gets mutated and propagated. Finally I saw somewhere that JS passes by copy of reference and finally I understood it a bit. JS is wack, and it makes people wack too!

    • @williamdrum9899
      @williamdrum9899 Рік тому +3

      It's really something I believe you can't understand until you've done it in ASM. C's piss poor pointer syntax is a huge source of this confusion if you ask me.

    • @MH_VOID
      @MH_VOID Рік тому +1

      @@williamdrum9899 how exactly is it poor in your opinion?

    • @akshaymanta55
      @akshaymanta55 7 місяців тому

      I really fail to understand why people find pointers hard to understand and there's so much hype around it being difficult? I found it to be pretty straight forward and intuitive. The fact that your JS devs friends couldn't wrap their heads around it is beyond me.

  • @ReptilianXHologram
    @ReptilianXHologram Рік тому +5

    We need a course on writing Secure/Safe C Programming for beginners!

  • @BenjaminVestergaard
    @BenjaminVestergaard 7 місяців тому +1

    One of the advantages of doing C or Pascal is that you're allowed to use assembly for certain functions... the compilers are already very optimised, but when you need something to work by clock cycle count, assembly is the way to go.. because documentation tells you how many clocks everything takes.
    When it comes to compiled code you can't count clocks the same way.

  • @bobpond6381
    @bobpond6381 Рік тому +5

    Awesome to see assembly content. A long time ago I would have Microsoft C output asm which I could then edit for optimizations based upon knowledge of the incoming data. 10% to 50% reductions in clock cycles made a huge difference.

    • @tibettenballs4962
      @tibettenballs4962 5 місяців тому

      try receiving free dome from the flight attendant you been tryna bang in the cockpit of the jaqqOff
      plane.

  • @xanrerkazuki9929
    @xanrerkazuki9929 10 місяців тому

    I understood a chunk of assembly for the first time! Please make a course for x86-64 assembly!

  • @paultreneary
    @paultreneary Рік тому +5

    Ah, that takes me back a decade or four. Definitely worth understanding, and cool as hell, but life is too short! Good 10 minute starter.

  • @electricn0va
    @electricn0va 11 місяців тому +2

    This is hands down the best introduction to assembly I've seen. Everything explained super clearly from the beginning and a lot of things just suddenly fell into place that didn't before with other tutorials or examples. Only recently started watching this channel but the more I do the more impressed I get

  • @breathofthewild1749
    @breathofthewild1749 Рік тому +6

    Making a genesis game in pure motorola 68000/z80 has been a blast for me. It's a hell of a lot of fun writing out a function then referencing op code cycle times to optimize written functions.
    I've never tried inline assembly before in c but that looks like it might be fun.

  • @prorityfeed3210
    @prorityfeed3210 Рік тому +1

    Assembly is cool. It's neat to see how things get done under the hood. .

  • @starklosch
    @starklosch Рік тому +13

    Could you make more videos about assembly? Some ideas:
    - What's the difference between MOV and LEA?
    - When and how to use segment registers?
    - How to do floating point arithmetic?
    - CPU extensions. Like AVX and SSE.

    • @infrakazos
      @infrakazos Рік тому +4

      "MOV" transfers the value from source to destination, "LEA" stores the memory address of source into destination

    • @TheBackyardChemist
      @TheBackyardChemist Рік тому +2

      "How to do floating point arithmetic?" Avoid the x87 FPU at all costs, just use SSE/AVX.

    • @tonysofla
      @tonysofla Рік тому +2

      LEA would be what in C is &table[0] or more correctly use is char* table. You want the address not the first variable in the table.
      A C compiler would allow you to put the text with the command and the compiler puts the text after the machine code snippet, so zero terminated string in C is rarely done manually.

  • @86Calikidd
    @86Calikidd 2 місяці тому

    Floating point math shook me and I havent looked back at Assembly since. Figured I would return once Ive strengthened my discrete mathematics muscle

  • @huntabadday2663
    @huntabadday2663 Рік тому +4

    Even though I know all this I still watch it because I love assembly too much (I think you already know?).

  • @thedudegotfourviews
    @thedudegotfourviews Місяць тому

    Very well explained. Finally understood assembly with this video.

  • @yusufhabib3507
    @yusufhabib3507 Рік тому +8

    I just watched your video about return statement and instantly subbed , keep making content like that brow I love low level learning

  • @MrLoLFaQ
    @MrLoLFaQ Рік тому +1

    And one dude programmed Roller Coaster Tycoon with this, I still can't believe it.

  • @johnmckown1267
    @johnmckown1267 Рік тому +4

    I learned IBM assembly language, for their S/370 "mainframe" computers back in the 1970s. I later learned assembler for the Zilog Z-80, which was an 8 bit computer which was based on the 8080. I love assembler. But it does take longer to code, at least for me.

    • @igorthelight
      @igorthelight Рік тому

      Today you could just write C, then ask compiler to generate Assembler out of your input ;-)
      Now you can play around with Assembler!

  • @aakashkhamaru9403
    @aakashkhamaru9403 Рік тому +1

    Understanding assembly also gives a lot of insight of how languages like c++ uses memory and inside stuff works.

  • @yonahcitron226
    @yonahcitron226 Рік тому +46

    Love it! Could you do a series on assembly where you go into more detail?

    • @wybren
      @wybren Рік тому +2

      Yes

    • @TomTom-ty5ej
      @TomTom-ty5ej Рік тому +1

      +1 please make more detailed tutorials about assembly ty

  • @roberthickman4092
    @roberthickman4092 Рік тому +1

    Good introduction, and good job busting the asm is hard myth.

  • @rotteegher39
    @rotteegher39 Рік тому +3

    Now you can pridefully put the assembly in you resume xD

  • @thebillpepper
    @thebillpepper Рік тому +1

    Yea, my friends just love when i start talking about assembly... great video, love to see i am not the only one interested in this stuff :)

  • @nimitzpro
    @nimitzpro Рік тому +4

    reminds me of mips programming i did in college a few years ago

  • @jockcooper8888
    @jockcooper8888 6 місяців тому +1

    Assembly usually provides macros so it does give some abstraction above machine language

  • @speezy2k656
    @speezy2k656 Рік тому +12

    Can you make a longer series about assembly?

  • @myheroskryptonite
    @myheroskryptonite Місяць тому

    Thank you! It was all looking like greek to me and my professor is not exactly great at lectures. This gives me a great starting off point.

  • @jayshartzer844
    @jayshartzer844 Рік тому +4

    Thanks for assembling this tutorial!

  • @orthodoxcaveman5819
    @orthodoxcaveman5819 Рік тому +1

    Haven't seen assembly in more than a decade back in college. Maybe I'll try it again for fun.

  • @herbertpocket8855
    @herbertpocket8855 Рік тому +12

    God told me to code a game in assembly. I am glad he didn’t tell me to build the next temple after Terry’s hard work. That’s a tough act to follow.

  • @wilhelmmeyer89
    @wilhelmmeyer89 Рік тому +1

    Nice. The last time I used an Intel assembly language was 1995. With a some good books I learned how to use it. I had 2 options: Borland's Turbo Assembler and Microsoft's C IDE, where asm could be embedded in C. I used them both and it was fun.
    Before that I learned to use the somewhat different assembly languages for SIEMENS and IBM Mainframes and later on I used the one for IBM.
    This is another time and another assembly language.

  • @thisguyisnotable
    @thisguyisnotable Рік тому +77

    Next Tutorial: "Learn Malbolge in 5 minutes (SUPER EASY!)" 💀

    • @amj864
      @amj864 Рік тому +26

      After that: " Lets build our own CPU from scratch(super easy if you are near sand)"

    • @thisguyisnotable
      @thisguyisnotable Рік тому +3

      @@amj864 😭

  • @itszaid12
    @itszaid12 Місяць тому

    So much love and thanks for this Explanation... From India...

  • @robertlawson4295
    @robertlawson4295 Рік тому +3

    Yes, you are correct in saying that people overcomplicate things, for sure. I usually point out that ALL other programming languages consist of abstractions and interpretations of abstractions which makes it challenging to wrap your head around. Hence the hopping from language to language trying to reduce the mental anguish. haha Of course you also have the abstractions related to the problem you are trying solve, so you end up with abstractions within abstractions, making it worse. That's fundamentally what's wrong with C++ ... it deepened the level of abstractions with multiple contextual input variables and so on, which is why I avoided it like the plague. Years ago, I was doing a lot of Assembly language programming, primarily because the microcontroller chips I was using simply did not have a 'C' compiler available (or it was at a horrendous price) plus they certainly didn't have much non-volatile memory so you could not afford ANY abstraction that increased the number of instructions being used. Every step had to be carefully weighed for how much code memory was being used and how much time it took to process those instructions. Number of machine cycles, in other words. When you think of it, every single software program in existence could be rewritten in Assembly language and I'd bet that every program would be vastly improved in both performance and energy consumption. It wouldn't be easy but it would be possible. And fun, frankly. 😁

  • @M3t4lik
    @M3t4lik Рік тому

    Quite a good vid and well presented as it gets straight to the meat and potatoes rather than inundate you with algorithms of how to arrange baby blocks in a straight line.

  • @ChrisM541
    @ChrisM541 Рік тому +10

    Excellent video, thanks for the upload. Please...more on this important subject!
    At 02:50 when you talked about compiling I was going to comment, but I'm pleased to see you use "assemble" throughout later on. A 'wee' difference between compilation and assemble.

  • @sloppydoggy9257
    @sloppydoggy9257 Рік тому

    I know assembly and this video didn't convince me that its cool to know... You made me cry.

  • @ross9263
    @ross9263 Рік тому +6

    Ok knowing how to program with assembly isnt the hard part. Its understanding the architecture that your coding on

    • @williamdrum9899
      @williamdrum9899 Рік тому +3

      And no amount of high-level languages can help with that, I'm afraid. I had tried to go from coding a Neo Geo game using 68000 ASM to using C, and I actually found it MORE difficult with C!

  • @williamdrum9899
    @williamdrum9899 Рік тому +1

    I like assembly because of the minimal overhead. Toolchains, makefiles... I don't have the patience for them. I've got a good setup for assembly development that just works. Does what I tell it to 100% of the time.

  • @sgmvideos5175
    @sgmvideos5175 Рік тому +2

    In python you search for libraries to do stuff for you
    In C you make the whole code by yourself looking only for the critical sections
    In Assembly you look for instructions, call lists and other stuff just so that you know what to write if you know what to do
    It's not hard, but deppends on what you want to do

  • @LCosta-B
    @LCosta-B Рік тому

    Thanks for reminding me of the Assembly programming language. Since I left college I've been into low level language such as the Assembly but I don't have the chance to work on it. And now I do and you made me remember with this simple tutorial

  • @cianmoriarty7345
    @cianmoriarty7345 Рік тому +7

    0:10 Bold of you to assume I can't read machine code...

    • @NSA.
      @NSA. 2 місяці тому

      That’s cause he is bold

  • @ross_codes
    @ross_codes Рік тому +2

    A minor correction: those are forward slashes, not back slashes :)

  • @chochochon5464
    @chochochon5464 Рік тому +12

    I would like a thorough and lengthy series about assembly :D your videos are awesome!!!

  • @mohammadahmedragab837
    @mohammadahmedragab837 28 днів тому

    your explanation is very amazing, simple and very helpful, please is there any course yoy recommend to learn assembly for reverse engineering?

  • @linuxdude5742
    @linuxdude5742 Рік тому +4

    Thanks for this nice course

  • @johngeverett
    @johngeverett Рік тому

    I loved assembler! I wrote assembler for the IBM 1401, the 6502 on my Apple, 8080 on CP/M on my Apple, and 8086 assembler on a Windows PC. Give me a macro-assembler, and I can do pretty much anything.

  • @alex.laslau
    @alex.laslau 5 місяців тому +6

    Writing normal programming languages : oh no, there is no output. Somethings wrong
    Writing assembly: there is no output. And no crash. What a success!

  • @Mystixor
    @Mystixor Рік тому +1

    Assembly is fascinating. For a few years I have been toying around with high-level languages and always felt like something about it was interesting, and now I know: it was whenever something went wrong on the lower levels

  • @icarvs_vivit
    @icarvs_vivit Рік тому +4

    Pretty sure the 'r' in the 64 bit register names is actually shorthand for the "rex" prefix, which I think means literally "register extension". Think: "rex eax".
    You need the "r" here because its presence promotes the 4 byte operation to 8 byte and allows twice the possible registers to reference via the lower 4 bits of the prefix used as 3 high bits for each register address included in the mod-r/m byte, which only has 3 bits per register thus why 32bit x86 only had 8 general registers and why even bytewise operations on the high 8 registers need a rex prefix (i.e. an extra byte) so there's less program size advantage to downgrading them.
    I think the 'e' in "eax" actually means "extended" too, from Intel's jump from 16 to 32 bits. "extended ax".
    x86 is currently a hodgepodge of extensions to its ISA and I actually love it for that.

  • @Dominik-K
    @Dominik-K 9 місяців тому

    This is pretty cool, and may come in handy. Im thinking of making a super small JIT which just emits the byte sequence of some easy instructions to assemble some dynamic, but still pretty performant code together

  • @orbyfied
    @orbyfied Рік тому +3

    I love how the thumbnail is C

  • @lolwingding
    @lolwingding Рік тому

    Woooooow man!!!!! I am just too happy !!!! Just imagine yourself crowd surfing! Please make more videos on assembly like this, maybe devices, maybe network, gpu, idk!

  • @nightfox6738
    @nightfox6738 Рік тому +6

    You should do a playthrough of Turing Complete on your channel. I think it would be really cool to see your thought processes as you solve each puzzle and build a computer from logic gates.

  • @mon-x9ff
    @mon-x9ff Рік тому +1

    OH MY GOD. HOW COOL IS THAT!
    Please, Do more assembly videos!!!
    Thanks!

  • @DoctorMGL
    @DoctorMGL Рік тому +22

    dude wrote 14 lines just to print ( hello world ) then says "assembly isn't hard" lol

    • @BeenYT
      @BeenYT 4 місяці тому

      @@DoctorMGL whats so hard about that?

    • @Kitsu_no_mirai
      @Kitsu_no_mirai 4 місяці тому +1

      ​@@BeenYTeverything

    • @darkzeroprojects4245
      @darkzeroprojects4245 2 місяці тому

      ​@@BeenYT
      Just cuz it uses more lines, don't mean automatically its hard.
      Least from what I can tell.

    • @neilpatrickhairless
      @neilpatrickhairless 2 місяці тому

      In the meantime we get 1649926204710474 lines of boilerplate Python code to fucking move a dot across a screen and another 10 days to go through the errors it threw when trying to move the dot

    • @darkzeroprojects4245
      @darkzeroprojects4245 2 місяці тому

      @@neilpatrickhairless I'm mainly trying to memorize basic programming with python mainly so I can start understanding and learn c/c++ later.
      Unless I want to make python script addons for blender, it's just for me to learn and memorize the basics enough.

  • @dynad00d15
    @dynad00d15 Рік тому +1

    Back in the day, i was learning Turbo Pascal and in order to do realtime animation, i learned to write a refresh screen routine in Assembly because TP's refresh was too slow. It was the only time in my life that i had to use Assembly (that was in the 90's, kids.. lol)

  • @draconicepic4124
    @draconicepic4124 Рік тому +4

    I think it's important to point out the Assembly isn't really a language, but rather a term for the human-readable format of a byte codes the processor understands. As a result, there isn't really a standard assembly language and changes heavily based on the target processor: assembly for Intel/AMD different from ARM or RISK. Even sticking to Intel/AMD, you have the difference between AT&T and Intel syntax, how data is declared, how macros are defined, and so on.

  • @davidaraujo2049
    @davidaraujo2049 Рік тому +1

    I think that the most difficult thing about assembly is that is more of a "set" of languages then "a" language, and thar confuses some people. What I mean is, you can learn many different languages that classify as Assembly and will depend on the target CPU architecture, when I learn it, I learned MIPS. This one he is teaching, never heard of it.

  • @nic37ry
    @nic37ry Рік тому +10

    As others here says, assembly by itself isn't hard, the hard part is to memorize all assembly instructions, opcodes, link with dependencies and stuff like that.
    And another thing I hate is that it won't work on any processor but the one you chose, because x86_64 instructions won't work on aarch64 processors (I know most common instructions are the same in every instructions set, but a lot of things are completely different or doesn't even exist for that processor)

    • @SalivatingSteve
      @SalivatingSteve Рік тому

      I’m learning MIPS assembly and it doesn’t have a “mov” instruction. We use lw (load word) or sw (store word) or just a null add to move things around.

    • @nic37ry
      @nic37ry Рік тому +2

      @@SalivatingSteve yes, but you can use "or" instructions to move data between registers, eg: move R1 to R2 you can do "or r2, r1, r1"

    • @theodorealenas3171
      @theodorealenas3171 Рік тому

      @@SalivatingSteve I recall we used add immediate with a value of zero.

    • @Stabby666
      @Stabby666 Рік тому +1

      It's not just knowing all the instructions - and the x86 has a LOT of instructions, so you'd never remember all of them. It's knowing best practices, how to optimise using the extended instructions, and not ending up with a spaghetti-code mess with anything non-trivial. Modern C/C++ compilers know all of the assembly optimisations (although a GOOD ASM programmer can do better with knowledge of the algorithms) and so will generally do a bettter job than you can do, even with years of experience. I used to write a lot of x86 ASM back when I was working on graphic engines, sound engines in the demoscene, but the processors then were a lot simpler than the ones today.

    • @nic37ry
      @nic37ry Рік тому

      @@Stabby666 but that's not really my point, there's a difference between be able to program and be able to program well. I don't mean that you have to remember all instructions but at least the most common/necessary ones, even if a person knows the best practices, if I put them to program in other instructions set, they won't be easily able to program if they don't know those instructions and how its registers works or what are them for. Even if it is spaghetti code it still works because the person who made it knows how to use the instructions (although not in the best way) which for me is one of the hard things of assembly (but not limited to), once a person get out of that obstacle, now they can learn the best practices for programming

  • @tomekgnu
    @tomekgnu Рік тому +1

    I've been learning assembly for some time now. I would never say it is easy to program in it.

  • @GeeYouEye
    @GeeYouEye Рік тому +5

    An explanation of why you should use `lea rsi [hello_world]` instead of `mov rsi, hello_world` (which would also work in this case) would be a welcome followup video (it's definitely a topic that could take it's own video).
    I think you missed the best part of x84-64 though, particularly compared to 32-bit: that there are only 2 ABIs (compared to 9+ in 32-bit), and they're both super readable, especially System V. Would have made for a much longer video though.

  • @ikemkrueger
    @ikemkrueger 11 місяців тому

    I really liked the introduction into assembler. It doesn't look that scary anymore.

  • @chyldstudios
    @chyldstudios Рік тому +4

    Avengers .... ASSEMBLE!!!

  • @petrus4
    @petrus4 9 місяців тому +1

    The actual code behind "syscall" is (AFAIK) int 80h, which is an interrupt call for the Linux kernel.

    • @SirusStarTV
      @SirusStarTV 4 місяці тому

      But isn't it fast system call instruction? You're saying it's a macro that expands to "int 80h" ?

    • @petrus4
      @petrus4 4 місяці тому

      @@SirusStarTV I don't know if it's a macro. I admit that I am used to thinking in terms of FORTH words, which have both numerical and lexical references. You can call the word by name, or you can put the word's number on the return stack; either one will work.

  • @illegalsmirf
    @illegalsmirf Рік тому +1866

    You've got no chance of becoming a gigachad - sorry

    • @LowLevelTV
      @LowLevelTV  Рік тому +857

      shit.

    • @jayshartzer844
      @jayshartzer844 Рік тому +228

      @@LowLevelTV there's a gigachad in all of us. Don't give up

    • @kennethbeal
      @kennethbeal Рік тому +52

      @@jayshartzer844 1.21 gigachads (jigga-chads :) ) LLL: thank you!

    • @thisguyisnotable
      @thisguyisnotable Рік тому +25

      @@kennethbeal "jigga" chads...? 😳

    • @joelkronqvist6089
      @joelkronqvist6089 Рік тому +38

      A gigachad can't become a gigachad, because they already are, right? xD

  • @ravindrabhuva5029
    @ravindrabhuva5029 10 місяців тому

    Hi I am recent graduate in Cybersecurity and I find binary exploitation tough in CTFs. Could you suggest what playlist or videos I should watch from your channel. I love the way you teach complex topic in simple words.

  • @wx39
    @wx39 Рік тому +17

    Wow.
    I read some Reddit post or other about how a Hello World program written in ASM was something like 30 lines.
    While I still don't necessarily think ASM is "easy", I do now see that it's simple.
    I'll be taking a class about Computer Architecture here pretty soon, where it sounds like I'll be both writing and reading ASM.
    Do you have any recommendations for resources that really made the concepts make sense for you?

    • @GeorgeTsiros
      @GeorgeTsiros Рік тому +1

      Oh you will have a lot of fun in that class.

    • @SalivatingSteve
      @SalivatingSteve Рік тому +3

      I’m taking a hardware architecture class right now and we’re using MIPS assembly, which is simpler than Intel assembly. I think most intro architecture classes these days teach MIPS, which is more comparable to ARM than x86-64.

    • @JtagSheep
      @JtagSheep Рік тому +1

      Look up the Ben Eater 8 bit breadboard computer playlist, it really helped me understand a lot of what was going on!

    • @aidenrockyawan6804
      @aidenrockyawan6804 Рік тому +1

      @@SalivatingSteve in my class they teach SAP instead

    • @jeffspaulding9834
      @jeffspaulding9834 Рік тому +2

      When I took Computer Organization, it used an imaginary architecture and started from a simple one to a progressively more complex one. We used a simulator for it and wrote assembly.
      That and Operating Systems ware the hardest classes for my bachelor's degree in CS. Personally, I enjoyed those classes and got a lot out of them; but I was also twenty years older than most of my classmates. My classmates generally hated those classes and we ended the semester with maybe half the people we started with. Be sure you keep up with the class and study at least two or three times a week, or you'll fall behind and never catch back up.

  • @unknownguy5559
    @unknownguy5559 Рік тому

    This is such a simple tutorial that doesn't overcomplicate the use of instructions. Thank you.

  • @mortenhattesen
    @mortenhattesen Рік тому +9

    It would be really interesting to see the same code, but in ARM Assembler rather than Intel x86, for comparison.

  • @martinschmelzle4864
    @martinschmelzle4864 11 місяців тому +1

    It would be even more Gigachad if he had exited vim afterwards

  • @therealb888
    @therealb888 Рік тому +5

    You missed the most crucial part, assembly is specific to the given hardware.
    Even intel 8086 is different from modern x64. The hard part is learning every architecture.

    • @theodorealenas3171
      @theodorealenas3171 Рік тому +1

      Could you hint me a difference? I've seen a Minecraft processor with something like a always-1 register (I've only seen a always -0 register in MIPS assembly). Is this the sort of differences?

    • @rancidbeef582
      @rancidbeef582 Рік тому +3

      @@theodorealenas3171 Well x86 back in the 16-bit DOS days was terrible because you always had to deal with the 16-bit segments pointed to by the segment registers. The segment registers still exist, but I'm not sure how they are used in 64-bit assembly... I lost interest in x86 assembly long before that.

    • @williamdrum9899
      @williamdrum9899 Рік тому

      ​@@theodorealenas3171 Yes, that's a very common one. There's a lot of architectures that have an always-zero. x86 is not one of them.

    • @williamdrum9899
      @williamdrum9899 Рік тому

      ​@@rancidbeef582 I never found it that much of a headache. The biggest annoyance was that you couldn't just do "mov ds, @data", you had to load another register first.

    • @vitalyl1327
      @vitalyl1327 Рік тому

      @@williamdrum9899 because it's a CISC with a large immediate space. You cannot have both - you either have a lot of addressable registers, as typical for RISCs, or you have easily accessible immediates for most of the ops, and then much less addressable registers.