How Machine Language Works

  Рет қаралды 936,387

The 8-Bit Guy

The 8-Bit Guy

3 жыл бұрын

Support The 8-Bit Guy on Patreon:
/ 8bitguy1
Visit my website:
www.the8bitguy.com/

Пікірлер: 3 600
@Sladen70
@Sladen70 3 жыл бұрын
Learning machine language with the 8-bit guy over a couple hours sounds like fun to me.
@jwjones1979
@jwjones1979 3 жыл бұрын
I thought the same thing. He should do another subset of videos on just that. I'd watch it.
@markstrickland438
@markstrickland438 3 жыл бұрын
One of the frequent contributors over at David's Commander X16 forum/FB page has been publishing machine language tutorials for the big brother of the 6502, the 65c816. His name is Matt Heffernan. I think he had published 8 parts of the tutorial series. He has also made some nice games for the X16.
@sjjjvideo1
@sjjjvideo1 3 жыл бұрын
I'd pay real money to take that class.
@WarrenGarabrandt
@WarrenGarabrandt 3 жыл бұрын
@@sjjjvideo1 Oh, for sure! I'd pitch in $20 at least to have access to watch that video.
@mfaizsyahmi
@mfaizsyahmi 3 жыл бұрын
Check out Ben Eater's channel. He's been doing a video series on programming a breadboard computer in assembly. He also did the thing David said about devices being memory addresses to the CPU. Best of all, he sells the same kit as he featured in his videos, so you can follow along and create your own breadboard computer!
@grandmaster1004
@grandmaster1004 3 жыл бұрын
I feel like I walked into the wrong class in college and was too confused and embarrassed to leave.
@Blitterbug
@Blitterbug 3 жыл бұрын
Why? David did a fairly good job of covering simple basics here.
@technopoptart
@technopoptart 3 жыл бұрын
@@Blitterbug it isnt everyone's strong suit even with an explination
@Mr.Pop0
@Mr.Pop0 3 жыл бұрын
You shoulda seen the faces of complete devastation people had when our online instructor told the class the day of the exam that they couldn't use the codex to read program outputs. Which means they had to actually memorize the hex values
@GORF_EMPIRE
@GORF_EMPIRE 3 жыл бұрын
@@Blitterbug It's not something easily grasped from a 20 minute video for some. Back 40 years ago, I had a bit of trouble. That is because most people who explained it when redonkulous with technical jargon. One day it all was made clear by a gentleman in Sears..... in a matter of 10 minutes he removed the road block with a very layman like explanation. I went home and started coding my ass off in 6502 assembler on my Vic-20. The dam was broken.
@the_kombinator
@the_kombinator 3 жыл бұрын
I'm learning this at the graduate level - I'm not the greatest coder, but using Python makes it rather simple. *Edit nevermind - Machine language != Machine learning. Guess I'd better go back to studying...
@jaymartinmobile
@jaymartinmobile 3 жыл бұрын
Back in '81-'83 I used to teach a few "introductory to computer programming" courses as part of my job repairing the computers of the time (mostly C64 and VIC-20). I was teaching the basics of BASIC to a class when one student asked me to explain ML. I gave a few examples very similar to yours to try to show the similarities and differences. The next question was "why write in ML when BASIC was so readable?" I then wrote a program to poke a character to all screen locations and then poke the next character etc. in both ML and BASIC. Showing the speed difference and explaining why made for a very good class, with most students signing up for the next level course. Thanks for the memories.
@whocares4598
@whocares4598 2 жыл бұрын
Darn dude your job must have been cool. My teacher is similar too you as he started teaching in the 80s.
@gruberstein
@gruberstein 2 жыл бұрын
That's about the same time I was learning how computers work with a Digiac Board, Comtran 10 and SDK85 at Lincoln Tech. It got me a job at Bell Labs where I never used any of that knowledge again. The Comtran was amazing, it was basically a CPU built of logic chips on a huge board with a set of schematics and timing charts that explained the operations of each instruction available. Instructor would open a connection with a switch in back and you'd have to trace the problem back to the logic gate that lost connection. Instructions could be put in one at a time or with a punch tape reader. You could manual clock the thing one cycle at a time or run a program .There were lights to show the contents of the registers.
@jackiemowery5243
@jackiemowery5243 Жыл бұрын
@@gruberstein I used the SDK85 at Eastern Washington University back in 81. Had a blast! Found myself thinking in 8085 assembler and having to reboot my brain whenever someone would ask me a question in English. Took a few seconds to change language and operating system.
@SATISFYPLANET
@SATISFYPLANET Жыл бұрын
God is coming soon to judge the world!! ✝️
@pilotkid2011
@pilotkid2011 3 жыл бұрын
As someone who has taken 3 assembly language classes in college, I must say this was an EXCELLENT overview.
@chitlitlah
@chitlitlah 3 жыл бұрын
Yes. I learned the basics of IA32 assembly in high school. Then I took a microprocessors class in college that had us coding various processors like the 6502, Z80, and Motorola 68000 in hex. Recently I got into IA64 assembly a bit.
@mrInSaNiTyDuDe
@mrInSaNiTyDuDe 2 жыл бұрын
I took a year of learning C++ and VB and i have to agree that this is the best. I wish he was my coding instructor.
@informitas0117
@informitas0117 2 жыл бұрын
Assembly can die in a fire.
@robb1324
@robb1324 2 жыл бұрын
I did as well... And now I find myself sometimes struggling in 4hr technical interviews because I forgot that one Python library that I'm "supposed" to know (there's always one that I forget). Turns out saying "I know assembly, I'm sure I can figure that one Python library out when needed..." Doesn't fly with employers. ☹️
@SATISFYPLANET
@SATISFYPLANET Жыл бұрын
God is coming soon to judge the world! ✝️
@tompov227
@tompov227 3 жыл бұрын
i feel like this is just a 20 minute PSA of david saying “STOP ASKING ME TO PORT Petscii robots” understandable honestly
@ZX3000GT1
@ZX3000GT1 3 жыл бұрын
If he want to give the source code to Petscii Robots, someone else can port it. Of course, that's IF he actually want to.
@joechristo2
@joechristo2 3 жыл бұрын
@@asificam1 But if they want to port it to computers with a different cpu, they have to rewrite the entire game
@glenndoiron9317
@glenndoiron9317 3 жыл бұрын
@@ZX3000GT1 IN THE VIDEO he shows the status of someone else's port of PETSCII ROBOTS to the Apple II.
@ZX3000GT1
@ZX3000GT1 3 жыл бұрын
@@glenndoiron9317 Well, I stand corrected. I honestly haven't watched the video properly, so pardon the mistake.
@KeMeEscupaUnPollo
@KeMeEscupaUnPollo 3 жыл бұрын
Maybe, but David is like direct enough to just say it plain and simple.
@binixx
@binixx 3 жыл бұрын
1:15 "I'm not gonna teach you how to code in machine language because that will probably take like 10 hours" Where do i sign?
@PJBonoVox
@PJBonoVox 3 жыл бұрын
He's not doing that because that's not the style of the channel. There are hundreds of resources to learn 6502 assembly and C64 programming. Make the effort to learn if you really care.
@stevejquest
@stevejquest 3 жыл бұрын
10 hours is a joke, it actually takes much longer than that.
@SteveJones172pilot
@SteveJones172pilot 3 жыл бұрын
@@PJBonoVox But.. He's got a great teaching style, and having him post his own version would be a great benefit.. I'd especially be interested in some of his graphics routines and techniques
@binixx
@binixx 3 жыл бұрын
@@PJBonoVox I was trying to make a joke. Imagine if you could learn to code, or draw, or animate, or something else only in 10 hours? Also i would like if the 8 bit guy would teach us how to code in Basic and Assembly the Commander x16.
@puckyMaXxx
@puckyMaXxx 3 жыл бұрын
wait after BYTE assemble of 1111 1111
@austinpatkos7563
@austinpatkos7563 3 жыл бұрын
Dude it's insane how much he actually knows and how talented he really is.
@rcs2003
@rcs2003 2 жыл бұрын
like almost any programmers from the 80's.
@chrisfusion6945
@chrisfusion6945 2 жыл бұрын
*skilled
@SteveMorrow8859
@SteveMorrow8859 2 жыл бұрын
Machine language (assembly) just takes a focus over a long period of time like anything that a person desires to learn, and you will get better. The 8 bit guy has inspired me in all kinda of ways, including electronics, and various projects. I follow assembly language game design on my channel for those interested.
@youngwaveaudio9390
@youngwaveaudio9390 2 жыл бұрын
The man hides his powerlevel as to not frighten us mere mortals using languages like C#.
@lilmsgs
@lilmsgs Жыл бұрын
All of this was standard course work in a computer science 2-year degree.
@janhruby9379
@janhruby9379 3 жыл бұрын
FYI: C# is same as Java they are compiled to bytecode and then JITed to machine code.
@rogervanbommel1086
@rogervanbommel1086 2 жыл бұрын
Also, python(maybe also other interpreted languages too) can be transformed into executables/binarys that both increase speed and remove the need for a interpreter using pyinstaller
@Kitulous
@Kitulous 2 жыл бұрын
@Fabian Fernlund python (at least cpython) can actually be compiled to bytecode and be run in a vm
@yeppiidev
@yeppiidev 2 жыл бұрын
@@Kitulous well isn't what it does normally? it's still kinda the same thing, interpreting code but it's a bit faster. doesn't really matter because you will barely notice any issue unless you're making a cpu/GPU intensive application
@Kitulous
@Kitulous 2 жыл бұрын
@@yeppiidev well i divide code execution into three categories: 1. slowest: interpreting code at runtime (lex -> parse -> ast -> invoke ast nodes at runtime) 2. somewhere in between: compiling to bytecode (lex -> parse -> ast -> bytecode) and then interpreting bytecode 3. fastest: compiling to native instructions (x86, arm, etc) 2 can be sometimes faster than poorly written 3 because of JIT optimizations (if there are any or course)
@yeppiidev
@yeppiidev 2 жыл бұрын
@@Kitulous oh yeah I forgot the individual components of an interpreter exists but yeah the closer it is to machine code the faster it runs but modern computers are too fast for the difference to be noticeable (atleast in normal apps)
@rickwest2818
@rickwest2818 3 жыл бұрын
Assembly really does give a person a good grasp of how a computer processor works. Even if it's outdated, it's still worth learning.
@joechristo2
@joechristo2 3 жыл бұрын
Yup, it’s not as hard as people think
@abizair1832
@abizair1832 3 жыл бұрын
And maybe you can make a computer yourself, *from scratch* like SAP-1 or Scott CPU, and program it.
@CZghost
@CZghost 3 жыл бұрын
@@abizair1832 Ben Eater stuff?
@alliejr
@alliejr 3 жыл бұрын
As David correctly points out, its not the assembly language one needs to learn, rather it’s the specific interfaces to all of the hardware controllers and I/O.
@rickwest2818
@rickwest2818 3 жыл бұрын
@@alliejr it's more than that though. Program counter, accumulator, etc.
@stmchale
@stmchale 3 жыл бұрын
I liked the scene you pointed out from "The Terminator" movie. I saw this in the theaters in 84' in Dallas and I was with my brother who just graduated from college as a Electrical Engineer and during that scene he whispered to me "that is assembly language", I whispered back. "Your telling me there going to use assembly language 50 years from now"? Well, here we are now.
@hackmattr
@hackmattr 3 жыл бұрын
I got my CSE degree a few years ago. One project for a game development class was to make a simple game using assembly for the Atari 2600. I had another class where we had to use assembly for the 8080. I'm glad we use higher level languages for everything.
@Okurka.
@Okurka. 3 жыл бұрын
I can't believe 1984 was 50 years ago. Time does fly.
@pocoloco8075
@pocoloco8075 3 жыл бұрын
@@Okurka. Get Your math right, bro. 1984 was even 69D years ago!
@Defianthuman
@Defianthuman 3 жыл бұрын
@@Okurka. its not event 2024 so its 37 years ago
@PWingert1966
@PWingert1966 3 жыл бұрын
We watched that in our Robotics Class at University. We even had a question on the final exam about it!
@neodimium
@neodimium Жыл бұрын
In my college we used to program ATMEL MCU in assembler. That was in 2000 and I remember it as great time. Working directly with addresses and limited operations pushed us to be more creative than ever. I would gladly start that class again!
@lemagreengreen
@lemagreengreen 3 жыл бұрын
The whole explanation of the CPU simply viewing other chips as memory is great and really demystifies a lot of this stuff.
@BixbyConsequence
@BixbyConsequence 3 жыл бұрын
Wrote a puzzle-solving program for TRS-80. Initial run in BASIC was 48 hours. Took it down to about 12 hours with heavy optimizing. I broke down and rewrote in Z-80 assembler and got solutions in 4 minutes.
@legion162
@legion162 3 жыл бұрын
Ohhhh my little sister had a TRS 80, only thing I remember about it was it took cartridge games that loaded pretty instantly, whereas my ORIC 1 loaded games on tape and took ages to load if ever lol
@BertGrink
@BertGrink 3 жыл бұрын
That pretty much sums up the difference between BASIC and Machine Code.
@TheGuyThatEveryoneIgnores
@TheGuyThatEveryoneIgnores 3 жыл бұрын
I used to write programs in BASIC on an Apple II+ and manually convert them to machine language. It was typical for them to run 200 to 300 times as fast. I found most of the speed improvement was from working with binary numbers directly rather than numbers stored as character strings in BASIC. Also, I calculated Pi out to over 20,000 decimal places, though the math was done in binary. It still took five days to run even with everything written in machine language! There is no doubt it would have taken years to run if I had wrote it in BASIC.
@blahorgaslisk7763
@blahorgaslisk7763 3 жыл бұрын
@@TheGuyThatEveryoneIgnores Interesting that the numbers conversion from a string to binary numbers was such a huge bottleneck. I say that as I remember programming the ABC 80 in basic back in the very early 80's. It was a Z80 based computer and the version of BASIC that it ran had a lot of strange quirks, one of which was that you could enter the numbers explicitly as string values just by putting them inside quotation marks. So as far as to the output the two following lines were equal: Let A=10 : For X = 1 to 500 : Print A+X-6 : Next X Let A="10" : For X = "1" to "500" : Print A+X-"6" : Next X There were however differences in how they are stored in memory and how fast they are interpreted. If I remember correctly the editor stored any number that didn't have a qualifier as a 9 byte floating point value. But by entering the numbers as strings they were also stored as strings. so in the statement Let A=10 the number will take up 9 bytes of memory while if it was written as a string it would only take up four bytes. To make things even more fun the interpreter handled the numbers that were entered as strings in fewer clock cycles. The variables were the same, so for optimal performance you would have used string variables for everything except possibly integer value variables as those were only 16 bits. But if I remember correctly integer variables were still slower when used in calculations than string variables. Always thought this was really weird, but back then there was a lot of that going around in the computer industry. Another fun thing was that if you were doing calculations that required high precision then you would convert all numbers to strings and use only string variables in all calculations. Not only was it faster but the results were more exact. While I can see why it could be more exact I still can't figure out how the heck it could be faster. But I remember verifying this myself. Those machines were very limited, but at the same time just so simple to work with. You had no libraries of functions to load and the hardware was no more advanced than that you could easily read the circuit diagram and figure out how it worked. You could actually buy the ABC 80 as a kit with a bare PCB and bags of components and solder everything together yourself if you wanted. The simple architecture also made it so easy to write programs in machine language or assembler for these 8 bit processors. After all you had at the most 64KB of memory to worry about...
@TheGuyThatEveryoneIgnores
@TheGuyThatEveryoneIgnores 3 жыл бұрын
@@blahorgaslisk7763 Before I ever had heard the word "compiler", I had written a very simple one for the Apple II which could compile BASIC programs that only used the hi-res statements. All of the coordinates for plotting dots and drawing lines had to be hard-coded. My compiler simply converted these coordinates, which were stored as character strings in BASIC, to binary, loaded them into registers and called the same routines in ROM that BASIC called for plotting dots and drawing lines. I tested my compiler on a BASIC program that drew a picture in about 20 seconds. The compiled program drew the same picture instantaneously.
@shrekinabox1730
@shrekinabox1730 3 жыл бұрын
His new setup looks like he's in heaven
@millsyinnz
@millsyinnz 3 жыл бұрын
It doesn't look as cosy as the last one, but I'm guessing that it is still unfinished, so benefit of the doubt applies here.
@kjrehberg
@kjrehberg 3 жыл бұрын
Needs some sound dampening panels for sure.
@jakobv8
@jakobv8 3 жыл бұрын
Matrix loading screen:-)
@CasperHulshof
@CasperHulshof 3 жыл бұрын
Including a halo!
@WillOnSomething
@WillOnSomething 3 жыл бұрын
It looks like an episode of The Good Place, haha
@eduardolarrymarinsilva76
@eduardolarrymarinsilva76 3 жыл бұрын
16:18 "Wait it's all RAM?" *CPU about to execute a kill opcode* Always has been...
@jazzius
@jazzius 2 жыл бұрын
Underrated comment
@gavinthecrafter
@gavinthecrafter 2 жыл бұрын
Beat me to it
@user-wj9xq7ig2v
@user-wj9xq7ig2v 3 жыл бұрын
The limited power of these machines forced programmers to be elegant and efficient in ways that are no longer seen. Amazing skills.
@BruceCarbonLakeriver
@BruceCarbonLakeriver 3 жыл бұрын
you can see it by watching code demo conventions :)
@JivanPal
@JivanPal 3 жыл бұрын
Wirth's law: en.wikipedia.org/wiki/Wirth%27s_law
@BruceCarbonLakeriver
@BruceCarbonLakeriver 3 жыл бұрын
@@JivanPal fully agree crap code is all over the place... it is a shame. Just check out a demo convention and see what those guys are capable of with sometimes insane limitations like a full blown 3D render with AA and textures within a 64kB file - not mention the commodore64 hacks or the gameboy colour demo xD - lean code really makes things better.
@onearthonelegion
@onearthonelegion 3 жыл бұрын
I think more is better. Why do 64kB when you can do 64GB.
@calebfuller4713
@calebfuller4713 3 жыл бұрын
True. If you go to "Code Golf" on Stack Exchange some programmers still enjoy the challenge of trying to make the smallest possible code, competing on the minimum number of bytes (yes bytes) they can use to fulfil a given task.
@retep8891
@retep8891 3 жыл бұрын
Ben Eater recently (past year) did a series on assembling and programming a 6502 computer to say hello world. Worth checking out if you like this sort of thing.
@robertmudry4242
@robertmudry4242 3 жыл бұрын
Seriously, anyone with any interest in the topic should watch Ben’s videos. His approach to teaching is remarkable, his videos are top notch, and you’ll learn more than you thought you wanted to know about the topic! Plenty of “Ah ha!” moments, even if you already have some knowledge of the topic.
@DaVince21
@DaVince21 3 жыл бұрын
And another Ben, Ben Heck, has been programming an absolutely tiny chip to run as a video game console. Very technical, but very interesting.
@halonothing1
@halonothing1 3 жыл бұрын
Ben's videos have been ABSOLUTELY ESSENTIAL in me realizing my dream of one day building a computer from scratch. I mean building one completely out of chips and other components. I love playing with this program called Logisim, which lets you build digital circuits of pretty much any size and complexity you can come up with from things like logic gates, RAM, counters, flip flops and other components. The first time I played with it, I told myself one day I would make a computer with it. Although I've since learned how to build physical electronics and now have the means to build such circuits in real life. So my goal now is to make an actual breadboard computer, like Ben did. Though there are some things I would like to change. Anyways, if anyone wants Logisim, it's a free program. The page for it can be found here: www.cburch.com/logisim/ And in case you have trouble finding the download link, here's a link to the download page on sourceforge: sourceforge.net/projects/circuit/ Whether you just want to play around with digital circuits, or do some serious learning, or build a model of a full, working computer. I cannot recommend this program highly enough. It's been essential in my journey from being curious about computers but not even know what a transistor is or does to designing computer and CPU components and then building them in real life. And while I'm at it, the other program that's been just as important is a circuit simulator called circuitmod, which is also free and runs in your browser, and it can be found here: lushprojects.com/circuitjs/circuitjs.html This amazing program will allow you to build both analog and digital circuits. It simulates just about every electrical/electronic component you can imagine, resistors, capacitors, bipolar transistors, mosfets, jfets diodes, zener diodes, tunnel diodes, logic gates, 555 timers, various logic chips, and soooo much more. Plus it allows for a simulation of oscilloscope output that even includes a fast fourier transform of the output. Or it lets you export the wave form into a sound file, or raw data if it's a digital circuit. This program is superb for not not only building circuits, but for understanding how they work on an intuitive level by letting you see where current is going and what voltage everything's at at a single glance. It also has a ton of example circuits, which you could spend hours on end playing with and learning about. This program along with Logisim probably single handedly helped me transition from just screwing around on the computer, to building actual real life electronic circuits. Again, I cannot overstress how useful and fun both of these incredible programs are whether you just wanna have some fun, or do some serious learning. Or both!
@lightningmcqueen1577
@lightningmcqueen1577 2 жыл бұрын
@@halonothing1 wow that's a great way of introduction to digital circuits and designs, if you want to go further I had recomend learning VLSI design using verilog which is the standard in the industry today, 100 years of technological advancements
@halonothing1
@halonothing1 2 жыл бұрын
@@lightningmcqueen1577Thanks! I'm really glad I appreciated my comment. I put out so many comments like this and this is the only time somebody actually replied. So, at least ONE person's taken the time to bother reading it. And I appreciate that a lot. My post was more geared towards hobbyists, especially those starting out. So I wouldn't recommend FPGAs for beginners. Hell, I had enough trouble figuring out the serial drivers for my knock off Arduino back in the day. But if you're already familiar with electronics and embedded design. Then absolutely HDLs are a must. And even as a hobbyist, I'd lie if I said I hadn't looked at buying an entry level dev-board. But I have enough to keep me busy as it is.
@MikeBramm
@MikeBramm 3 жыл бұрын
Without a memory map of the hardware, you end up having to reverse engineer the board to determine out what addresses control which hardware (through address decoders to chip select or enable inputs). If you're lucky, you can get a schematic, otherwise you'll spend A LOT of time following traces, making your own schematic and downloading data sheets.
@SeanBZA
@SeanBZA 3 жыл бұрын
Add to that that a lot of those on chip registers can be write only, read only or they can have different characteristics on write compared to read, or just the act of reading them causes the action, and write does another thing. Very common in the CRTC world, where you have a multitude of registers to control stuff, and also on modern chipsets, where you have a massive set of registers that need to be set up with "write these registers, in this order, with these bytes, to get the chipset to operate" with no other information on what that does. Get that wrong and you run into all sorts of issues, up to and including chips failing.
@sinephase
@sinephase 3 жыл бұрын
nuts
@TheGuyThatEveryoneIgnores
@TheGuyThatEveryoneIgnores 3 жыл бұрын
Fortunately, the Apple II+ computers came with a good user guide that detailed the memory mapped hardware. You could also reverse engineer existing software to figure out how things work. I taught myself 6502 machine language when I was 13 and a lot of what I did was looking at existing software to see how it worked. This is known as white hat hacking.
@absalomdraconis
@absalomdraconis 3 жыл бұрын
@@SeanBZA : The IBM PC world provided a pretty easy example of differing read/write behavior- read from the hardware and you get the current status of buttons & timers, whereas writing resets those timers, leading to potentially very confusing results.
@markstrickland438
@markstrickland438 3 жыл бұрын
Even with the stock BASIC on the C64, and to a lesser extent the Atari 8 bit machines, you were forced to learn hardware registers.
@ossietee7562
@ossietee7562 3 жыл бұрын
This is the best technical video/ lecture I’ve attended in ages. Seriously! I am a retired CHEM prof, aged 79+ who was working on Data acquisition, in my research, on Sabbatical in California. I bought my first Apple ll in 1979 with my own money, $1500, and taught myself to use it. A bit later, I wrote in 6502 machine language to convert data in BCD to Hex to do graphics on the Apple ll prior to doing Data analysis.
@herrbonk3635
@herrbonk3635 3 жыл бұрын
15:10 Intel and Zilog assembly used a suffixed "h" (F143h). So the notation 0xF143 wasn't common at all in 8088 assembly. It comes from C and has creeped into the x86 world via the C-based Unix/Linux in later years.
@DaedalusYoung
@DaedalusYoung 3 жыл бұрын
In MSX-BASIC, it was the prefix &H, for example in POKE &HF346,1. MSX of course used Zilog's Z80 processor.
@herrbonk3635
@herrbonk3635 3 жыл бұрын
@@DaedalusYoung Sure, there are a lot of different notations used for hex, binary and octal numbers. But this is not dependent on the processor, as you know. A Z80 processor does not mean that Zilog (or Intel) wrote the assembler or BASIC for it. Also, a similar assembly syntax (say AT&T) may be used for many quite different processors, such as 80386 and 68000, for instance. But the first assembler for the IBM PC was actually written by Intel, and firms like Microsoft, Borland and others followed suit in many syntactical details.
@microbuilder
@microbuilder 3 жыл бұрын
4:07 Purple ball on the right going down to the bottom left corner makes a perfect corner hit lol
3 жыл бұрын
I made the transition from Basic to Assembly around the age of 9 or 10. My young brain had a hard time wrapping around the fact that instructions were just numbers in memory, surely it had to be somerhing more special. Then one lunch break at school, my friends and I realized that if instructions were numbers in memory we could write code that modifies itself! It was almost like stepping into our own scifi-movie
@SreenikethanI
@SreenikethanI 3 жыл бұрын
Wow that feels like a sweet experience
@jmhg92
@jmhg92 3 жыл бұрын
Back in college I've made this small Mega Man 3 animation in assembly and took quite a while to make it, with hundreds of lines written to paint and create a tone. Still, it was a fun project that got me an A in my class.
@emmanuelpoirier4602
@emmanuelpoirier4602 Жыл бұрын
Can you post the code ?
@lazyhominid
@lazyhominid 3 жыл бұрын
C# also runs through an interpreter; it does not compile to machine language, but just like Java, it compiles to a byte code which is run on a runtime. The Java runtime is called JRE, and the C# runtime is called CLR. Java and C# are designed in exactly the same way when it comes to machine code.
@mikesimms1
@mikesimms1 3 жыл бұрын
As someone who has written assembly professional (fairly recently, I might add), I still think there's some value in it. Mostly because it helps you understand computer architecture at a level you're not going to get from the perspective of a high level language.
@DFX2KX
@DFX2KX 3 жыл бұрын
Not to mention that, if I understand correctly, it's still used in microcontrollers, which are *everywhere*. People have made Atmel chips do some crazy stuff that way.
@BertGrink
@BertGrink 3 жыл бұрын
@@DFX2KX There's no doubt that programs that are originally written in assembler/machine code take up the least amount of space, and run the fastest.
@wbahnassi
@wbahnassi 3 жыл бұрын
If you're debugging your high-level language program and symbols aren't available, then (dis)assembly is your only option.. so yeah.. it is very relevant even today in various domains.
@glenndoiron9317
@glenndoiron9317 3 жыл бұрын
@@DFX2KX Assembler in microcontrollers is slowly going away, as microcontrollers are getting more and more powerful each year. The last serious microcontroller project I did around 13 years ago, had a 40Mhz MIPS32 embedded controller; the bulk of the microcontroller code was written to C, and only 6 or 7 subroutines were later recoded to assembler (bitbanging of words/blocks of words into an SRAM, and bitbanging IDE bus transfers). This resulted in a 10x speed improvement, but compilers have gotten even better since then, and I doubt that there would be as much improvement if it was (properly) done in C today.
@richardlighthouse5328
@richardlighthouse5328 3 жыл бұрын
@@glenndoiron9317 C makes me think less about multiplying 32 bit or 64 bit numbers on 8-bit microcontroller.
@wimwiddershins
@wimwiddershins 3 жыл бұрын
Back in 1980sumthin', I had a friend at school who'd sit in front of the C64 coding in assembly, while we all struggled to learn BASIC. It helped that both his parents were programmers.
@gilles111
@gilles111 3 жыл бұрын
Had such a friend to, wrote his own racing game while we were just struggling to copy a Basic-program out of a magazine...
@aikou2886
@aikou2886 3 жыл бұрын
That sounds like lots of fun! Yeah, I'm not being sarcastic. I genuinely find this bith fun and interesting, just wish I was able to do it while I was a kid/younger.
@gilles111
@gilles111 3 жыл бұрын
Was always a kind of jealous (in the same way as you describe - wished I could do the same as I found an still find this interesting). My friend was also the kind of kid that pulled a defective radio in parts and managed to get it back working.
@battlefox6481
@battlefox6481 Жыл бұрын
Came back to rewatch this video after learning 6502 assembly and I love it so much more!
@dhpbear2
@dhpbear2 3 жыл бұрын
6:46. Thank you, David, thank you! I started programming in assembly back in the early 80s. This is the FIRST mention of 'assembly language' NOT being defined as 'machine language'!
@MrRandomgamerdkHD
@MrRandomgamerdkHD 3 жыл бұрын
I read the title as "How Machine Learning Works" and wondered why David would make a video about that 😄
@flightlesschicken7769
@flightlesschicken7769 3 жыл бұрын
Oof... Me too
@danielecastro850
@danielecastro850 3 жыл бұрын
Me too! 😆
@peterweatherley7669
@peterweatherley7669 3 жыл бұрын
Same :p
@Squonk06
@Squonk06 3 жыл бұрын
Same here. I guess we hear a lot more about machine learning these days than machine language.
@Dobrouh
@Dobrouh 3 жыл бұрын
Same here lol
@astrocapsule
@astrocapsule 3 жыл бұрын
Me: "mmmm I wonder how David started this 2021..." David Murray: BALLZ 64
@sebudrsappu6098
@sebudrsappu6098 3 жыл бұрын
😂
@meatblazestudios3778
@meatblazestudios3778 3 жыл бұрын
"BALLZ 64" sounds like a Nintendo 64 version of 3D Ballz
@tjsynkral
@tjsynkral 3 жыл бұрын
I would've just said that Java and C# work a lot like BlitzBASIC... They kinda do!
@__blackjack__
@__blackjack__ 3 жыл бұрын
Except that in an additional step their ”P-Code” is almost always further compiled into native machine language.
@Spelter
@Spelter 2 жыл бұрын
@@__blackjack__ But only on the fly, so that takes time and that's the reason many say it's slow. The VM is cleaning up the code in RAM and if you run the same method again, its compiled again.
@CF542
@CF542 3 жыл бұрын
I wish that I had teachers like this in school. I might have learned to code and have stuck with it.
@mikeklaene4359
@mikeklaene4359 3 жыл бұрын
Not everyone is meant to be a programmer. To write assembler or even "C" requires a level of understand of exactly what the computer/processor is doing. Languages like COBOL or C# or Swift assumes that the coder is ignorant and must be protected from their own stupidity. Assembler and machine language just say "Yes sir!" and do what you tell them - even it will just lock up the machine.
@mikeklaene4359
@mikeklaene4359 2 жыл бұрын
@randomguy8196 The programming language is a tool. Some are better suited for different tasks than are others. In the bad old days when a job had to run in 8 or 16K of memory and the processor was rather slow, assembler was the only choice.
@leviwuzere07
@leviwuzere07 3 жыл бұрын
Holy hell, that cleanly, clearly, quickly and distinctly explained quite a lot about Assembly languages that I've been struggling to figure out for months as I'm interested in learning about how old computers worked as a modern programmer Excellent video
@joesterling4299
@joesterling4299 3 жыл бұрын
Assembly was the way to go even in the 1980s. You'd be amazed how well an 8088 IBM PC can perform if the graphics libraries are written in assembler. This was a forte of mine back in the day. Eventually, the technology advanced to the point where dabbling in machine code became rarely necessary. But the difference was night and day until graphics accelerators came into being.
@thewhitefalcon8539
@thewhitefalcon8539 3 жыл бұрын
@@joesterling4299 there's a demo called 8088 Domination which plays full-motion video with sound on an original IBM PC. Apparently, it is just barely possible.
@povilasstaniulis9484
@povilasstaniulis9484 3 жыл бұрын
Modern computers work very similarly. It's just that they are fast enough to run high-level languages at acceptable speeds and there's almost no need to write code in machine language directly.
@TheThomSirveaux
@TheThomSirveaux 3 жыл бұрын
@@joesterling4299 My first job after graduating was programming aircraft mission computers for the "Legacy" F-18 Hornets. Not the SuperHornets, the old mainstays, since they were still running on an Intel 8088 processor (well, there were a BUNCH of them, but yeah). This was less than ten years ago. While I was there, Boeing had a contract to upgrade the tech to... dual-core PowerPC chips and our group had to migrate from assembly to C++. At another position I worked, I had to set a register on an embedded platform, and for some reason the C++ code wasn't working. Thankfully, our IDE let you embed assembly code in C++, and that worked. Sometimes, assembly is just the way to go.
@mgjk
@mgjk 3 жыл бұрын
@@TheThomSirveaux I was once trying to demonstrate to somebody how memory protection worked. I set a pointer in C and would write to an address out of range to trigger a protection fault.... it didn't work. Then it hit me... because I never *read* the value, the optimizer discarded it. Once I turned off optimizations, it worked fine. Mental.
@give_me_my_nick_back
@give_me_my_nick_back 3 жыл бұрын
It's a thing of beauty when you first write the code for a big task requiring a lot of IO, then you spend a day eliminating everything that can be eliminated, packing as much as possible into the least possible numbers of loops full of breaks and other ugly commands you were always told not to use, making it kind of hard to grasp for any other person and voila 3 minute task now takes 30s.
@d2factotum
@d2factotum 3 жыл бұрын
I always remember reading about how Mike Singleton (RIP) wrote the original "Lords of Midnight" on the Spectrum--basically, he needed to save every byte he could in order to fit the thing in memory, and he would even re-order subroutines so that, if one subroutine always called another at the end, he'd put them one after the other to save 3 whole bytes (the CALL and the extra RET in the original subroutine). If only modern OS programmers had the same mindset!
@evensgrey
@evensgrey 3 жыл бұрын
@@d2factotum Yes, we'd have a LOT less software. Not being miserly leads to bloat, but not needing to be miserly leads to much faster development.
@SerBallister
@SerBallister 3 жыл бұрын
@@evensgrey Exactly, it's a balancing act of resources. It's easy to scoff at modern software without realising the constraints that it was developed in, namely deadlines.
@davidbonner4556
@davidbonner4556 3 жыл бұрын
Add to that if you write machine code or even Assembly source on a 6502, the most efficient branch statements only work within the same page... For example, a branch occurring in page 0x0400 cannot branch into page 0x0300 or 0x0500. If you got a branch violation you would have to re-arrange code to keep the branch legal by moving subroutines around or padding with NOPs (No OPeration commands). If I had a dime for every time someone added a few bytes to an early bit of code and I (as the "Clean-up" coder) had to restructure the rest of the source to fix such violations, usually on a Friday night before a Monday customer demo...
@SerBallister
@SerBallister 3 жыл бұрын
@@davidbonner4556 Reminds me of Gameboy development with its ROM banking. Bank 0 would be basically full of page-swapping trampolines (jump to bank 0, switch banks, jump to target bank) for all the cases of functionality spanning many pages.
@memsom
@memsom 3 жыл бұрын
A compiler and an assembler are two distinct stages. A compiler can use an assembler to assemble your assembly language files it generated. I think the terminology we usually use in modern CS now is : compiler - high level language, assembler - assembly language (what you call “machine language “ is either opcode (instruction), assembly (language) for processor specific instructions), object code or machine code for binary output, binary/executable for the linked object code - this is the bit you can execute. On older machines without an OS that supports the notion of exe files it’s a little more murky. Using “compile” for the assembly stage goes against normal usage.
@davidbonner4556
@davidbonner4556 3 жыл бұрын
As a Hardware Tech in the 70s I found it extremely useful to teach myself all manner of 8-bit machine code. I worked on S-100 gear (like the Altair 8800 shown in the video) but could only afford a Rockwell Aim-65 (almost identical to the KIM-1 shown) for personal use. For example, to test a memory problem at a known address in ram I'd enter a machine code program at a known good ram address via the toggle switches or keypad, whether Hex or Octal, to load a value to the Accumulator, store it at the bad address and then loop. This would set all the address, data and control lines to a known repeating pattern which I could then look at using an Oscilloscope and isolate the bad chip or shorted lines or whatever caused the issue. This lead to quicker repair of the problem than staring at a schematic and trying to "logic" it out.
@Kris_M
@Kris_M 3 жыл бұрын
Just a note: software that turns assembly into machine language was (is) commonly known as an assembler.
@joesterling4299
@joesterling4299 3 жыл бұрын
Right. He's conflating assemblers with compilers, which is not at all correct.
@lorensims4846
@lorensims4846 3 жыл бұрын
Yeah, I do commonly hear references to "Assembly Language compilers" but I think that's just laziness. A lot of people use a C compiler to assemble their AL code, but this bypasses the compiler to go straight to the assembly step. A compiler performs the difficult task of converting human friendly program code in to roughly equivalent assembly code for whatever machine they are running on.
@rty1955
@rty1955 3 жыл бұрын
The difference between a compiler and an assembler is that each line of source code in Assembly is one machine instruction (not counting macros) A compiler produces 1 to MANY machine code instructions per each line of source code
@PJBonoVox
@PJBonoVox 3 жыл бұрын
Listen to you all nitpicking just so you can let everyone in the comments know how smart you are.
@AmstradExin
@AmstradExin 3 жыл бұрын
@@PJBonoVox When people get paid for saying something in exchange for money, it is always valid to point out mistakes.
@undergroundman1993
@undergroundman1993 3 жыл бұрын
Back when I used to program my own Apple II games I would write out assembly subroutines and assemble them by hand on grid paper before typing in the hex manually
@fredsmith1970
@fredsmith1970 3 жыл бұрын
ha ha - I used to do exactly that with the zx Spectrum and the Amstrad CPC464 back in the 80's.
@nuk1964
@nuk1964 3 жыл бұрын
Yep... similar story with me and the TRS-80 Model I. Write assembly code, then translate into byte values (using the Z-80 reference guide), then write BASIC program to POKE it into memory. One annoyance when hand-translating the assembly code is when you discover the branch target is outside the range off the offset value, forcing you to adjust the code to adjust another, then another... Suffices to say that that method of writing machine code involved sufficient tedium that I was only writing small programs that way. I do remember being somewhat envious when I found out on the Apple ][ you can type CALL -151 to get into the monitor program.
@johngaltline9933
@johngaltline9933 3 жыл бұрын
I still have notebooks full of this stuff my dad wrote 40 years ago. I never understood any of it until the last 5 years or so.
@adamengelhart5159
@adamengelhart5159 3 жыл бұрын
These folks assemble 👍
@billr3053
@billr3053 3 жыл бұрын
@@nuk1964 Model I, yay!!! I wrote a disassembler in BASIC for the Z80. Somewhere along the line I acquired an assembler and did proper assembly language programming though. I don't think I put in hex via POKEs in the fashion your described. Maybe a few bytes worth to write text to the screen but that's it.
@InvalidUserProfile
@InvalidUserProfile 3 жыл бұрын
I love your videos and I love the intro theme song! It gets me hyped for the day ahead. Thank you 8-Bit Guy!
@Mirauge
@Mirauge 2 жыл бұрын
These are some of my favorite videos of yours. Thanks so much for sharing.
@AnonymousGentooman
@AnonymousGentooman 3 жыл бұрын
Even if undecorated, the new studio is looking great
@lannoene
@lannoene 3 жыл бұрын
I hope he's able to get some stuff on those shelves in the background.
@pandapolygon
@pandapolygon 3 жыл бұрын
na too bright
@anotheruser9876
@anotheruser9876 3 жыл бұрын
@@pandapolygon For now
@AaronOfMpls
@AaronOfMpls 3 жыл бұрын
Yah, I see he hasn't finished moving everything over yet, but I bet it'll look as good as the old studio when he does.
@pufaxx
@pufaxx 3 жыл бұрын
I'm not kidding: I really noticed that empty studio at about minute 19:00. Content was too interesting. 👍
@michaellong8812
@michaellong8812 2 жыл бұрын
This was a great video. Assembly language seems esoteric at fist, but once you learn it, you realize that a computer is very much a machine with levers that do different things. Thanks for sharing.
@brendanhoffmann8402
@brendanhoffmann8402 Жыл бұрын
This is so cool. I remember talking about this with my friend in high school in the early 90s. He was a mad scientist... always tinkering with old computers. He ended up becoming the CFO of an ISP. Smart kid.
@orondf343
@orondf343 3 жыл бұрын
5:20 C# and Java are actually in neither of the categories mentioned, and are much more similar to each other. They are compiled to and intermediate language (IL and Bytecode, respectively) which are then interperted by a runtime (CLR and JVM, respectively, using tricks to improve performance such as JIT (just-in-time) optimization). They are not entirely interpreted, and yet not directly compiled to machine code, but rather, both. (There exist some other languages that are also built on those same existing runtimes.)
@6581punk
@6581punk 3 жыл бұрын
The term is compiler-interpreter languages. I've not had that interview question for a while, bit I've had it in the past. These days with containerisation and cloud it becomes less important, We're getting even further away from the metal.
@wenyuwang3203
@wenyuwang3203 3 жыл бұрын
Just a side note: there are works doing ahead-of-time compilation for Java to make standalone binaries.
@donpalmera
@donpalmera 3 жыл бұрын
>They are compiled to and intermediate language (IL and Bytecode, respectively) and ..... So is C with any modern toolchain like GCC or LLVM. The fact that C started out life as a language that was translated directly to assembly and that Java was VM based from the start means very little now. Everything meets at the middle: Languages are just a frontend that is turned into some sort of generic presentation and that becomes machine code eventually. The JVM at this point is basically a massive compiler that takes java byte code as it's IR and spits out machine code at run time. If you don't believe me look at what Android did: They took Java's javac as their frontend to get java byte code and replaced the bit to get machine code. Originally it was a interpreted virtual machine but AFAIK now they do completely ahead of time code generation.
@natestickeler924
@natestickeler924 3 жыл бұрын
Somebody didn't watch the whole video before commenting 😂
@adamsfusion
@adamsfusion 3 жыл бұрын
@@natestickeler924 Saying "before you rush to the comments" does not make up for being wrong. If you're going to present yourself as an authority on a subject to beginners, at least get the easy information right.
@Lokalaskurar
@Lokalaskurar 3 жыл бұрын
Ooof! We REALLY need that blue colour back on the walls. It's become part of your journey :)
@6581punk
@6581punk 3 жыл бұрын
When doing photography, to get accurate metering they often use a "grey card" to set the camera exposure. So a darker background definitely stops exposure problems.
@The8BitGuy
@The8BitGuy 3 жыл бұрын
I do plan on painting the wall blue behind me...
@pedrofelck
@pedrofelck 3 жыл бұрын
@@The8BitGuy VIC-20 blue like you neighbour's house? I mean, like the outside of the studio. :P
@wadereynoldsgm
@wadereynoldsgm 3 жыл бұрын
C64 blue with light blue trim all the way around...
@mfaizsyahmi
@mfaizsyahmi 3 жыл бұрын
@@6581punk I saw that on Technology Connections.
@TheRetroShack
@TheRetroShack 3 жыл бұрын
Another great video David! As one of the inspirations for me starting my own channel recently, I just want to say ‘Thank You!’ For the years of great content so far, and hoping for many more years to come. Stay safe and well.
@XFanmarX
@XFanmarX Жыл бұрын
13:28 Wow that's so silly but so easily memorable, I love the terms programmers come up with sometimes.
@drdeath893
@drdeath893 3 жыл бұрын
Minor nitpick: Java and C# are in the same category. C# gets compiled to CLI byte code to be interpreted by the CLR (or other CLI compatible runtime).
@mumblic
@mumblic 3 жыл бұрын
I was thinking the same: There are in essence 4 kind of language: Assembly transformed to ML, Compiled to ML, Compiled to IL and Interpreted at runtime Although the line between some is getting thinner and thinner,
@DylanMatthewTurner
@DylanMatthewTurner 3 жыл бұрын
But C# bytecode is actually not interpreted. It uses a JIT compiler to convert assemblies to machine code, which still makes it faster on average than traditional interpreters. I don't know if Java bytecode uses a JIT yet, it has been taking a lot from C# the past couple years such as the var keyword, but I don't believe it originally used a JIT compiler
@drdeath893
@drdeath893 3 жыл бұрын
"Compiled" typically refers to languages that produce machine-specific instructions at compile-time. While languages like C# and Java (and even Python) can use a JIT runtime to run natively, the fact remains that they are not machine-specific until runtime.
@mumblic
@mumblic 3 жыл бұрын
@@DylanMatthewTurner Java and C# are very similar in they way they work. Complied to IL and both use JIT compiler. Actually C# or better the .NET JIT/RT is developed around the ideas/principles of Java
@alexmller1442
@alexmller1442 3 жыл бұрын
You can compile C# to native now idk about java tho
@environmentNow
@environmentNow 3 жыл бұрын
When I was in high school (I just finished), I used to write simple programs in 8088 machine language (Not Assembly) using op codes, and counting the memory address, when I got back home, I typed it in a hex editor, saved as a .com file, and tried running it in DosBox (there were usually a few mistakes).
@BigOlSmellyFlashlight
@BigOlSmellyFlashlight 3 жыл бұрын
reminds me of the period of time in 8th grade where i didn't have internet at home so i would look up my python errors at the school classroom laptop and write the possible solutions on paper and try those once I got home
@MrSloppyLoppy
@MrSloppyLoppy 3 жыл бұрын
Hey the construction of that was quite nice and thank you for sharing that as well. After seeing you put the wiring and how much care you put into that place it's going to be worth the wait and worse the while watching you make some new videos and see you come out with some new projects. Thanks for sharing
@JeffRyman69
@JeffRyman69 Жыл бұрын
Reminds me of my first programming class in 1966 on an IBM 1620 (operated by a console typewriter and punched cards). First we learned machine language. Second we learned Symbolic Programming System (assembler). Then we learned Fortran II.
@TheWanDatabase
@TheWanDatabase 3 жыл бұрын
It's worryingly convenient that begin researching the basics of using an assembly language only a day before this video comes out. Thanks for the explanation!
@llamathenerd1672
@llamathenerd1672 3 жыл бұрын
Same, I was just thinking of learning how to code in machine language on my VIC-20.
@bongodoug
@bongodoug 3 жыл бұрын
I've learned more about code in 20 minutes than I have in 20 years, but to be fair, I live on the hardware side of computer knowledge.
@miles7267
@miles7267 3 жыл бұрын
How should look into the breadboard computer series and programming assembly for the TI-83. Those two things taught me so much about how computers work
@kingkrispy5289
@kingkrispy5289 3 жыл бұрын
so you’re a really good electrical engineer?
@farhanyousaf5616
@farhanyousaf5616 3 жыл бұрын
What kinds of HW things? I'm a Software Engineer.
@hariranormal5584
@hariranormal5584 3 жыл бұрын
Same. I am more of a hardware/networking based guys
@Okurka.
@Okurka. 3 жыл бұрын
@@kingkrispy5289 He probably assembles PCs; not design motherboards.
@nicodermcq
@nicodermcq 3 жыл бұрын
Absolutely fantastic video. I don't think I've ever seen anyone describe or demonstrate this so well.
@derecwilsom4546
@derecwilsom4546 3 жыл бұрын
thanks for the great video david, hope you are getting things back to normal after the storm, stay safe.
@googlepask7551
@googlepask7551 3 жыл бұрын
Holy camera angle batman! Shelves intersecting the head in dead center. Looking forward how the studio ends up looking...
@misterhat5823
@misterhat5823 3 жыл бұрын
Assembly is not a lost art. It's still used for microcontrollers.
@mapesdhs597
@mapesdhs597 3 жыл бұрын
@@SimonWoodburyForget The caveat there is for industrial process control systems where available memory is often extremely limited, so doing it directly is preferable. Otherwise one is relying on however good the compiler is and that's too much of a luxury when available RAM is counted in K. It's just that public awareness of these fields is basically nill.
@neutrino78x
@neutrino78x 3 жыл бұрын
@@mapesdhs597 wouldn't it be more because there's no K&R C or C++ compiler for that particular chip or that system? There was a K&R C compiler for the Apple II and it's memory is measured in kilobytes :) Same with the IBM PC Model 5150. :) (Aztec C, Microsoft C)
@darranrowe174
@darranrowe174 3 жыл бұрын
Assembly is very useful for debugging too.
@misterhat5823
@misterhat5823 3 жыл бұрын
@@mapesdhs597 I've had to work with micros where RAM is counted in bytes. For a BLDC controller even 256 bytes is gross overkill when using assembly.
@misterhat5823
@misterhat5823 3 жыл бұрын
@@SimonWoodburyForget That's the complicated (and resource wasteful) way to do it. With microcontrollers we're speaking of RAM measured in K or even bytes and program ROM measured in K.
@wings9925
@wings9925 Жыл бұрын
Ah, the nostalgia! This takes me back to studying Computer Science in the late 80s and very early 90s! Writing interpreted code on the Sinclair ZX81 and Acorn/BBC Micro B, then progressing on to Pascal, C and ML itself. They teach little of the fundamentals these days: Little about hardware or the abstraction layer. Really enjoyed this trip down memory lane. Thanks.
@martinhertog5357
@martinhertog5357 Жыл бұрын
In 1983 I got my first Commodore 64. I learned Basic, machine language, all the peeks and pokes, even got a tiny C compiler. Wonderful times playing games, programming, disassemble games to see how they work. I even wrote a 6502 emulator on my PC just for fun. For a full C64 emulation I prefer using VICE!
@mateusbmedeiros
@mateusbmedeiros 3 жыл бұрын
*Starts typing well-meant feedback comment about Java and C# with video playing on BG * *Gets to the part where he says "Now, before you go rush into the comments to tell me how wrong I am about Java and C#" * "...goddamnit"
@Gurux13
@Gurux13 3 жыл бұрын
I'm in the same league. But... Why not put them into one bucket of interpreted/compiled?.. Doesn't matter which one, but they're basically the same in terms of all the interpreter/compiler, VM, JIT, etc. stuff!
@steffennilsen2132
@steffennilsen2132 3 жыл бұрын
Oh I admit I was triggered while hearing this in the background myself lol
@stewcoil2481
@stewcoil2481 3 жыл бұрын
@@Gurux13 Yeah, I think C# is compiled into Intermediate Language (IL), then the Just In Time (JIT) compiles it on the end users machine (and saved) as Machine Language optimized to the CPU it runs on, so it might be different between AMD/Intel or different versions of the processor (like a new instruction might be available on a newer processor).
@borrrden
@borrrden 3 жыл бұрын
I’d certainly put c# and Java into the same category on this simplification. Both of them are compiled into an intermediate representation before being compiled into machine language :)
@BonkedByAScout
@BonkedByAScout 3 жыл бұрын
C# is not compiled and shouldn't be bundled with them. It's cached pre-interpretation at the VM level at best, which other languages like Python also do. Posing C# as a compiled to assembly language is just dumb.
@user-tb5ns7hc5i
@user-tb5ns7hc5i 3 жыл бұрын
I learned assembly and machine language on an Apple II in grade 8 in the mid 80s after learning to code in basic on a Vic 20. Great video David. Memories. Pun intended.
@TheRainHarvester
@TheRainHarvester 3 жыл бұрын
This interests me. What books/people/resources did you have that allowed you to find info for learning? I was similar in age and desperately looked in every book in every book store and library but couldn't find info.
@user-tb5ns7hc5i
@user-tb5ns7hc5i 3 жыл бұрын
@@TheRainHarvester there was a unique school ‘nerd’ culture at the time 40 years ago when home computing was so new so there was a lot of shared interest and resources available at that time mostly by just networking and hanging out in computer labs and clubs and online bbs chat rooms with similarly minded enthusiasts. We learned from each other in real-time by dissecting and sharing each other’s code and watching older kids code and ‘hacking’ software to learn how the applications ran. There were also many magazine publications with programming code examples in them that we would religiously type out and learn from. It was a very social intense time for computing with a lot of new exciting ideas happening quickly. I would recommend today trying to join a local computer club and join online groups dedicated to specific kinds of programming languages catering to your level of experience. If I were looking to get into it today, I would immerse myself in Artificial Intelligence machine learning, VR, and neural networks for sure. The next big things along with nano and bio tech.
@markyacoubian1911
@markyacoubian1911 Жыл бұрын
@@user-tb5ns7hc5i Seems like a similar era today (I am currently in CompSci1900 at the local state U); even though I was only in primary school in the mid/late 80's I have a pretty solid sense of historical time periods. They also tried to teach me Apple II stuff and some simple programming (2nd grade thru 5th grade in 1988-1992) but I didn't get much further than Oregon Trail (version 1.0) and the version 2.0 of Oregon Trail with slightly better graphics. Haha.
@ChrisM541
@ChrisM541 2 жыл бұрын
Excellent video! This brings back memories. Subbed! As someone who has programmed a lot of assembly software in the 80's for the C64, there's a couple of things that would benefit from a little expansion. At 5:12 assembly language isn't compiled - it's converted to machine code by a process known as assembly. This distinction is important to note - particularly for the way in which many assemblers 'of that era' worked...your hand-written assembly program, literally, was a 1:1 version of machine code. Every assembly mnemonic op-code was converted to its machine language via a simple lookup table, a table which also determined the type of operand, where applicable (CLC, SEC, INX, etc have no operand). In these early days, the programmer would always know what the machine code output would be before assembly. Confusingly (and I guess where we're seeing 'assembly as a compiled language' in this video), some of today's compilers e.g. C++, through the compilation process, can also produce an assembly version output. But this is not hand written(huge distinction!!) - it's been generated from a high level language source i.e. C++ - the programmer isn't writing in assembly language. In later years assemblers would offer increasing levels of macro abstraction together with machine code optimisations e.g. an assembly multiply or divide instruction by a power of 2 might get replaced by a faster rotate instruction. Depending on the use case (and for maximum speed), a pre-computed look-up table could also be used (used extensively in all those shoot-em-up's). The primary focus with these early computers, particularly for games programmers, was in execution speed and program size. Today's extremely fast CPU's, GPU's and large RAM sizes, perhaps unfortunately, require programmers to pay much less attention the level of manual optimisations required in the past. A word of caution, though, for compiled languages - don't assume the compiler will always produce the fastest possible machine code - manual assembly optimisation in certain time-critical loops (e.g. main game loop) is more common than you might think in today's AAA studios!
@ctrlaltrees
@ctrlaltrees 3 жыл бұрын
We had an entire module on 6502 assembly language in my Computer Science degree course 15 years ago. I'm mainly a C# guy in my day job now. Anyway, this is a really excellent and information-dense introduction, nice work! I particularly liked how the part about everything being a memory address as far as the CPU is concerned was explained - getting your head around this is really fundamental and helps all of the other pieces fall into place. 👍
@stargazer7644
@stargazer7644 Жыл бұрын
But not all processors work this way. The Z80 and x86/x64 (as 2 examples) can talk to devices via memory addresses, but they also have an I/O port system where they can be mapped to IO ports instead so that the very limited system memory address spaces are not wasted for hardware.
@discoHR
@discoHR 3 жыл бұрын
11:55 We used to call it "assembler" over here in Europe while "compiler" was used for high level languages (Pascal etc). Yes, they basically do the same thing.
@bozimmerman
@bozimmerman 3 жыл бұрын
Same in the U.S., though I have to say that yall had MUCH more fun with the word 'assembler' when naming them than we did.
@rty1955
@rty1955 3 жыл бұрын
Not at all. You CAN create machine code by hand with an assembler source code, but you cannot create machine code with compiled languages such as C
@discoHR
@discoHR 3 жыл бұрын
@@rty1955 They both do the same thing. Assembler: assembly -> machine code Compiler: C -> machine code You can also inline assembly language into C source if you wan't to speed up your code or if you want to skip unnecessary machine code instructions compilers usually generate. I used to do it a lot back in the (DOS) days.
@rty1955
@rty1955 3 жыл бұрын
@@discoHR no they dont..... An assembler assembles and a compiler compiles.... Assembly Lang is a one lines of source to one machine codeb an Compiler produces 1 lines of source code to MANY machine codes BIG difference
@discoHR
@discoHR 3 жыл бұрын
@@rty1955 Doesn't matter. They both produce machine code. Humans can write unnecessary instructions too, such as CPX after INX shown in this video. INX already updates the zero flag so CPX is not needed and it just slows everything down.
@RWSCOTT
@RWSCOTT 3 жыл бұрын
I always used to giggle when they'd mention the lords of *Kobol* on Battlestar Galactica :D
@elanman608
@elanman608 3 жыл бұрын
Real nostalgia trip I remember using the RML 380z at school in the very late 70's and early 80's which had a halfway decent Basic compiler as well as an assebly language interpreter and competing to perform tasks in the fewest clock cycles.
@001GrandExplorer
@001GrandExplorer 2 жыл бұрын
The best programming intro I've ever have! I even will recommend this to my colleagues!! Thank you so much for this great work!
@kjrehberg
@kjrehberg 3 жыл бұрын
Great video. I'm old enough to call it "assembler" instead of "assembly language."
@maighstir3003
@maighstir3003 3 жыл бұрын
I was under the impression that the language (well, languages, one for each CPU) is called assembly while the application that assembles the text into machine code is called an assembler. That may very well be a more recent change though, I've only been messing about with computers for less than 30 years and the lowest-level language I've dabbled in is C - and only barely at that - I'm much more familiar with Python, Bash, and Powershell.
@junbird
@junbird 3 жыл бұрын
Those are two very different things, even though this misconception is very common even to these days (I heard computer science teachers confuse the two concepts). Assemblers are basically compilers, they are programs that compile assembly language to machine language.
@countzero1136
@countzero1136 3 жыл бұрын
You too eh?
@mattfojtik7130
@mattfojtik7130 3 жыл бұрын
There is a pronounced 60 Hz hum in your new studio. It's present in every scene where you are talking in front of your desk.
@Defianthuman
@Defianthuman 3 жыл бұрын
60hz is the American power standard and there are computers and things running
@HighPassGuy
@HighPassGuy 3 жыл бұрын
It actually sounds lower than 60Hz.. It sounds like it could be the AC or some fan running. A high-pass filter would fix this for you. Most mics have one built in..
@richardlighthouse5328
@richardlighthouse5328 3 жыл бұрын
@@HighPassGuy Bandpass filter would be better.
@markusbl80
@markusbl80 3 жыл бұрын
Bass roll off would do the trick
@HighPassGuy
@HighPassGuy 3 жыл бұрын
Why would a bandpass filter be better? and a "bass roll off" is a high-pass, just said a different way.
@michaeldefries3583
@michaeldefries3583 Жыл бұрын
this is the best explanation I've ever hear/seen. I started programming over 25 years ago with C++ and had no idea on how it actually worked. I realised early on that I wasn't driven enough to keep up with the pace of learning different techniques and languages but it has always interested me. You've just answered one of my main questions around machine language and assembly. thank you.
@josephgaviota
@josephgaviota 2 жыл бұрын
Mr. 8-bit. I'm watching this a second time today. You're really good at making things easy to understand, and many of us really appreciate your efforts. PS: As a FORTY-year computer guy (CCI / ATEX / PENTA / KORN / PYTHON) ... I can really appreciate what it takes to get the computer to do what we need for a given task.
@alphabeets
@alphabeets 3 жыл бұрын
I’ve waited decades for a video like this explaining these things in simple terms. Thank you.
@gzozulin
@gzozulin 3 жыл бұрын
You caught me when I was "rushing into the comments to tell" lol
@TimsCabana
@TimsCabana Жыл бұрын
I have been writing assembly language code for over 30 years now. It's the only language that I know, and I still love it! I design a lot of embedded stuff, and write all the code in assembly. In fact, many years ago, I designed a timer system for my home recording studio that had 16 outputs, and could time events to the 1/100th of a second. I wrote all the code in machine code. At the time... I had no idea what a compiler was because I taught myself how to do this. I used to go through lots of paper!
@carpdude73
@carpdude73 3 жыл бұрын
It is fun watching your videos (even though I am only following a fraction of your explanations)! Great new space! Can't wait to see it completed!
@KLa35
@KLa35 3 жыл бұрын
This is the Mecha Hyper Jesus Animatronic with lasers of 8-Bit Guy episodes.
@234laptop
@234laptop 3 жыл бұрын
Feedback on the new set: The audio has a bit of reverb/echo. Apart from that, looks nice.
@KanawhaCountyWX
@KanawhaCountyWX 3 жыл бұрын
I sincerely hope he moves over the bracket mounted keyboards.
@GP1138
@GP1138 3 жыл бұрын
There also appears to be some low-frequency hum in the audio.
@cumulus888
@cumulus888 3 жыл бұрын
@Cheese Touch Gaming Wonder if that is from the LED lights.
@whiffysole
@whiffysole 3 жыл бұрын
@Cheese Touch Gaming it's probably something to do with the bright white background and how he has the lighting set up
@FerroequinologistofColorado
@FerroequinologistofColorado 3 жыл бұрын
@@KanawhaCountyWX I hope so too
@Tamoor622498
@Tamoor622498 3 жыл бұрын
I learned basic assembly as part of my degree, I'd love to learn more! That assembly 10 hour video sounds awesome!
@mytech6779
@mytech6779 2 жыл бұрын
It assembles into basic?
@Tamoor622498
@Tamoor622498 2 жыл бұрын
@@mytech6779 hmm? Basic turns into assembly
@HodgdonH110
@HodgdonH110 2 жыл бұрын
Fantastic you brought back so many memories (not a pun lol) - back in early 80's I bought a NASCOM kit computer using the Zilog Z80 - the guy at shop said "you want the BASIC module with it" - I said no I'm learning machine code - and did. Later in college we used the 6502 and yes I DID know the Terminator shot was 6502 code - thanks for a great video
@FandCCD
@FandCCD 3 жыл бұрын
I started learning assembler for AVR (Atmel) processors a couple years ago. I love it and found it to be pretty easy to work in. I’m more of a hardware guy so manipulating registers to make hardware do different things really made sense to me. I just wish I could continue to justify all the time I spent learning it.
@andie_pants
@andie_pants 3 жыл бұрын
So I clicked on ONE silly 22-second long video and suddenly my YT feed is nothing but thumbnails with red arrows and circles. I was about to lose hope when suddenly... The 8-Big Guy appeared!
@jamesoakley821
@jamesoakley821 3 жыл бұрын
Great vid as always, David. It’s pretty cold in Dallas right now
@the1stofthe453
@the1stofthe453 Ай бұрын
I just ordered Ben Eater’s 6502 computer kit, and I’m super excited to dive right into this kind of stuff. Great video!
@xyzzyfrobozz
@xyzzyfrobozz 3 жыл бұрын
The new studio needs a sign saying, "This space not intentionally left blank." :) Nice progress though.
@greenslimy
@greenslimy 3 жыл бұрын
I wish I could like this twice. It explains all of the intricacies involved in Computer Science.
@pvc988
@pvc988 3 жыл бұрын
Not even close.
@gryfandjane
@gryfandjane 3 жыл бұрын
This was fascinating, thanks! Back in the day, I would stay up late keying BASIC programs into my Atari 400 from books that didn’t target Atari machines. I learned a lot. Then I took a data processing class at a local community college, in which we entered machine code into punch cards and executed them on a mainframe, with the output appearing on a huge dot-matrix printer. Yeah, really old-school for the mid-1980s; there were complaints from the class, along with suggestions that learning a higher-level language would make more sense. So the teacher explained that the language we were using had been a pet project of one of their IT faculty, and we were basically stuck with it. And the funny thing was, the class gave me a solid concept of what actually goes on under the hood. I learned things like not sending my outputs to the same memory space as my instructions, causing my program to eat its leg off and die, for example. All told, it was great fun. Again, thanks for all the great content!
@memepatroller9533
@memepatroller9533 3 жыл бұрын
The new studio looks amazing! I love your channel.
@MisterLiker
@MisterLiker 3 жыл бұрын
Me: "Damn, it's almost three in the morning, I really should go sle-" KZbin: "Wanna see an 8-Bit Guy video?"
@kingkrispy5289
@kingkrispy5289 3 жыл бұрын
Mood
@375-Gaming
@375-Gaming 3 жыл бұрын
Literally!
@keatondickens2532
@keatondickens2532 3 жыл бұрын
can't wait for PART 3 studio construction but i do miss the old blue background
@zoltanboros8963
@zoltanboros8963 3 жыл бұрын
Me too.
@the51craw
@the51craw 2 жыл бұрын
Really great video! I've been working both hardware and software programming in many languages including assemblers and even machine code. I have also written my own assemblers for 6502, 8080 and later also for PIC1550. I say this not to brag, but to give weight to my words when I say: You have done a great job with this video!
@netherlabgames7511
@netherlabgames7511 3 жыл бұрын
I'm always captivated by your videos!
@BenHeckHacks
@BenHeckHacks 3 жыл бұрын
Great video. Suggestion though, you should have discussed the "endianess" of how 16 bit values are stored in memory.
@thekornreeper
@thekornreeper 3 жыл бұрын
🖤
@TheNewVortexChannel
@TheNewVortexChannel 3 жыл бұрын
Yes
@johndododoe1411
@johndododoe1411 3 жыл бұрын
See www.ietf.org/rfc/ien/ien137.txt for the definitive endian-ness introduction.
@TheBigBigBlues
@TheBigBigBlues 3 жыл бұрын
Second Ben comment on a video I've watched today...
@bastscho
@bastscho 3 жыл бұрын
Endianess can be needlessly confusing.
@trevinbeattie4888
@trevinbeattie4888 3 жыл бұрын
Learning assembly in the 80’s and 90’s, I’ve found that 6502 is relatively trivial (that’s the first one I learned), 8086 (and its successors) was nightmarish, 68000 is clean and elegant, and VAX is rather fun (it’s one of the most complex instruction sets I’ve ever had the pleasure to program in - it even has string operations!). I would have liked to try my hand at a RISC processor such as the T400 or ARM, but never got my hands on one.
@stargazer7644
@stargazer7644 Жыл бұрын
Take a look at like the Microchip PIC series of microcontrollers. Those are RISC processors and are often programmed in assembly, though C compilers are available.
@-r-495
@-r-495 Жыл бұрын
Your content is right up in the top three of my favourite yt creators. And that‘s just me. You‘ve got at least one!
@richardsd8526
@richardsd8526 3 жыл бұрын
New studio looks great. Always a good video!!!
@anjinmiura6708
@anjinmiura6708 3 жыл бұрын
It's good that he's getting back to work again. And even better that he's discussing Assembly language. I used to write assembly language for CoCo and OS-9 (6809). I think you SHOULD make a side channel for C64 Assembly language development. It would be awesome. PLEASE!
@CraigRodmellMusic
@CraigRodmellMusic 3 жыл бұрын
I found the content so intriguing and interesting, I never even noticed the blank walls or different colour until David mentioned it at the end.
@sa3270
@sa3270 3 жыл бұрын
He tricked us!
@stevethepocket
@stevethepocket 3 жыл бұрын
I bet you didn't notice the guy in the gorilla suit either. 😉
@CraigRodmellMusic
@CraigRodmellMusic 3 жыл бұрын
@@stevethepocket No, I didn't! I'll have to watch it again! (Not that that's a problem!)
@Get_Technical
@Get_Technical 2 жыл бұрын
Love your videos, I started on a Vic20 long, long ago and still use the knowledge from then, right into dos, scripts, and programming
@benjaminmoseslieb9856
@benjaminmoseslieb9856 Жыл бұрын
This was so eye-opening for me. Thank you so much! I've been a web developer for 15 years and never really had to look into this. The advent of WebAssembly though is changing that.
The basics of BASIC, the programming language of the 1980s.
24:07
The 8-Bit Guy
Рет қаралды 2,3 МЛН
“Hello, world” from scratch on a 6502 - Part 1
27:25
Ben Eater
Рет қаралды 4,6 МЛН
когда одна дома // EVA mash
00:51
EVA mash
Рет қаралды 13 МЛН
Kitten has a slime in her diaper?! 🙀 #cat #kitten #cute
00:28
4. Assembly Language & Computer Architecture
1:17:35
MIT OpenCourseWare
Рет қаралды 690 М.
How do computers read code?
12:01
Frame of Essence
Рет қаралды 3 МЛН
How does Computer Memory Work? 💻🛠
35:33
Branch Education
Рет қаралды 3,6 МЛН
Comparing C to machine language
10:02
Ben Eater
Рет қаралды 5 МЛН
How Telephone Phreaking Worked
29:17
The 8-Bit Guy
Рет қаралды 2,1 МЛН
Why Do Computers Use 1s and 0s? Binary and Transistors Explained.
7:00
Basics Explained, H3Vtux
Рет қаралды 4,2 МЛН
Is this the FASTEST and CHEAPEST 8-Bit Computer Ever?
28:43
Noel's Retro Lab
Рет қаралды 154 М.
How Binary Works, and the Power of Abstraction
15:17
Josh's Channel
Рет қаралды 292 М.
How did the Enigma Machine work?
19:26
Jared Owen
Рет қаралды 8 МЛН
How Do Computers Remember?
19:32
Sebastian Lague
Рет қаралды 6 МЛН