Hi, i have a question for you.. How does a human being invent a new asembling language?? Let say if he does not have a second computer i.e. there are no computer at all in this world for example like alan turing. I mean how do you define "Add" function to the computer? If the function "add" is presumed as an individual character such that A is equals to some number (which can be converted into binary number) let use hexadecimal for easier purpose. If A=10, D=13, D=13; So we write it in binary: 1010, 1101 , 1101 with each the values written on the EPROM or harddisk or anything. Then, when the user's input is like this (i.e Add), the computer will execute addition function either through programming as you've mentioned in the video, or maybe design a new logic gate?? But my main concern is that how do we reduce the memory size for each character written? i.e due to the fact that "D" character in this example is greater than "A" character because D= 13 in hexadecimal and A= 10. How do we make all the characters on our keyboard to have same memory size when converting them into hexadecimal but still they are distinctive from each other? Hopefully you understand my question
@@footballCartoon91 >Then, when the user's input is like this (i.e Add), the computer will execute addition function either through programming as you've mentioned in the video, or maybe design a new logic gate?? we don't send the ASCII representation of the instruction mnemonics to the CPU. the assembler will turn our source code (which is that ASCII plain text) into the appropriate opcode. the CPU understands this opcode because its circuits are *designed to understand it.* remember that in memory, everything is just numbers. what matters is how the CPU treats them. it usually expects instructions, and depending on the instruction it might expect raw data. each instruction triggers the appropriate bits and logic gates to perform its function. so to answer your question, we don't really invent an assembly language. we invent a CPU and the assembly language is a byproduct of how the CPU's circuits work. since you mentioned the restriction of having only one computer in the world, in that case you would have to assemble the program by hand. >But my main concern is that how do we reduce the memory size for each character written? i.e due to the fact that "D" character in this example is greater than "A" character because D= 13 in hexadecimal and A= 10. those values still fit inside 4 bits. your main concern should be the width of the value in binary, not the value itself.
Graduated with a degree in Computer Engineering a few years ago and I WISH I had an instructor like this guy because I've understood more from these videos than all of my Computer Architecture classes combined!!
@@deang5622I mean, it’s one class out of dozens you take in college. I have the same degree (different college probably) and loved my computer architecture class, but there are other classes which had poor instruction. All college courses are hit or miss, because they’re taught mostly by researchers who just happen to be teachers. They are good researchers. There is a chance that they are good teachers. And they keep their job by doing good research, not by teaching well.
badum-tsss... I can imagine some dad telling this joke to a waitron and the waitron awkwardly laughing because of a possible tip at the end of the super awkward exchange.
Four years on and these Videos are still being found and much appreciated by the likes of me. Thank you very much, Ben. Your Videos are THE BEST ones, to cover this topic.
What makes this channel so great and educational is that he shows the actual process of programming a chip from scratch including things like referring to the documentation and datasheets and so on. It's really helping me understand how these things work and how to work with microprocessors.
@pyropulse almost anyone can learn how to program computers as its not that expensive compared to doing something like learning to weld and machine or learning to fly a plane
@@krabsauce9792 what's kind of crazy is that I could read and understand what instructions the hex code were, and when he went "let's delete the #" I was "yeah, you'll get A5 instead of A9 ... because I programmed an Apple ][ in machine code without having an assembler back in 1980 when I was 17.
@@BenEater time in the universe is not infinite. But i like your style of taking everything slow to really make us understand the process and really making us smarter for life
A blinking LED is the "Hello World " equivalent in the raw CPU assembly programming world. So, in some way he did it already. I wanna see his display code, though. It's always a bit of a mess in assembly.
I never thought Assembly would ever make sense to me, but you've explained it so clearly. I think it really helped that you did this as a series, starting with the physical pins and connections made understanding how the instructions correspond to them so much easier. This has been a really awesome series, I'mma subscribe.
I have learned more about practical digital electronics from your videos than two semesters of dedicated digital electronics labs. Thanks for all your hard work!
Man I love this 6502 series. I'm currently almost finished with the 8 bit cpu (I've made some upgrades). Money definitely well spent. Thanks for all you do Ben, from your semiconductor video to this video.
I love your approach in these videos so far. You always show the manual or raw way to accomplish something, and then you show another way that is more efficient or natural to accomplish the same task. ie. using labels instead of the actual hard coded address values. It makes so much sense when presented this way. I learn much faster by example, and your videos are exactly this!!!
I don't do it for a living, but I've written some asm and took applied electonics classes, so I pretty much know everything he talks about, still, pretty good entertainement.
These Videos are CRAZY in the amount of complicated content, presented in a very clear way. Very well done and one thing that is making this happen is that he repeats information relatively often. But also the calm voice and the "its really easy tone". Very well done. TopNotch teaching. Coming from a fellow teacher.
Back in 1985 that’s how I coded, with 6502 instruction set and paper and pencil and then typed the bytes. I had to count the bytes for the jumps by hand and if I had to jump more than 256 bytes I coded smaller jumps by hand. We had no compiler to do that.
PaulsMagicVideos I had the Print-out of the Apple 2 OS in the back of the Apple Manual, so I knew Assemblers existed, but we didn’t have that at school. yes, 6502 programming was a school topic in 1985! It was awesome. I met and thanked my science teacher for it 36 years later! The 6502 had a clock speed of about 961 kHz, not even 1 MHz!! We entered the bytes with a poke statement for each byte.
You want pain? Had to toggle in addresses and instructions individually on the high school's brand new PDP-11 circa '72. Big hoorays when they later that year 'upgraded' with a punched papertape reader/writer. Ah the good ol days. LOL.
I had an entire semester of 6500 training back in 1989, we built and interfaced circuits just like this. I wrote an assembler program in a relational database that was called Paradox and downloaded programs from my PC through a serial link to the processor. This brings me right back to the great times I had !
This highlights both the beauty and the frustration (for me, anyway) of programming. I started out self teaching on all this at 12-13 yrs of age. This all made sense, was intensely fascinating but remembering and recalling all of the "fiddly" little quirks like the carry bit, "little" vs "big" endian etc, is what caused the frustration.....which caused me to give up programming almost before I started it. Unbeknownst to my 12-13 yr old self and parents and teachers, I had ADHD. A fact I didn't learn until I was diagnosed at age 38. Looking at this now, knowing what I know now, considering my own neurocognitive "quirks", i'm getting tempted to dive back in. The fascination and the fact it makes perfect sense is all still alive but now I can include workarounds for the working and processing memory deficiencies (meat, not silicon) I have. Thanks for rekindling the memory of being an enthralled kid!
It is so cool seeing you make these circuits and then programming the hardware. I took an embedded systems class last semester and we coded in HCS12 Assembly Language and it is so cool seeing everything that I learned in that class applied here.
For my machine language program I wanted to increment A from 00 to FF and send it to the LEDs. That worked, but in plain 6502 assembly there’s no INcrement A mnemonic (op code 1A). After doing a little googling I see 65C02 added a few really useful instructions beyond the MOS 6502 and vasm supports them if you add the -c02 option on the command line! Actually for this chip there’s the -wdc02 option which includes even more instructions added by WDC.
@@SypakaAdding one to A is a good idea as has already been mentioned but depending on the scenario you might also use the X or Y register with INX and then store it with STX for example. Those registers are made specifically to be counters/indexes to increment, but if you need to do other things with that value it'll take an extra transfer.
I have little to no idea of what is going on most of the time in these videos but it's super enjoyable and I get the sense that, if I were to stay and listen for long enough, I might learn a lot!
It seems sooo incredible today that we had learned all these stuff in the 80s without internet, without youtube... Wish I had a teacher like you when I learned assembly!
I've been into computers for almost 15 years by now, and it's with these videos of yours, especially the bread board CPU series, that I finally get to learn how they actually work underneath all the software and hardware abstractions. Thanks a lot, this is great work!
I remember when these details were much more ‘bleeding edge’ than a walk down memory lane. I’m glad someone young is still paying attention to these details…
10 месяцев назад
Congratulations teacher for this brilliant series! I have learned a lot from your videos! The Lord has my best salute!
These LCDs are quite fun to play around with. I once made a 2x16 character display with 5x8 pixels per character draw a ping pong ball moving around pixel by pixel and bouncing off the edges as well as a small pixelated image moving across the display pixel by pixel with the 8 user-definable characters that the display offered. The assembly language is incredibly powerful once you make use of subroutines.
lol as others have already pointed out, I also smiled when I saw the thanks to you on the download link. I use vasm myself from time to time as I have a homebuilt 6502 from the late 90's that does various automation tasks that I built to replace a pic based system when it became too limiting... it used to do quite a bit from lighting to door locking and things but now it just mainly keeps plants watered... of course these days you can do plenty more and a lot quicker on a $2 arduino uno clone but back then I used to repair arcade boards when there were still plenty of arcades about I often had donor boards about and 6502s, z80s and eeproms were pretty abdundent, as well as an unbelievable amount of ttl glue logic. Kind of funny that now the technology is more available and easier to build and use the less I do :P
Hello! I am trying to do this project and vasm isn't working for me, I can't find anywhere online about how to fix this, so you are my last resort. I'm trying to compile a file but it says no input specified, I've tried everything, I am using Cygwin for windows 10 64bit, I put in the command: "./vasm6502_oldstyle -Fbin -dotdir blink.s" am I doing something wrong?
Learnt more here in 15 minutes than I did in an entire term's module on Microprocessor programming at university 20 odd years ago ( I was probably hungover most of the time back then mind :D)
I took this course in Digital Electronics with Laboratory through Cleveland Institute of Electronics many years ago. We built a 4-bit computer for one project! We used RAM chips, switches to do addressing and a 1Hz clock (whew!!!). It had 1 kbye of memory, 2 input registers and 4 instructions: AND, OR, XOR, NOT. It did not fetch instruction and decode them though. We do that manually. It was just a tool for learning how a computer works. These kind of projects like the 6502 remind me of the good old days! I used to used the Motorola 6809e, Intel 8085, Zilog Z80 and others. Embedded computing was a lot harder in the old days. Today they have so many microcontroller boards that are way more powerful, cheaper and easier to use, but using them robs one of the underlying knowledge that makes it work.
I'm far too stupid to understand most of what you do, but I find it fascinating none the less. I also think it's great that you don't edit your videos to remove little things that go wrong like compiler errors, but instead show how you fixed them. Excellent stuff, keep it up!
In my first job, I wrote 680x assembly programs, and by wrote, I mean I had to write them down on lined paper, then write the machine code next to each line in the margin, then type all the bytes into a BBC micro which had a ROM burner attached. My biggest program was almost 8k which, for reference, is a full ring-binder worth. You guys have it so easy these days, with your fancy assemblers!
@@craftsmanwoodturner - well, long answer is that we also used the (awsome) Dataman S3 programmers, and to do software updates we would call out any changed bytes on the telephone to our customer, who would be typing them into their Dataman. In order to make this work, each page of code was divided into 4 line groups, and when your code got to the end of a page (only one page allowed per subroutine!) the remaining bytes in the final group of 4 were left blank - to allow for pudent modification of that page of code without affecting any other page. An assembler *might* rearrange a whole load of other code after an update. While a similar approach could probably have been forced with an assembler, my Boss was an eccentric PDP owner/operator, and insisted it was done this way. As a 'rookie' it certainly was a good way to learn the careful writing of code. It's a process that younger generations might find hard to imagine!
While i would lie if i sad i would pass my computer technology class only with your videos, but those are by far the best ilustrationon of what the hell is going on:) keep up the good work i really helps me to understand it
Opcodes were how we did do it back in the day! Literally by writing DATA statements in BASIC, and reading those and POKE'ing the values into memory addresses. Back then we used to be able to memorize the decimal values for the opcdes (there weren't that many to memorize for the 6502).
Brings back memories of programming in assembly on old GM 6800 series car/truck ECMs from the early 80's. Kind of fun to program on since they did not require a bootable operating system like the later ones, which meant you could use them for simple control projects.
Wow as a Kid wanted to understand assembly etc. Over time it made sense but it was always something I never fully understood. Thanks for making it clear. I wish I knew how to do Assembly programming back in the Z80 days!
These videos remind me of when I built a Z80 based computer from a kit (a complete computer with a proper video display - B&W of course - and cassette tape storage) and then entered Microsoft BASIC for the TRS-80 into it, one hexadecimal instruction at a time, saving it on tape between sessions, and finally altered it so it would run on the kit computer. That was fun. The kit computer had a display half the size of the TRS-80 and used a different method for saving and loading on tapes and accessed the keyboard differently, so I had to alter all three of those sections of the code. Yes, I made it work. I used it for quite a while until computers which used disk drives became affordable.
Another Ben Eater video! I'm really excited for this series of videos. I look up to your skill and ability to teach others and hope to be like you one day.
I won't lie. A large amount of what you do on your channel is way over my head but I find the content both fascinating and somewhat philosophical. I always say that computers turn stupid electricity either from a wall socket or battery into smart electricity that can dazzle our senses and create worlds and realities beyond most of our imaginations. I often draw parallels between things that happen in everyday life like the predictable nature of my dog when I give it basic commands like sit or roll over to the pure logic nature of computers and sometimes wonder where is the 6502 chip(s) controlling my dog. It's just interesting seeing the "magic" happen bit by bit and realizing it's not magic at all but just a crap ton of very basic commands. It's really quite enlightening.
Ben In every video you make, you blow my mind! You have an amazing skill of explanation and you present the ideas in a great order! For years I have been looking to understand computers, and never found nothing as clear as your videos (besides the book of J. Clark titled But how do it know). Thank you very much!
Ben: "No one actually writes software this way" Ben moments later: "hold my beer, in my last video actually I DID write this program by writing out the machine code by hand".
I wish someone would have told me this back in the 1980s. I wrote a few video games and my own disk operating system in 6502 machine language. Yes, typing in hexadecimal. (It can be done.)
I've been programming in assembler for (yikes) about 40 years.... but it's still great to watch this series and see you helping othrrs pick up my dubious habits. ;)
I'll be damned: after watching the previous 2 vids, i started thinking about building a similar project, just using some things differently, such as not using the 6522 chip and such. Then, on the day i started planning it all out, you released a vid which mentions that you'll be using it to drive an LCD, which was one of the things i planned on doing once i got it running
Really fun stuff! This reminds me of my one-and-only assembly language program that I wrote for our family's Commodore VIC-20, back when I was in my teens. It just put a little Pac Man character on the screen and made his mouth open and close. Nothing thrilling, but I was stoked to have figured it out. I'm kinda wishing I'd stuck with assembly language stuff beyond that one program, but I've been coding in other languages over the years, so at least the programming vibe is still alive and well.
Just got the use of Arduino 3 Years ago... And this Assambly Code makes a whole lot more sense to me than what you have to deal on the Arduino IDE.. I kinda like Assambly 😁
I used to program primarily in machine code on my TI-84+ because you can type the code in hexadecimal on-calc and I didn't have a computer. I got really, really good at memorizing the addresses of all my routines. I still code this way, too, because it's just so convenient when I need to quickly test something. No compiling, no typing out so many characters to spell out one instruction, and I don't have to set up sending a binary from my computer to my calculator.
Thank you thank you, i was searching for ages for a compiler for Z80. I am remaking the z80 for college license in logisim and i was looking for a compiler so i don't program it by hand. Will be looking in the future to program it in a fpga for a more complex project. Your videos helped a lot and i must say, you are the one that made me understand and i've been searching for a while for someone. You are the best!
@@AshtonSnapp Creating our own 8bits turing machine, then creating the assembly language and the assembler for it, then creating compiler programms for it, then creating programs for it, is way easier than programing a x64 intel processor with pre-built libraries for a langage made from an other one made from an other one made from x64 assembly that we have to learn and that have no other issue than just getting the work done. Well, im a fan of homemade tech.
@@ggldmrd5583 it is like walking a road yourself from beginning to end , instead of using a map by someone else . the understanding is deeper and fuller .
It's all pretty simple, but many find it hard to grasp. Kudos to Ben for making the knowledge so accessible and easy to follow. And who would've thought the 6502 would teach people how computers work so long after it was conceived? Modern processors work in much the same way, so it's still relevant. Using Arduinos and whatnot seems like overkill, and quite wasteful to me, for small hobby projects.
One thing about the ROR and ROL instructions is that if you look one of the "on" leds seems to disappear for one rotation before reappearing on the other side. That's because ROR and ROL run the bits through the Carry 'C' flag in the processor status, acting as a "9th bit" for additions/subtractions and moving bits around. This makes it easier to chain bytes together and interpret them as a variable larger than 8 bits. If you want to leave the carry out, on the 6502 it's easy to put a CMP #$80 before the ROL instruction because this will essentially copy the highest bit to C before you rotate it back into the lowest bit.
I'm really enjoying this series. It's been making me want to look into how this is done to make my own program, maybe a 6502 emulator on an arduino for myself.
This was how us poor people, in the 1980s wrote our Z80 machine code. I was too young to afford devpac, and the ZX Spectrum +3 manual had the z80 mnemonics listed. So, I needed to do it manually. I wrote it out machine code style on paper, then put the opcode numbers next to the commands on the right and in the margin popped in the address (for jumps). Then pop them all in a data statement with a poke loop and boom. Instant program (that would often crash, but still). Yeah, it was a pain for anything remotely complicated. But, I was young so not doing anything THAT complex. I did manage a track by track disk copier though. That needed to be in machine code, because you had to swap out the basic rom, and swap in the +3DOS rom, which if you tried to do from basic, for obvious reasons would cause a pretty instantaneous crash.
2:35 lol Glossing over the "Thanks to Ben Eater for providing the Mac and Windows versions."
You're really a gem.
Ha! No joke!
Cool how high level Assembly looks right now because you got us started with just logic gates...
@pyropulse lol same
@pyropulse Now you write code for minecraft mods using abstract mathematical functions describing the behaviors of all of the electrons in your PC
Hi, i have a question for you..
How does a human being invent a new asembling language??
Let say if he does not have a second computer i.e. there are no computer at all in this world for example like alan turing.
I mean how do you define "Add" function to the computer?
If the function "add" is presumed as an individual character such that A is
equals to some number (which can be converted into binary number) let use hexadecimal for easier purpose. If A=10, D=13, D=13;
So we write it in binary:
1010, 1101 , 1101 with each the values written on the EPROM or harddisk or anything. Then, when the
user's input is like this (i.e Add), the computer will execute addition function either through programming as you've mentioned in the video, or maybe design a new logic gate??
But my main concern is that how do we reduce the memory size for each character written? i.e due to the fact that "D" character in this example is greater than "A" character because D= 13 in hexadecimal and A= 10.
How do we make all the characters on our keyboard to have same memory size when converting them into hexadecimal but still they are distinctive from each other?
Hopefully you understand my question
@pyropulse karnaugh maps
@@footballCartoon91
>Then, when the user's input is like this (i.e Add), the computer will execute addition function either through programming as you've mentioned in the video, or maybe design a new logic gate??
we don't send the ASCII representation of the instruction mnemonics to the CPU. the assembler will turn our source code (which is that ASCII plain text) into the appropriate opcode. the CPU understands this opcode because its circuits are *designed to understand it.*
remember that in memory, everything is just numbers. what matters is how the CPU treats them. it usually expects instructions, and depending on the instruction it might expect raw data. each instruction triggers the appropriate bits and logic gates to perform its function.
so to answer your question, we don't really invent an assembly language. we invent a CPU and the assembly language is a byproduct of how the CPU's circuits work.
since you mentioned the restriction of having only one computer in the world, in that case you would have to assemble the program by hand.
>But my main concern is that how do we reduce the memory size for each character written? i.e due to the fact that "D" character in this example is greater than "A" character because D= 13 in hexadecimal and A= 10.
those values still fit inside 4 bits. your main concern should be the width of the value in binary, not the value itself.
Nice little shoutout to you for Mac and Windows version :D 2:37
Should make an open source for Linux. I spoke too soon. It is ooen source....
@@rty1955 It is open source... These are just prebuilt binaries
@@dentjoener awesome. I left M$ decades ago... Its shareware at best
I don't think windows or Mac will run on a 6502.
@@rty1955 Why?? He should eventually do Eatix ;) that's the point of building your own computing system )
Graduated with a degree in Computer Engineering a few years ago and I WISH I had an instructor like this guy because I've understood more from these videos than all of my Computer Architecture classes combined!!
So true man
Agreed. Same situation for me in 1987. Too bad Ben was not my instructor.
So your computer engineering degree must be worthless then? Which college was this?
@@deang5622I mean, it’s one class out of dozens you take in college. I have the same degree (different college probably) and loved my computer architecture class, but there are other classes which had poor instruction. All college courses are hit or miss, because they’re taught mostly by researchers who just happen to be teachers. They are good researchers. There is a chance that they are good teachers. And they keep their job by doing good research, not by teaching well.
@@ckannan90 I learnt more about computer architecture than I did in my university degree by self study.
14:20 - my dad once worked on a nine-bit processor.
It was a bit much.
badum-tsss... I can imagine some dad telling this joke to a waitron and the waitron awkwardly laughing because of a possible tip at the end of the super awkward exchange.
@@spongerobert There's a nonzero chance that he did exactly that at some point. That's the sort of thing he would do.
womp womp lmao
Is your dad any good at dad jokes?
this meme was indeed kek.
Four years on and these Videos are still being found and much appreciated by the likes of me.
Thank you very much, Ben. Your Videos are THE BEST ones, to cover this topic.
What makes this channel so great and educational is that he shows the actual process of programming a chip from scratch including things like referring to the documentation and datasheets and so on. It's really helping me understand how these things work and how to work with microprocessors.
This series really shows how we're standing on the shoulders of giants when we use our PC
Or any modern science really
@pyropulse almost anyone can learn how to program computers as its not that expensive compared to doing something like learning to weld and machine or learning to fly a plane
@@loserface3962 I would have 5000x more chance of learning how to fly as opposed to learning any of the magic I'm watching right now.
@@krabsauce9792 You think that, but it's really a matter of repetition and coursework with a competent instructor.
@@krabsauce9792 what's kind of crazy is that I could read and understand what instructions the hex code were, and when he went "let's delete the #" I was "yeah, you'll get A5 instead of A9 ... because I programmed an Apple ][ in machine code without having an assembler back in 1980 when I was 17.
TL;DW: Still no "HELLO WORLD" :D
I'm sure you have this a lot, but I have to say it too: your videos are amazing! Thank you very much for doing them.
It will definitely* happen in the next video! And really, is there any reason it should take fewer than four videos to print "hello world"?
*probably
@@BenEater time in the universe is not infinite. But i like your style of taking everything slow to really make us understand the process and really making us smarter for life
A blinking LED is the "Hello World
" equivalent in the raw CPU assembly programming world. So, in some way he did it already. I wanna see his display code, though. It's always a bit of a mess in assembly.
@@BenEater thanks again, great videos, great tutor
@@BenEater yes dude, you are awesome!
I never thought Assembly would ever make sense to me, but you've explained it so clearly. I think it really helped that you did this as a series, starting with the physical pins and connections made understanding how the instructions correspond to them so much easier. This has been a really awesome series, I'mma subscribe.
I have learned more about practical digital electronics from your videos than two semesters of dedicated digital electronics labs. Thanks for all your hard work!
pyropulse
>plays minecraft
I bet you’re a subhuman with a double digit IQ that wants to look smart.
Bad labs then
@pyropulse Excuse me?
You are the only reason I'm passing my embedded systems class in college. I love you.
This is my favorite series on RUclips right now. Nothing makes me excited like seeing a new video about this 😊
yepp ... and he is not the only one on yt :)
ruclips.net/video/QgDR8LrRZhk/видео.html
@Memes On Piano It's all about the content, i.e. the music not just the piano.
"Normal people" watch Netflix or TV.
I am here watching a video series about microprocessors ...
Honestly glad we haven't reached "Hello World". That would mean we're done learning cool stuff, and who wants that!? Thanks for all your hard work.
well this didn't age well
@@matthewe3813 lol
Man I love this 6502 series. I'm currently almost finished with the 8 bit cpu (I've made some upgrades). Money definitely well spent. Thanks for all you do Ben, from your semiconductor video to this video.
Not yet, I want to finish first so I don't post anything that's broken and could mislead others
Amazing! This is when the magic disappears and instead engineering starts. Thank you, Ben, for enlightening this world! You are truly the teacher!
I haven't used zero page in close to 25 years. Nostalgia.
I love your approach in these videos so far. You always show the manual or raw way to accomplish something, and then you show another way that is more efficient or natural to accomplish the same task. ie. using labels instead of the actual hard coded address values. It makes so much sense when presented this way. I learn much faster by example, and your videos are exactly this!!!
This video series is weirdly relaxing and I appreciate it immensely.
Please keep doing video like this. I'm sure everyone is learning a lot and at this speed no beginners are left behind.
I should have learned this stuff thirty years ago. Thanks, Ben, for making it so accessible.
I've been wondering for years how the bridge between software and hardware works, and here it is, and in such an easy to follow way! Thanks so much!
@Ben Eater
You're not only exceptionally good at what you do, you're exceptionally good at explaining it too!
2:32 >thanks to Ben Eater for providing the Mac and Windows versions
Yep, thanks, when my 6502AD arrives I'll use the windows one a lot
I'm not here to learn (I write embedded software for a living), but I still enjoy watching your videos. Good stuff.
I don't do it for a living, but I've written some asm and took applied electonics classes, so I pretty much know everything he talks about, still, pretty good entertainement.
These Videos are CRAZY in the amount of complicated content, presented in a very clear way. Very well done and one thing that is making this happen is that he repeats information relatively often. But also the calm voice and the "its really easy tone". Very well done. TopNotch teaching. Coming from a fellow teacher.
These are some of the best videos I have ever seen. Organized, easy to follow, professional quality. Thank you Ben.
Back in 1985 that’s how I coded, with 6502 instruction set and paper and pencil and then typed the bytes. I had to count the bytes for the jumps by hand and if I had to jump more than 256 bytes I coded smaller jumps by hand.
We had no compiler to do that.
Did they not have assemblers back then?
@@MrSapps probably did but they were also expensive
@@MrSapps yes there was,but nobody know it was stone age. people do their own assembler or becouse they were so good on machine code they not need
PaulsMagicVideos I had the Print-out of the Apple 2 OS in the back of the Apple Manual, so I knew Assemblers existed, but we didn’t have that at school. yes, 6502 programming was a school topic in 1985! It was awesome. I met and thanked my science teacher for it 36 years later! The 6502 had a clock speed of about 961 kHz, not even 1 MHz!! We entered the bytes with a poke statement for each byte.
You want pain? Had to toggle in addresses and instructions individually on the high school's brand new PDP-11
circa '72. Big hoorays when they later that year 'upgraded' with a punched papertape reader/writer. Ah the good ol days. LOL.
I had an entire semester of 6500 training back in 1989, we built and interfaced circuits just like this. I wrote an assembler program in a relational database that was called Paradox and downloaded programs from my PC through a serial link to the processor. This brings me right back to the great times I had !
Introduction of very single new little feature of the assembler made me literally smile, bringing back memories from the mid 80s. Great lessons !
This is my new favorite channel.
This highlights both the beauty and the frustration (for me, anyway) of programming. I started out self teaching on all this at 12-13 yrs of age. This all made sense, was intensely fascinating but remembering and recalling all of the "fiddly" little quirks like the carry bit, "little" vs "big" endian etc, is what caused the frustration.....which caused me to give up programming almost before I started it. Unbeknownst to my 12-13 yr old self and parents and teachers, I had ADHD. A fact I didn't learn until I was diagnosed at age 38.
Looking at this now, knowing what I know now, considering my own neurocognitive "quirks", i'm getting tempted to dive back in. The fascination and the fact it makes perfect sense is all still alive but now I can include workarounds for the working and processing memory deficiencies (meat, not silicon) I have.
Thanks for rekindling the memory of being an enthralled kid!
I'm autistic 😅
It is so complex, with some explanations so logical yet so ground level and hard to learn. Amazing work.
It is so cool seeing you make these circuits and then programming the hardware. I took an embedded systems class last semester and we coded in HCS12 Assembly Language and it is so cool seeing everything that I learned in that class applied here.
For my machine language program I wanted to increment A from 00 to FF and send it to the LEDs. That worked, but in plain 6502 assembly there’s no INcrement A mnemonic (op code 1A). After doing a little googling I see 65C02 added a few really useful instructions beyond the MOS 6502 and vasm supports them if you add the -c02 option on the command line! Actually for this chip there’s the -wdc02 option which includes even more instructions added by WDC.
so without "INC A", you would have to write extra code? How would that look like? Just 3 lines of code?
@@SypakaADD A, 1
@@Veliki-k3i Why ask for something complex, if the solution is actually simple. I seriously forgot increasing is adding by 1..
@@SypakaAdding one to A is a good idea as has already been mentioned but depending on the scenario you might also use the X or Y register with INX and then store it with STX for example. Those registers are made specifically to be counters/indexes to increment, but if you need to do other things with that value it'll take an extra transfer.
I have little to no idea of what is going on most of the time in these videos but it's super enjoyable and I get the sense that, if I were to stay and listen for long enough, I might learn a lot!
I think the shorter but more frequent videos are better than waiting 2 months for a long one. thx :)
Nile Red needs to learn that.
What a fun way to show assembly instructions background without passing through pages of deep down content.
It seems sooo incredible today that we had learned all these stuff in the 80s without internet, without youtube...
Wish I had a teacher like you when I learned assembly!
Even though I'm neck deep in C64 assembly programming, I still enjoy your explanation. Low level is just great.
Wow, you made the mac and Windows versions of vasm! Well done!
@@tau8550 My personal question is, can Vasm be compiled without using make?
Otto Bass he just compiled the code and then uploaded the binaries.
James Nguyen Yeah. You could just execute the commands in the makefile by hand
I've been into computers for almost 15 years by now, and it's with these videos of yours, especially the bread board CPU series, that I finally get to learn how they actually work underneath all the software and hardware abstractions. Thanks a lot, this is great work!
I remember when these details were much more ‘bleeding edge’ than a walk down memory lane. I’m glad someone young is still paying attention to these details…
Congratulations teacher for this brilliant series! I have learned a lot from your videos!
The Lord has my best salute!
These LCDs are quite fun to play around with. I once made a 2x16 character display with 5x8 pixels per character draw a ping pong ball moving around pixel by pixel and bouncing off the edges as well as a small pixelated image moving across the display pixel by pixel with the 8 user-definable characters that the display offered. The assembly language is incredibly powerful once you make use of subroutines.
lol as others have already pointed out, I also smiled when I saw the thanks to you on the download link. I use vasm myself from time to time as I have a homebuilt 6502 from the late 90's that does various automation tasks that I built to replace a pic based system when it became too limiting... it used to do quite a bit from lighting to door locking and things but now it just mainly keeps plants watered... of course these days you can do plenty more and a lot quicker on a $2 arduino uno clone but back then I used to repair arcade boards when there were still plenty of arcades about I often had donor boards about and 6502s, z80s and eeproms were pretty abdundent, as well as an unbelievable amount of ttl glue logic. Kind of funny that now the technology is more available and easier to build and use the less I do :P
Hello! I am trying to do this project and vasm isn't working for me, I can't find anywhere online about how to fix this, so you are my last resort. I'm trying to compile a file but it says no input specified, I've tried everything, I am using Cygwin for windows 10 64bit, I put in the command: "./vasm6502_oldstyle -Fbin -dotdir blink.s" am I doing something wrong?
I would have never though I would be learning assembly. It’s crazy how much our compilers do for us.
Learnt more here in 15 minutes than I did in an entire term's module on Microprocessor programming at university 20 odd years ago ( I was probably hungover most of the time back then mind :D)
As a C# developer, I'm glad there are smart people like you out there who make my life much much simpler :)
I want to build 6502 computer for a competition in my school and you fell from heaven for me :D
This is the kind of thing id like to see all the kids in school doing. Would be a great thing for kids to have fun learning.
I'm so assembling this computer some time soon!
Thank you sir!
I took this course in Digital Electronics with Laboratory through Cleveland Institute of Electronics many years ago. We built a 4-bit computer for one project! We used RAM chips, switches to do addressing and a 1Hz clock (whew!!!). It had 1 kbye of memory, 2 input registers and 4 instructions: AND, OR, XOR, NOT. It did not fetch instruction and decode them though. We do that manually. It was just a tool for learning how a computer works. These kind of projects like the 6502 remind me of the good old days! I used to used the Motorola 6809e, Intel 8085, Zilog Z80 and others.
Embedded computing was a lot harder in the old days.
Today they have so many microcontroller boards that are way more powerful, cheaper and easier to use, but using them robs one of the underlying knowledge that makes it work.
I'm far too stupid to understand most of what you do, but I find it fascinating none the less. I also think it's great that you don't edit your videos to remove little things that go wrong like compiler errors, but instead show how you fixed them. Excellent stuff, keep it up!
You aren’t stupid, just un-knowledgeable. You can learn all this stuff and anything you want as long as you are willing to. I believe in you :3
In my first job, I wrote 680x assembly programs, and by wrote, I mean I had to write them down on lined paper, then write the machine code next to each line in the margin, then type all the bytes into a BBC micro which had a ROM burner attached. My biggest program was almost 8k which, for reference, is a full ring-binder worth.
You guys have it so easy these days, with your fancy assemblers!
It was a very long time ago, so I could be mistaken, but I seem to remember that BBC Basic had built-in 6502 assembler support?
@@craftsmanwoodturner - well, long answer is that we also used the (awsome) Dataman S3 programmers, and to do software updates we would call out any changed bytes on the telephone to our customer, who would be typing them into their Dataman. In order to make this work, each page of code was divided into 4 line groups, and when your code got to the end of a page (only one page allowed per subroutine!) the remaining bytes in the final group of 4 were left blank - to allow for pudent modification of that page of code without affecting any other page. An assembler *might* rearrange a whole load of other code after an update.
While a similar approach could probably have been forced with an assembler, my Boss was an eccentric PDP owner/operator, and insisted it was done this way. As a 'rookie' it certainly was a good way to learn the careful writing of code.
It's a process that younger generations might find hard to imagine!
While i would lie if i sad i would pass my computer technology class only with your videos, but those are by far the best ilustrationon of what the hell is going on:) keep up the good work i really helps me to understand it
Excellent way of teaching, please sir make some video tutorials for AVR microcontrollers in assembly. Thank for providing us such a great knowledge.
My favorite channel and content on RUclips.
Opcodes were how we did do it back in the day! Literally by writing DATA statements in BASIC, and reading those and POKE'ing the values into memory addresses. Back then we used to be able to memorize the decimal values for the opcdes (there weren't that many to memorize for the 6502).
Oh my gosh, Ben. What a cliffhanger! Your videos are simply awesome. Thank you so much.
Brings back memories of programming in assembly on old GM 6800 series car/truck ECMs from the early 80's. Kind of fun to program on since they did not require a bootable operating system like the later ones, which meant you could use them for simple control projects.
Thanks for teaching me about computers! You make everything easy to understand. Thank you.
It satisfies me so much so see your circuits. It is also the main reason why I watch your videos tbh😂😂
2:32 good on you for providing the Mac and Windows versions
boy oh boy this brought me back in the early 70's, thank you
Wow as a Kid wanted to understand assembly etc. Over time it made sense but it was always something I never fully understood. Thanks for making it clear. I wish I knew how to do Assembly programming back in the Z80 days!
These videos remind me of when I built a Z80 based computer from a kit (a complete computer with a proper video display - B&W of course - and cassette tape storage) and then entered Microsoft BASIC for the TRS-80 into it, one hexadecimal instruction at a time, saving it on tape between sessions, and finally altered it so it would run on the kit computer. That was fun.
The kit computer had a display half the size of the TRS-80 and used a different method for saving and loading on tapes and accessed the keyboard differently, so I had to alter all three of those sections of the code.
Yes, I made it work. I used it for quite a while until computers which used disk drives became affordable.
Another Ben Eater video! I'm really excited for this series of videos. I look up to your skill and ability to teach others and hope to be like you one day.
I won't lie. A large amount of what you do on your channel is way over my head but I find the content both fascinating and somewhat philosophical. I always say that computers turn stupid electricity either from a wall socket or battery into smart electricity that can dazzle our senses and create worlds and realities beyond most of our imaginations.
I often draw parallels between things that happen in everyday life like the predictable nature of my dog when I give it basic commands like sit or roll over to the pure logic nature of computers and sometimes wonder where is the 6502 chip(s) controlling my dog. It's just interesting seeing the "magic" happen bit by bit and realizing it's not magic at all but just a crap ton of very basic commands. It's really quite enlightening.
Ben
In every video you make, you blow my mind!
You have an amazing skill of explanation and you present the ideas in a great order!
For years I have been looking to understand computers, and never found nothing as clear as your videos (besides the book of J. Clark titled But how do it know).
Thank you very much!
The only RUclips notifications I'll allow
Ben: "No one actually writes software this way"
Ben moments later: "hold my beer, in my last video actually I DID write this program by writing out the machine code by hand".
I wish someone would have told me this back in the 1980s. I wrote a few video games and my own disk operating system in 6502 machine language. Yes, typing in hexadecimal. (It can be done.)
@@TheGuyThatEveryoneIgnores what a madlad
@@TheGuyThatEveryoneIgnores oh dear god
멋진 동영상입니다! US$2.00 상당의 환호를 보냅니다. 👏
It amazes me how much I enjoy watching something I'm clueless about.
I've been programming in assembler for (yikes) about 40 years.... but it's still great to watch this series and see you helping othrrs pick up my dubious habits. ;)
This takes me back. Damn do I miss those old days. This is a lot of fun.
I'll be damned: after watching the previous 2 vids, i started thinking about building a similar project, just using some things differently, such as not using the 6522 chip and such. Then, on the day i started planning it all out, you released a vid which mentions that you'll be using it to drive an LCD, which was one of the things i planned on doing once i got it running
Really fun stuff! This reminds me of my one-and-only assembly language program that I wrote for our family's Commodore VIC-20, back when I was in my teens. It just put a little Pac Man character on the screen and made his mouth open and close. Nothing thrilling, but I was stoked to have figured it out. I'm kinda wishing I'd stuck with assembly language stuff beyond that one program, but I've been coding in other languages over the years, so at least the programming vibe is still alive and well.
Can't wait to start earning and be your patron.
Thank you for everything!
This is ingeniously brilliant! Thank you for this series!
am really enjoying this walkthrough, btw - I couldn't quite convey that enthusiasm to my wife, but I think she mostly got it ... :)
Just got the use of Arduino 3 Years ago... And this Assambly Code makes a whole lot more sense to me than what you have to deal on the Arduino IDE.. I kinda like Assambly 😁
I used to program primarily in machine code on my TI-84+ because you can type the code in hexadecimal on-calc and I didn't have a computer. I got really, really good at memorizing the addresses of all my routines. I still code this way, too, because it's just so convenient when I need to quickly test something. No compiling, no typing out so many characters to spell out one instruction, and I don't have to set up sending a binary from my computer to my calculator.
Next, can you make a time machine and send these videos back to 1986? I could have really used them about that time. Still fascinating to watch.
I don't understand any of this but I find it fascinating. You are a very smart person. :)
This series is so good! This part is my favorite so far. So instructive!
Thank you thank you, i was searching for ages for a compiler for Z80. I am remaking the z80 for college license in logisim and i was looking for a compiler so i don't program it by hand. Will be looking in the future to program it in a fpga for a more complex project. Your videos helped a lot and i must say, you are the one that made me understand and i've been searching for a while for someone. You are the best!
You're a great teacher! Thanks, and well done!
Thank you Mr. Eater. Great video and I'm learning so much. I can't wait for the next one.
When someone calls Assembly language "easier"...
It’s easier than messing with raw machine code.
@@AshtonSnapp Creating our own 8bits turing machine, then creating the assembly language and the assembler for it, then creating compiler programms for it, then creating programs for it, is way easier than programing a x64 intel processor with pre-built libraries for a langage made from an other one made from an other one made from x64 assembly that we have to learn and that have no other issue than just getting the work done. Well, im a fan of homemade tech.
@@ggldmrd5583 it is like walking a road yourself from beginning to end , instead of using a map by someone else .
the understanding is deeper and fuller .
If there was a Nobel prize for just being awesome, you would easily get it!
It's all pretty simple, but many find it hard to grasp. Kudos to Ben for making the knowledge so accessible and easy to follow.
And who would've thought the 6502 would teach people how computers work so long after it was conceived? Modern processors work in much the same way, so it's still relevant. Using Arduinos and whatnot seems like overkill, and quite wasteful to me, for small hobby projects.
One thing about the ROR and ROL instructions is that if you look one of the "on" leds seems to disappear for one rotation before reappearing on the other side. That's because ROR and ROL run the bits through the Carry 'C' flag in the processor status, acting as a "9th bit" for additions/subtractions and moving bits around. This makes it easier to chain bytes together and interpret them as a variable larger than 8 bits. If you want to leave the carry out, on the 6502 it's easy to put a CMP #$80 before the ROL instruction because this will essentially copy the highest bit to C before you rotate it back into the lowest bit.
8-Bit guy has a great video on how those LCDs work
I'm really enjoying this series. It's been making me want to look into how this is done to make my own program, maybe a 6502 emulator on an arduino for myself.
14:42 "not to say that blinking leds can't be fun"
I love you.
I toggled machine code into a Dec PDP-8 long before the 6502. And wrote tons of BAL (assembly language). Things are a *lot* easier now.
I look forward to seeing the next video in this series drop, every time I get notified you have posted I can’t wait to check it out.
This was how us poor people, in the 1980s wrote our Z80 machine code. I was too young to afford devpac, and the ZX Spectrum +3 manual had the z80 mnemonics listed. So, I needed to do it manually.
I wrote it out machine code style on paper, then put the opcode numbers next to the commands on the right and in the margin popped in the address (for jumps). Then pop them all in a data statement with a poke loop and boom. Instant program (that would often crash, but still).
Yeah, it was a pain for anything remotely complicated. But, I was young so not doing anything THAT complex.
I did manage a track by track disk copier though. That needed to be in machine code, because you had to swap out the basic rom, and swap in the +3DOS rom, which if you tried to do from basic, for obvious reasons would cause a pretty instantaneous crash.
This guys was born with a breadboard in hand, never seen someone going to much into machine level details