27c3: Reverse Engineering the MOS 6502 CPU (en)

  Рет қаралды 442,877

Christiaan008

Christiaan008

Күн бұрын

Пікірлер: 527
@benjaminramsey4695
@benjaminramsey4695 5 жыл бұрын
Holy cow. I feel like those guys in the 70's were pure geniuses and are producing technology that is science fiction to my brain today.
@pilotavery
@pilotavery 5 жыл бұрын
Yeah they were... Apollo missions were pure genius. Transistors. And lately, software.
@milanstevic8424
@milanstevic8424 5 жыл бұрын
it's not that they were geniuses, it's that today's people are dumbasses. seriously if you just compare the movies at the end of the 70's with the movies from the beginning of the 80's, there is a rapid decline in intelligence. and don't get me started with the music. yes there were notable exceptions, but I'm talking about the majority here. also, when we're comparing, it is important to notice that certain gems were not seen as such at the time, for example, the original Bladerunner (1982) was a complete flop in the box office, even though today it's considered one of the best movies ever made. my theory is that this effect is due to baby boomers becoming a dominant adult generation. as they were born in the 50's and onward, they started entering their 30's during the 80's, and by that time, for some reason, they were as dumb as it gets (at least when compared with their predecessors). I include my own parents there, even though they were exceptional for the times -- my father was a big fan of the microchip era, and even assembled a computer in the early 80's, but in the mid-90's it was already above his head, he simply couldn't grasp the reality of it (especially the software), and stuck to the hardware reselling, because as personal computers flooded the market, plenty of even dumber people wanted one for themselves.
@jaleger2295
@jaleger2295 5 жыл бұрын
@@milanstevic8424 this might be the cringiest comment I've seen in like 20 years of internet
@milanstevic8424
@milanstevic8424 5 жыл бұрын
@@jaleger2295 yeah? what is so cringy about it? you must be a millenial dumbass if you're really feeling it, but then you couldn't have really seen the internet 20 years ago, so I'm not sure what's your case. because man, if you're caught in the middle, like the 80's generations, you're a victim as well of being sandwiched by the retards, and are probably struggling with your emotional health. I just don't see why would you find my comment cringy then.
@thomasmacdonald466
@thomasmacdonald466 5 жыл бұрын
There's some amazing science fiction today, particularly in the physics field!
@Adamchevy
@Adamchevy 5 жыл бұрын
I watch this about three times a year. It’s one of the best talks on the 6502 ever done. It inspired me to study assembly.
@GodzillaGoesGaga
@GodzillaGoesGaga 5 жыл бұрын
It's probably the best way to understand how a microprocessor works. I had the Rodney Zaks 6502 book with me all through the 80's !!
@AlanCanon2222
@AlanCanon2222 3 жыл бұрын
Same here. I was 14 when I got my Commodore 64, and when I read the assembly language book that everyone bought for it, it was such an eye opener. You read through all the instructions and at the end, it's like, "That's it?! That's all there is to it?!" The beauty of learning such a simple, middle of the road instruction set like 6502 is that, unless Assembly is going to be your main career jam, virtually every paper you ever want to read on Assembly becomes comprehensible, even if you don't know much about the architecture that is the platform of choice for the paper: everything you read is pretty much translatable into 6502 terms (RISC and microcode experts will slaughter me in the replies, of course).
@RogerBarraud
@RogerBarraud 2 жыл бұрын
@@GodzillaGoesGaga Sybex books - I had 2 or 3 of them, the editing was terrible and the contents were ore or less thrown together; despite that they were worth having and I learned a lot from them. Thanks Rodnay [sic] !
@marcel151
@marcel151 Жыл бұрын
You'll love Ben Eater's 6502 series then.
@joestitz539
@joestitz539 Жыл бұрын
​@@GodzillaGoesGagaok cool. Yet how did this come from the more simple computer used on apollo ?
@63801170
@63801170 Жыл бұрын
Just finishing up the Ben Eater series on the 8 bit breadboard computer... and wow! I started this 6502 video years ago and was like "woops! what have I stumbled into here...". Now, after Ben's instructional videos, I could actually keep up with this presentation and it was making a lot more sense. Thanks Ben, and Michael (and 6502 team).
@jsmythib
@jsmythib Жыл бұрын
I ended up building my own custom sap1 after watching Bens series. I finally understand. The 6502 is a logical next step :)
@thecobrabuildchannel5795
@thecobrabuildchannel5795 10 жыл бұрын
The 6502 was the very first processor I programmed back in the early 80's. This was a fascinating presentation, well done!
@edgeeffect
@edgeeffect 8 жыл бұрын
+The Cobra Build Channel I did Z80 first and, because it's got more registers and "clever" instructions, I thought it was better for years... But the 6502 has won my heart over with it's simplicity in recent years.
@kaylaandjimbryant8258
@kaylaandjimbryant8258 7 жыл бұрын
VIC-20 FOREVER!
@trollobite1629
@trollobite1629 5 жыл бұрын
@@edgeeffect All these years on and it's still 6502 VS the mighty Z80 😁 who would have thought it.
@allancopland1768
@allancopland1768 3 жыл бұрын
Same here. Still using a BBC Master128 here, updated with MicroSD for storage.
@jarleinar
@jarleinar 7 жыл бұрын
"65312 views"... only 224 views left before the counter rolls back to zero!
@roger58679
@roger58679 5 жыл бұрын
It's 8 bits, so the counter had already rolled back to zero 255 times and was currently at 32 by the time you made your comment.
@-Jakob-
@-Jakob- 5 жыл бұрын
@@roger58679 no, views is about addresses.
@AlanCanon2222
@AlanCanon2222 4 жыл бұрын
@Dr. M. H. Yes, we saw the Carry flag was set! :)
@paulkocyla1343
@paulkocyla1343 3 жыл бұрын
Few years later - it made my day. Thanx :)
@giubin
@giubin 3 жыл бұрын
Ahahahaaha
@abstractobject5337
@abstractobject5337 Жыл бұрын
In the eighties, while in elementary school, I had the VIC-20, C64, 128, and about 3 1541 drives. I programmed in assembly and BASIC, cracking protection schemes, and doing all sort of reverse engineering. I was a better programmer using the C64, as a kid than I am now. I can really say after all of these years, I never really needed job training. The C64 taught me much of what Ive needed to know during my entire career.
@ulrichkliegis4138
@ulrichkliegis4138 2 жыл бұрын
I remember a short personal meeting with Chuck Peddle, the 6502's developer, at a Hannover fair at the MOS technology booth. Chuck was an absolutely modest man. We discussed a few application questions, and yes, he knew every transistor by its first name...
@RogerBarraud
@RogerBarraud 2 жыл бұрын
They were all called Trev.
@johndododoe1411
@johndododoe1411 Жыл бұрын
I guess their last names were all Peddle, because they were his children.
@Fancy.Diffusion
@Fancy.Diffusion Жыл бұрын
Very interesting and awesome work. I loved coding for the 6502 in assembly language in the 80s ❤
@rogerfroud300
@rogerfroud300 3 жыл бұрын
I've written huge amounts of 6502 assembler, but never seen exactly how it works before. I'm staggered at how much complex behavour was achieved with so few transistors. I guess the real power here is in the way the internal ROM sequences the operations cycle by cycle. I can now see how you can easily implement something like this in a FPGA. I'm amazed that so many people thought it was worth the effort of reverse engineering an obsolete processor. I'm glad they did though, that was fascinating.
@shinyhappyrem8728
@shinyhappyrem8728 3 жыл бұрын
They do it for the games/software... and for the challenge itself of course.
@markhonea2461
@markhonea2461 Жыл бұрын
This is the highest level of forensics I have been witness to and it is most intriguing! My thanks to all who put forth effort for this presentation, and especially the humble contributor in Hungary for piecing together that transistor sheet!👍👍
@zetacon4
@zetacon4 7 жыл бұрын
Absolutely wonderful presentation! This sure brought back many wonderful memories for me. I cut my Assembly programming teeth working with the 4004 cpu chip. It was one of the many simple experimenting boards available in 1980 and I actually used some discrete IC components along with an oscilloscope to program a simple game using the scope as a display. That was so much fun. It is amazing what you can do with 4k of 8-bit ram and 1 megahertz clock speed for the cpu. I still have to laugh remembering playing with that simple board. The programming was done on a alpha-numeric keypad using 6 digits of LED display for data and address info. Simply amazing. I went on to program for many cpu models of that time. It started my career as a database designer and programmer for businesses.
@RogerBarraud
@RogerBarraud 2 жыл бұрын
Sounds like an awful choice for 1980 ... there were for example the Motorola D2 kit and the KIM-1, SYM-1, AIM-65 (in order of increasing fancy + expensive), as well as more thoroughgoing machines like the Little Big Board (CP/M) and of course the Apple ][ was about 4 years old by that stage.
@RogerBarraud
@RogerBarraud 2 жыл бұрын
If you were a masochist you could have at least gone for a SC/MP or CDP1802 ;-)
@kgtuuhffmkk8907
@kgtuuhffmkk8907 Жыл бұрын
The first 4-bit processor! I've never used it - I only knew Z80A and 6502 - but I always wanted to try one.
@cyrillebournival2328
@cyrillebournival2328 3 жыл бұрын
When you first watch this you are like "ok, this guy is from another planet". After watching Ben Eater series on how to build a 6502 computer from scratch this becomes alot more clear.
@iAPX432
@iAPX432 Жыл бұрын
Great work! As I began assembly and machine-language code in the late 70's, I could totally appreciate what is done here and the importance to keep what is not only a bunch of transistors but also art for me...
@edgeeffect
@edgeeffect 8 жыл бұрын
It's like digital archaeology, isn't it.
@digitalarchaeologist5102
@digitalarchaeologist5102 5 жыл бұрын
Yes!!
@dimicdragan5922
@dimicdragan5922 4 жыл бұрын
But it is still very much used today, the 6502...
@2Worlds_and_InBetween
@2Worlds_and_InBetween 3 жыл бұрын
err excuse me
@ChairmanMeow1
@ChairmanMeow1 3 жыл бұрын
thats a great way to put it. but the 6502 and Zilog z80 are even used in some applications today!!
@RogerBarraud
@RogerBarraud 2 жыл бұрын
Exactly that.
@basheyev
@basheyev 3 жыл бұрын
Simulation of CPU on physical level is insanely precise simulation with all undocumented features and hardware bugs. Awesome! 😍
@BT-kf4kx
@BT-kf4kx 4 жыл бұрын
it is fascinating how people can wrap their head around this, super smart!
@jselectronics8215
@jselectronics8215 Жыл бұрын
I was a technician at CalComp in the early '70's. They made plotters. One of the test plots we would run was called "IC Mask on Strippable Film".
@DucatiMTS1200
@DucatiMTS1200 Жыл бұрын
The Zilog Z80 4MHz processor was the first processor I programmed back in the early 80's age 23 yrs. using assembly language . No assembler used - just machine code written from my head in memorised hex numbers to system EPROM. Seems to be a mind blowing task now but if you are determined and interested you will acquire the knowledge to let you create a program that executes with the minimum number of clock cycles. This is a great presentation going down into the 6502 and full credit to Mike - most impressive. I preferred the Z80 because of the linear address bus. Thanks for sharing this video and reminding me of the mnemonics.
@johndododoe1411
@johndododoe1411 Жыл бұрын
What was the 6502 bus like?
@herrbonk3635
@herrbonk3635 Жыл бұрын
@@johndododoe1411 It was just as "linear". But the 6502 was more byte-oriented in its addressing modes and sometimes took an extra cycle when crossing 256 bytes boundaries. The Z80 was faster though, despite what 6502 fans will tell you ;-) Especially so on code that had to deal with larger numerical quantities than single byte numbers, such as floating point.
@johndododoe1411
@johndododoe1411 Жыл бұрын
@@herrbonk3635 I wasn't asking about speed or efficiency. More about the kind of complexity that plagued the 8080 bus compared to the Z80 simplicity.
@herrbonk3635
@herrbonk3635 Жыл бұрын
@@johndododoe1411 Ok. Yes the 8080 had status signals multiplexed onto the data bus. But that wasn't a plague really, pretty simple to interface (although more involved than on the Z80). The later 8086/88 had multiplexed adddress and data on the same bus though, which was a little worse, and it also slowed these chips down somewhat. The 6502 didn't have any off that, but was instead slowed down by it's primitive and pretty unreliable (among chip versions from different manufacturers) memory access method that tended tp lock it into low clock speeds compared to a Z80 or 8088. The latter two would do stuff internally while waiting for memory response for two full cycles, while the 6502 just issued a short pulse (approx 30% to 60% of a clock pulse) and assumed the memory was fast enough.
@deang5622
@deang5622 6 ай бұрын
​@@herrbonk3635Different maximum clock speeds, different numbers of clock cycles per instruction. Very different architectures. Very hard to make comparisons of the form you are making. Performance comparisons need to be done by writing programs in each processor's assembly language to perform the same function.
@ReinkeDK
@ReinkeDK 5 жыл бұрын
Really enjoyd watching this. Have been doing a lot of assembler work on the 6502 and 6510 many many years ago. Good work!
@thepumpkingking8339
@thepumpkingking8339 10 жыл бұрын
Not being a coder. Most of this was way above my Head. But the Nerd in me stuck it out to the end and enjoyed ever minute of the presentation.
@Shockszzbyyous
@Shockszzbyyous 9 жыл бұрын
+The Pumpking King you don't have to be a coder to understand.
@the-bgrspot6997
@the-bgrspot6997 8 жыл бұрын
you have to be an engineer....
@MohHabbi
@MohHabbi 7 жыл бұрын
same here. I think those people came out of the outer space man!!!
@deusvult5738
@deusvult5738 6 жыл бұрын
learn assembly. he does not explain it in full detail. if you learn assembly and computer architecture you would understand this completely.
@pugpugpugs5382
@pugpugpugs5382 5 жыл бұрын
@Dmitriy Getman Meh, you're about halfway there with C. Helps a lot to fool with asm a bit.
@monchytales6857
@monchytales6857 2 жыл бұрын
this was so fundamentally useful for my 6502 emulator you have no idea
@kiddcode2848
@kiddcode2848 8 жыл бұрын
These slide transitions are awesome!
@scientious
@scientious Жыл бұрын
Oddly enough, this will be more relevant in the future.
@BobDiaz123
@BobDiaz123 7 жыл бұрын
I enjoy the kind of firepower we have with today's processors, but I do miss the simplicity of the early processors and computers. Programming the 6502 in assembly on my Apple II was a ball.
@kuzadupa185
@kuzadupa185 2 жыл бұрын
The limitations forced many first time programmers to not only dive into the more obscure instruction sets but did their best to get creative on using those instructions to do what they wanted, regardless how impossible it may seem.
@RogerBarraud
@RogerBarraud 2 жыл бұрын
@@kuzadupa185 Very much so. There was a series (maybe more than one series) in Creative Computing aroung 1984 or so on 6502 ASM tricks for making games faster (sprite movement, e.g.). Brilliant stuff. I think John Carmack said he learned to be clever from 6502 constraints.
@kuzadupa185
@kuzadupa185 2 жыл бұрын
@@RogerBarraud thanks for reply/info, going to check it out but was hoping you knew of any good books or even videos/movies, that speak about this topic???
@jackevans2386
@jackevans2386 2 жыл бұрын
Having learnt assembly language on the VIC-20's 6502 and then Atari ST's 68000, it set me up to program microcontrollers when they arrived on the scene. So easy to learn assembly language for any micro, once the principles are embedded (NPI) in your brain.
@prydin
@prydin 5 жыл бұрын
You sir, are one cool geek! I loved this video!
@ChrisWalshZX
@ChrisWalshZX 8 жыл бұрын
Come from a Z80 background but this presentation was excellent. great work guys! 😁
@0623kaboom
@0623kaboom 5 жыл бұрын
done them BOTH the 6502 and z80 ... I miss the good ole days of dealing with limited space and actually having to worry about every single cycle to get the most bang out of the program ....
@johnmarks714
@johnmarks714 3 жыл бұрын
He should do the Z80
@herrbonk3635
@herrbonk3635 Жыл бұрын
@@johnmarks714 Yes, then he would probably also learn how it works. (Which he clearly didn't understand at this point.)
@niks660097
@niks660097 2 жыл бұрын
25:37 damn boi that's some hardcore dedication right there...
@konsul2006
@konsul2006 8 жыл бұрын
cpu architecture archaeology?
@greggsenne1268
@greggsenne1268 7 ай бұрын
I'm new to the 6502. The more I learn about it, the more I love it.
@tomkirbygreen
@tomkirbygreen 4 жыл бұрын
Magic. Thank you to all involved for the engineering love and effort.
@oobtim7862
@oobtim7862 Жыл бұрын
I think the Hungarian guy Balaz (25:00) has got to be given an award for what he did drawing those transistors!
@gwenynorisu6883
@gwenynorisu6883 6 жыл бұрын
Be interesting when we get through to the 68000... and all its descendants. Including maybe finally figuring out what the key differences between the original and the HC model, plus all the embedded versions are, that make them act in subtly different ways that are not only a headache for emulation, but also if you try to use a "real" later processor in an updated / repaired version of a classic machine (and in at least one case, vice versa). They do occasionally burn out, after all. ...and that, in essence, is why this work is so valuable. Microprocessors aren't immortal. Like any electronic component, they gradually wear down. As seen with overwrought GPUs used for bitcoin mining. It just takes the older ones a bit longer, much like a low wattage light bulb, as their traces are larger and clock speeds / TDPs are lower. But they will, some day, all die. So if we want to keep the memory alive, and be able to run the old software faithfully, we need to encode their behaviour before it's too late. On which note: there may not be much interest or even value in bothering with this for the x86 line at the moment (though the older chips do have some quirks not replicated in their modern evolutions), but presumably another branch of this project must involve the 8080 and 8085? There are a number of really old classic machines (including a lot of CP/M workhorses, and the original Space Invaders...) that used them, before the 6502 and Z80 (itself a modified clone of the 8080 the same as the 6502 was a modified clone of the 6800). Maybe even the 4004, 4040 and 8008, but I think Intel might actually have released the schematics for those already as part of their 40th anniversary celebrations... Oh, and of course, the 6800 and its variants. It doesn't get as much love as the others, but that processor line was still used in an awful lot of computers and other hardware.
@johndododoe1411
@johndododoe1411 Жыл бұрын
For the surviving companies, publicatiom of older internal documents and interaction with surviving original engineers would be another avenue. Maybe one day we'll see a full explanation of design differences between 80186 and 8086 handling of common instructions. Or full docs on the original AMD CPUs from the 1970s.
@AlyseThuente
@AlyseThuente Жыл бұрын
I learned assembly back in 1983 on my Atari 400 with the 6502. Cool stuff. I love the Bender and T-800 references! I had not seen those before.
@SyntheToonz
@SyntheToonz 4 жыл бұрын
I still love writing 6502 Assembly on the Atari 8-bit computers.
@magnuspihl6974
@magnuspihl6974 3 жыл бұрын
Very impressive work behind this!
@rabidbigdog
@rabidbigdog 5 жыл бұрын
This is clearly the best talk ever provided in the history of mankind.
@bierundkippen720
@bierundkippen720 5 жыл бұрын
Nope. Too fast.
@cbnewham5633
@cbnewham5633 4 жыл бұрын
Wow. I designed and hand coded an english language interpreter in 6502 code in 1987. Brings back lots of memories.
@johnmarks714
@johnmarks714 3 жыл бұрын
Where can i see it?
@keithedwards1424
@keithedwards1424 2 жыл бұрын
It's easy to miss what happens with the 'WAIT6502,1" command at 16:38 because it's natural to be looking at the bottom line of the screen, but the top line of the screen changes from 'Commodore Basic' to 'Microsoft'.
@bozimmerman
@bozimmerman 2 жыл бұрын
Thanks Keith -- that's a good comment to add here. Usually we do something like WAIT6502,10 which prints it 10 times and is much more obvious.
@TheUtuber999
@TheUtuber999 Жыл бұрын
This is too funny - almost like Bill Gates pieing someone in the face years before being on the receiving end. I never owned a Commodore PET myself, having started with a C64, but able to see this effect when configuring Vice for the PET 3008 under model settings. 😁
@RobertHurst
@RobertHurst 14 жыл бұрын
Simply a cool project and presentation of it.
@balazskecskemeti
@balazskecskemeti 5 жыл бұрын
"utasításdekódolónak" = "for the instruction decoder"
@thepetyo
@thepetyo 5 жыл бұрын
Would be good to know who was the Balázs mentioned in the talk. He is my hero! Is it you?
@stanrogers5613
@stanrogers5613 3 жыл бұрын
@mr.1n5an_e It's not so much that "they have a word for that", but the way the language/grammar works means that a lot of what you might think of as separate words become just parts of a word.
@paulkocyla1343
@paulkocyla1343 3 жыл бұрын
It´s just scarily genious to make such a CPU with only 3510 transistors. And it´s same as genious to get it back onto "paper". I knee down to the gods.
@ErwinSchrodinger64
@ErwinSchrodinger64 2 жыл бұрын
Wait a minute. Wasn't this inside my Nintendo Entertainment System?
@meakaki
@meakaki 2 ай бұрын
Yup!!!
@3fsdfsfs
@3fsdfsfs 9 жыл бұрын
Brilliant. Now, please, do the 68k. It is only 20 times more complex. :)
@jlinkels
@jlinkels 5 жыл бұрын
The most beautiful processor of that time. By comparison the 8086 had a hopelessly non-orthogonal instruction set, limited addressing and was only 16 bits.
@johnmarks714
@johnmarks714 3 жыл бұрын
Agreed
@packratswhatif.3990
@packratswhatif.3990 5 жыл бұрын
Would love to hear the story of the 6502 from one (or more) of the designers ... a great history lesson. Can not imagine the work and effort that was put into this cpu design ..... WOW factor !
@0623kaboom
@0623kaboom 5 жыл бұрын
watch the Apollo computer rebuild ...and check out the memory cores ... THAT was only a few years before the 6502 ... and BASIC was mid 60's .... then we got the 6502 and z80
@CurrentlyObsessively
@CurrentlyObsessively 3 жыл бұрын
Bill Gates had them all killed so that he could ensure a society where nobody knew but him.
@kentbetts
@kentbetts 5 жыл бұрын
The 6502 also powered a renaissance of pinball games in the 1980s, very nicely engineered, from Bally and others IIRC. Eight Ball, Bally, 1981 as an example.
@edgeeffect
@edgeeffect 8 жыл бұрын
the original designers of ARM were all 6502 fan boys.
@herrfriberger5
@herrfriberger5 8 жыл бұрын
They were hardware designers and 6502 coders who needed something better for their next project. They were partly influcenced by the 6502 implementation though, after visiting Bill Mensch and Western Design Center.
@Margarinetaylorgrease
@Margarinetaylorgrease 6 жыл бұрын
You assumed gender.
@GerbenWijnja
@GerbenWijnja 5 жыл бұрын
@@Margarinetaylorgrease and?
@Margarinetaylorgrease
@Margarinetaylorgrease 5 жыл бұрын
One of them is called Sophie
@0toleranz
@0toleranz 5 жыл бұрын
stuart jarvis yes she‘s a great hardware/software engineer, but back then was still Roger Wilson...
@wolverine9632
@wolverine9632 7 жыл бұрын
Fascinating stuff! I always wanted to know why there were illegal opcodes for LAX and SAX, but not LAY, SXY, etc.
@mumblic
@mumblic 8 жыл бұрын
Wow Great presentation What I don't understand is that the original schematics and designs can't be found anymore. Has really somebody destroyed all these. They should be hang in a museum!
@hanniffydinn6019
@hanniffydinn6019 7 жыл бұрын
Mum Blic you can download them, I did ages ago.
@mumblic
@mumblic 7 жыл бұрын
Hanniffy Dinn That would be strange! Why would those guys do all that work if the schematic is available on the internet Are you really talking about the internals off the 6502? Have you seen the video.
@hanniffydinn6019
@hanniffydinn6019 7 жыл бұрын
BOOZE & METAL no the schematics for 6502 have been available for decades. There is plenty of VLSI EDA free software you can download ( magic , icarus, klayout etc..) and you can easily find the oasis gda vector files for the 6502 and view them. Just search! The 6502 is so iconic it's the first thing I downloaded and viewed ages ago in a VLSI program. This 6502 project is like the huge 6502 maker project, it's just people doing things the hard way because they can for the lolz.
@mumblic
@mumblic 7 жыл бұрын
Hanniffy Dinn I think your are confusing some things. Those VSLI designs are functional (nearly) compatible designs, not really the same as the true internals of the 6502. I'm not a CPU architect, but I'm quite sure you can build the functionality of a 6502 in many different ways. Have you seen the video. Because they proofed that the internal design was clearly different then they had expected. What I was talking about was the original design, not somebodies interpretation!
@hanniffydinn6019
@hanniffydinn6019 7 жыл бұрын
Mum Blic What the fuck are you rambling about? I have the ORIGINAL 6502 design files on my hard drive. The 6502 is extremely well known and used. It's not a mystery fuckface it NEVER was.
@AlanCanon2222
@AlanCanon2222 4 жыл бұрын
So many happy memories of poring over the Assembly manual for the Commodore 64, using BASIC to hand-assemble enough 6502 in memory to count to 10... I felt like a 14 year old god.
@AlanCanon2222
@AlanCanon2222 3 жыл бұрын
@The programming crypto guy Sure! Whatever comes to hand. I recently worked with Richard Dawkins translating some old Pascal programs of his into first Java and then JavaScript.
@AlanCanon2222
@AlanCanon2222 3 жыл бұрын
@The programming crypto guy Very good! Learning the 6502 was weird, because once I cracked the basic instruction set and addressing modes, and the stack concept, it was astronishing: THAT'S ALL THERE IS? But, yeah. A Turing machine made out of 1500 transistors or whatever it is. I swear it felt as if one had pulled the sword from the stone. (Or met the monolith, I was a teenage 2001 fan).
@fdk7014
@fdk7014 5 жыл бұрын
Wow! Really in-depth but super interesting!
@ramakrishnamishra8179
@ramakrishnamishra8179 3 жыл бұрын
Oh the MOS 6502 CPU!! How it captures everyone's imagination!!
@davidl5786
@davidl5786 2 жыл бұрын
I think that every IT class should start fr 6502 and his assembly
@jhonbrayanangaritamedina1047
@jhonbrayanangaritamedina1047 Жыл бұрын
11:53 This is the indirect X addressing mode
@dbingamon
@dbingamon 2 жыл бұрын
I recognized 6502 Assembly code that was read in hexadecimal on a Doctor Who episode for one of the computers that controlled time.
@deang5622
@deang5622 6 ай бұрын
It was also the text on screen when looking through the eyes of the Terminator in the first Terminator movie with Arnold Schwarzenegger. The screen would turn red and contain white text that was flashed up rapidly.
@johnmurphy5428
@johnmurphy5428 4 жыл бұрын
This is a great example for both the debilitating approaches toward building A.I. and the solution therein. -merfthewise
@bsdetector6908
@bsdetector6908 2 жыл бұрын
I had a C64 and learned assembly language. I never bothered learning the hardware implementation (note: I don't mean things like VIC 2 sprites, charset and sound, to use the C64 you *needed* to know them, I'm talking about the silicon itself - gates, delidded chips etc. The literal black boxes on the motherboard) 40 years on I am interested...
@storerestore
@storerestore 3 жыл бұрын
Re: the ALU being pretty standard: The 6502 ALU design actually resulted in a patent related to how its decimal mode. Other CPUs at the time rather had a "decimal adjust" instruction that would adjust the result of and addition/subtraction based on the carry and half-carry into packed BCD. The 6502 instead had a flag which would cause the ALU to do this automatically, hence there's no half-carry flag exposed on the 6502. That it was patented is also likely the reason this mode was missing from the 6502 clone in the NES 2A03. By omitting it, they'd avoid infringing on the patent.
@herrbonk3635
@herrbonk3635 Жыл бұрын
The 6502 ALU certainly has some quirks, but it's very standard compared to the Z80. Same with the sequencing, register latches and other details. See Ken Schriffs blog posts on these chips!
@fuanka1724
@fuanka1724 7 жыл бұрын
Fantastic presentation!
5 жыл бұрын
BCD was meant to improve number calculation, avoiding the problems of rounding, it's designed for money and financial calculations.
@messupfreq550
@messupfreq550 5 жыл бұрын
People forget about memory constraints (not cheap and not small) and a float point package is not exactly tiny, whereas Binary Coded Decimal made it much easier as long as you paid attention to the half carry bit (for the young-uns, sometimes you needed to test it other times make sure it was zero before starting a new calc) and where the decimal point needed to be. Ahhh those were the days...
@johnrehwinkel7241
@johnrehwinkel7241 5 жыл бұрын
The Atari 400/800 BASIC did its math in BCD mode (as BASIC implementations go, it's a very nice BASIC). It was pretty slow but very accurate. I think they used a polynomial expansion for trig functions, so a sine would take a noticeable fraction of a second to compute.
@cigmorfil4101
@cigmorfil4101 3 жыл бұрын
@@messupfreq550 Except the 6502 used a patented method to actually do BCD adds and subtracts without the programmer needing to worry about the half carry bit, nor decimal adjusting the value afterwards. Annoyingly the D flag wasn't removed on an interrupt which meant the interrupt handler had to clear it using an extra 2 cycles each interrupt if it intended to do some ADCs or SBCs.
@mikecimerian6913
@mikecimerian6913 5 жыл бұрын
The 6502 was used on the Commodore Vic 20. It introduced me to machine code.
@0623kaboom
@0623kaboom 5 жыл бұрын
if you had the assembler add on it was a 68k ... ;)
@MolecularArts
@MolecularArts 4 жыл бұрын
I wonder if Chuck Peddle got to see any of this work before he passed away in 2019.
@enoz.j3506
@enoz.j3506 2 жыл бұрын
My first computerwas a UK101,6502 based kit,cost about £325 with an 8k upgrade.This was around 1978-79 i think.
@dustypulver1
@dustypulver1 Жыл бұрын
The UK101 was marketed by Caroline Radio D J Spangles Muldoon.
@fahmidanial
@fahmidanial 2 жыл бұрын
Interesting talk!
@pilotavery
@pilotavery 5 жыл бұрын
Right at 25:40 everyone went crazy
@ronnetgrazer362
@ronnetgrazer362 5 жыл бұрын
That was a mass nerdgasm if I ever heard one. And rightfully so!
@dazmatic
@dazmatic 3 жыл бұрын
Captions at 0:30 "I hand you over to my hairstyle". I LOLed a bit.
@johnmarks714
@johnmarks714 3 жыл бұрын
Lol turned on the captions just to see it
@Roxor128
@Roxor128 2 жыл бұрын
I would love to see something like this for the 8088, as a step towards a Visual IBM PC. Simulating things like floppy drives and CRT monitors in the same kind of detail as the chips might be too much of a stretch, though.
@dandyroth
@dandyroth 3 жыл бұрын
Can anyone explain the white and black dashes and dots in the very top left? You see it so often with analog capture equipment yet I can't for the life of me figure out what causes it...
@johndododoe1411
@johndododoe1411 Жыл бұрын
It's accidental capture of metadata transmitted during the vertical blanking interval. Or maybe it's accidental capture of sync patterns in that blanking interval.
@count69
@count69 5 жыл бұрын
Okay KZbin I'll watch the video! If I watch it will you stop recommending it to me?!?
@janbrittenson210
@janbrittenson210 5 жыл бұрын
Does the $00 IR injection on IRQ really cause BRK not to work on interrupt? I'd assume the PC doesn't get incremented on that fetch, so when the handler returns it would refetch the BRK instruction and execute it. It would seem a more plausible explanation is that the RTI doesn't reenable interrupts until after the next instruction following the return has been executed, so it always executes at least one instruction with interrupts disabled on return. With interrupts disabled, BRK becomes a no-op. Just guessing here, but P comes off the stack last, after the PC which points to the BRK in the instruction flow. Then the S (?) bus gets latched into P while the BRK instruction is latched into IR due to the T-state overlap. Again, just guessing.
@shinyhappyrem8728
@shinyhappyrem8728 3 жыл бұрын
The CMOS versions of the 6502 had that bug fixed, afaik.
@ChaosHusky
@ChaosHusky 2 жыл бұрын
Ahh..takes me back to the Commodore/Sinclair days.. I guess i was lucky to get 'hand-me-downs' of all the old computers when my uncle/dad/etc upgraded or got a new machine, i got the old one! Got to play with a 6502, Z80 and 68K! :D
@skilz8098
@skilz8098 5 жыл бұрын
31:38 What do you do if you want something slower? Write it in JavaScript! I find that hilarious as I prefer to use C or C++!
@hasenhirn1965
@hasenhirn1965 5 жыл бұрын
The sketch with Bender and Flexo are great xD
@redlab3488
@redlab3488 4 жыл бұрын
Super presentation. I really like the contents and the material. I 'd like to know how the presentation material was built. It's so video like. What software was used ? And especially what is this video (?) font ?
@johnmarks714
@johnmarks714 3 жыл бұрын
Me too
@henrikvendelbo1117
@henrikvendelbo1117 3 жыл бұрын
Bcd benefit is that manipulation never produces bad rounding results, unlike float. Good for accounting
@JohnJTraston
@JohnJTraston 5 ай бұрын
What rounding? There are all integer operations. Not floating points.
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 3 ай бұрын
@@JohnJTrastonmaybe some people don’t store cents , but try to store € or $ ? And they don’t know about OOP which would hide the 100 from them. So are lazy like JS and use floats. String Currency
@moeshouse575
@moeshouse575 5 жыл бұрын
OH OH OH STOP IT. my head hurts. iam going back to carburetors.
@TheGoodChap
@TheGoodChap 11 жыл бұрын
because it's historical and nobody has been 100% sure how it works (hardware engineers and programmers would be interested in knowing) plus many people still play nes games on emulators or write emulators as a hobby and knowing how it works can make better emulators.
@acmenipponair
@acmenipponair 5 жыл бұрын
I guess, even the producers themselves didn't knew all of the chips behaviour. otherwise they would have for example tried to mask the KIL instructions and not just left it out of documentation ;)
@0623kaboom
@0623kaboom 5 жыл бұрын
actually if you were old and young enough back in the 60's and 70's this stuff is all old hat the people who are doing the archeology these days werent born then ...
@0623kaboom
@0623kaboom 5 жыл бұрын
@@acmenipponair you bet your buttocks they did ... the reason for the kills and all the undefined ops were for testing purposes and optomisations ... they kept them seperate to avoid various problems like emf cross talk ...on a trace ... or the activity of one transistor causing another unconnected one to see enough leak voltage to actually enable .. and add in the good ole boy resonance ... yup that sucker was a PAIN in the butt to keep to a minimum in places where you need resistors and capacitors BUT had long traces and transistors in the same areas ... these things would and still do give false positives ...
@marc.lepage
@marc.lepage 3 жыл бұрын
Great talk, thanks!
@KuraIthys
@KuraIthys 7 жыл бұрын
This is fascinating. For practical reasons I'd like to know what the 65c816 does... (trying to work out the snes, basically) But I guess that will take a while. Obviously, it derives from the 65c02, which is implied in the name, and while that undoubtedly differs from the original (that's even documented in the programming guide), we also know of course that there are no illegal opcodes in 16 bit native mode, and that in emulation mode all illegal opcodes equate to 'no op'. But how does it vary and build on the 65c02 exactly? Does it effectively contain an entire 65c02 and then additional components? Or is it actually quite different internally and just pretends to be like a 6502 through the way the external logic is set up? I guess having a 6502 emulator that is 100% accurate would still allow you to verify emulation mode of a 65c816... Bearing in mind the known altered behaviour of course... mmh. One day, I suppose. XD
@g.davidturnblom5751
@g.davidturnblom5751 7 жыл бұрын
My understanding of the 65816, which may be wrong, is that emulation mode performs the same operations for each opcode that are performed in native mode, just without the option of switching to 16-bit. The bits that make 16-bit possible are inaccessible and fixed to be clear and "replaced" with the B flag and a 1 (the B flag is just an artifact used when pushing P to the stack during interrupt generation to signify if BRK caused the interrupt).
@koskovictor5095
@koskovictor5095 5 жыл бұрын
We had them make a 6502 with everything 8 made 16, only. However they sped up the transistors about 10 fold doubled the number of addressing modes though same principal and banked the 4 memories. Should have 24 bits and 2 operands though.
@acmenipponair
@acmenipponair 5 жыл бұрын
there is a reason, why Commodore didn't renamed MOS technologies: because that was the selling point of the CPU: Yes, the CPU manifacturer was owned by Commodore and therefore commodore got the chips for lowest cost for the PETs and Cxxx-computers. But on the other hand, as there was not Commodore, but MOS written on the chips, Commodore was able to sell the 6502 to Apple, Nintendo and so on without them having to fear a face lost. When somebody opened an Apple II, they didn't saw a big "Commodore 6502" processor on the board - which would have made them think "why don't I just buy a Commodore PET then instead, when Apple only uses the same chips as Commodore?" - But they saw a MOS 6502 chip on the board. They only rebranded the chips, when this problematic in Marketing wasn't there anymore, as most of the old 6502 computers had died out, the new ones hadn't boards you could see (who would ever open an NES console?) and also, in the 90s it was well known from the PC world, that computer companies work together, like Intel and IBM and later Apple and IBM.
@0623kaboom
@0623kaboom 5 жыл бұрын
that and to make the chips cheap enough for sale they needed to make BILLIONS of them... when you have 30 years of stock on hand any given day ... you tend to have lots of ready to go chips that cost a few pennies ... no point wasting money rebranding them when they will be INSIDE a machine already
@TheKetsa
@TheKetsa 5 жыл бұрын
Any followup talk with progress ?
@Dinnye01
@Dinnye01 4 жыл бұрын
Fun fact :D as a hungarian, I can actually read that stuff, which Balázs wrote :D
@Dinnye01
@Dinnye01 4 жыл бұрын
Oh and "Utasításdekódoló" means instruction decoder
@inceptional
@inceptional 8 ай бұрын
I honestly wish I had the slightest clue how the hell someone goes about learning this kind of stuff from the very start and where to go with each next step that is actually graspable to the average punter, because this is just totally and utterly alien to me. It boggles my mind anyone can ever grasp this stuff. But, really frustratingly, I kinda get the impression from everything I've ever even just slightly touched upon on this topic [or kinda related] that I'd need to basically understand stuff at this level to ever really figure out how the living Christ to program for SNES myself (that's what I'm actually interested in). Because the community most certainly isn't making SNES development tools that just regular more casual game makers like me might want to use or indeed can use. Real shame it's still all so complex and beyond the grasp of most people. And, seriously, what the hell subject are people taking at high school or wherever that somehow provides them with the very basic knowledge required to even remotely understand where to start and the where to go next to be able to one day actually do this kind of thing with any semblance of competence. Every single time I try to start learning using whatever resource online, I reach a moment where I'm like, this cannot be the start, I've missed something, there's some step I need to understand that I should have known about before this point, because they're talking about stuff that I just don't have a clue about, yet the talk as if I'm already supposed to know it someone, even though they themselves never taught me about it prior to them mentioning it right now. It's just so frustrating to think I'm missing some fundamental piece of a puzzle here, some essential knowledge or even just some way of thinking about things that others seem to be able to do, and cannot for the life of me figure out what it is.
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 3 ай бұрын
You could study physics. Only one person in my class proceeded with maths because it seems more fundamental and clean. Don’t go to applied physics right as your bachelor.
@paulmichaelfreedman8334
@paulmichaelfreedman8334 7 жыл бұрын
To my knowledge the C64 always had a 6510. Of course there is little difference besides the bank switching. Didn't the VIC20 have a 6502?
@BertGrink
@BertGrink 6 жыл бұрын
Paul Freedman You are correct about the C64 having a 6510, as well as the VIC20 having a 6502. The practical difference between these two CPUs is that the 6510 has an added data I/O port at addess $0000 and a data direction register to control data flow in and out of the port, at address $0001. Both port and register are 8 bits wide but each bit is individually addressable. For a hardware designer this means that they are not pin-compatible, and for a programmer, that there are a couple of new instructions on the 6510. Bank switching was, as far as i know, managed by either a CIA or a VIA from the 6500 family.
@0toleranz
@0toleranz 5 жыл бұрын
BertyFromDK there were also the 6509 variant which also had an additional port like the 6510 but it’s purpose was memory management. It was internally coupled to an register/logic to help with memory expansion up to 21 or 22 address bits.
@acmenipponair
@acmenipponair 5 жыл бұрын
As BertyFromDK said: the major difference between the 6502 and 6510 is, that the 6502 couldn't switch between RAM and ROM via the added PC pin. So part of the memory of the VIC was always blocked by the ROMs, which made the memory maximum 32K big. Meanwhile with the 6510 you can adress many KB of ram, although not all at the same time ;)
@acmenipponair
@acmenipponair 5 жыл бұрын
That's also the reason, why you didn't had the 6502 in younger 8bit consoles like the Gameboy, but Z80 variants: The Z80 was able to bank switch up to 512K of RAM or ROM. The 6510 was no option, as it wasn't commercially available for other manifacturers and in 1985 it was replaced with the 8510, also only available for Commodore.
@0623kaboom
@0623kaboom 5 жыл бұрын
the first run of C64 was 6502 ... the second gen was 6510 .. I had them both along with a vic and a z80 back then
@richarddevenezia8186
@richarddevenezia8186 3 жыл бұрын
IIRC there was 6502 emulator written in Minecraft switches
@MatthewHolevinski
@MatthewHolevinski 7 жыл бұрын
the physics based emulation.... niiiice
@firstmicro
@firstmicro 7 жыл бұрын
The first Atari was prototyped by Jay Minor with the Microcomputer Associates JOLT series
@napomania
@napomania 5 жыл бұрын
Miner. the car was a Minor :-)
@AnOfficialAndrewFloyd
@AnOfficialAndrewFloyd 7 жыл бұрын
The 6507 is in the Atari 2600. The Atari 8-bit family of _computers_ (400, 800, XL and XE series) used the 65C02.
@kevincozens6837
@kevincozens6837 7 жыл бұрын
I was wondering if the 65C02 would get a mention. IIRC, it has some additional instructions over the 6502.
@buckosoft
@buckosoft 6 жыл бұрын
That's pedantic. The 6507 is the same physical die with interrupts and high address lines not brought out.
@xotmatrix
@xotmatrix 6 жыл бұрын
No Atari computer ever used the 65C02. You are thinking of the 6502C, essentially a standard 6502 but with two additional signal lines.
@mcmackerel
@mcmackerel 11 жыл бұрын
The transistor count has gone up by several orders of magnitude (and the transistors have become similarly smaller), so I imagine it's just not feasible to read it directly in the same way now without some abstraction.
@mwk1
@mwk1 6 жыл бұрын
49:08 - little correction on NES (Ricoh 2A03/07) version of 6502 chip, it doesn't have any video logic in addition, only APU and a handful of I/O registers.
@user-cz9ss4yq4x
@user-cz9ss4yq4x 4 жыл бұрын
Great speaker
@dougall1687
@dougall1687 Жыл бұрын
Coming late to this, but that was fantastic!
@monetize_this8330
@monetize_this8330 5 жыл бұрын
24:57 maybe the origins of a cost-reduced Atari 2600
@RogerBarraud
@RogerBarraud 2 жыл бұрын
Brilliant talk; lost count of how many times I have watched it... 5? Does anyone know what S/W they used for the animated RTL diagrams?
@johndododoe1411
@johndododoe1411 Жыл бұрын
If you mean the Visual 6502, I guess you can download the code.
@TOUKOretrotaku
@TOUKOretrotaku 5 жыл бұрын
You forgot the PCENGINE, with his souped up 65c02 @7.16mhz .
@byfepo
@byfepo Жыл бұрын
Que Hermoso... el 6502 y el Z80 SINCLAIR, programas de 13 líneas con 1kb de memoria
@leodeoliveira7480
@leodeoliveira7480 5 жыл бұрын
Decimal mode is that important in business and financial applications that IBM based its entire mainframe character set (EBCDIC) on being able to efficiently store the values "0".."9". Decimal representation is important because it's more accurate, when dealing with large numerical values, than holding numbers in floating-point form. The downside, of course, is that BCD arithmetic is slower to perform, but that's relatively unimportant when accuracy is your greater concern: to overcome that, the mainframe instruction set would have been equipped with opcodes and macros intended specifically to deal with arithmetic on decimal values. (The 6502 could only do adds and subtracts on decimal values). Incidentally, the 8080 and its successors, including the Pentium, all had decimal (BCD) support, and did the Motorola 68xxx. BCD continue to be a supported data type in databases( e.g., MS SQL Server), as well as on Microsoft's .NET framework.
@philrod1
@philrod1 5 жыл бұрын
Games also used BCD for large numbers like the score. Pac-Man definitely does.
@leodeoliveira7480
@leodeoliveira7480 5 жыл бұрын
I suppose if score go over 32767 … :-)
@johndododoe1411
@johndododoe1411 Жыл бұрын
I strongly suspect many modern implementations use plain 64 bit integers instead if 18 digit BCD. Decimal floating point was a thing in many calculators and the Ti-99 BASIC interpreter. Ti99 used Base 100 encoding with each 2 digit pair encoded as an ordinary byte instead of a BCD byte to avoid dedicated hardware features.
@leodeoliveira7480
@leodeoliveira7480 Жыл бұрын
John, you're an even bigger nerd than me.🙂
@RogerBarraud
@RogerBarraud 2 жыл бұрын
02:22 Woz in a suit?!!!11??!! :-)
@khatharrmalkavian3306
@khatharrmalkavian3306 3 жыл бұрын
I'm confused about why this presentation makes it feel like the 6502 is no longer in production.
@johnmarks714
@johnmarks714 3 жыл бұрын
Because its presented as basically an electronic archaeological dig.
@bozimmerman
@bozimmerman 2 жыл бұрын
Heck, the WDC, who still makes 6502s, is run by Bill Mensch, who was on the team that invented the thing.
@Mat-Ellis
@Mat-Ellis Жыл бұрын
This is a great presentation. I wrote an article on illegal opcodes in 1982, funny how similar the names of the illegal instructions are, although I called KILL "HLT" after the Z80 instruction 'halt and catch fire'. From memory most seemed to do nothing, which with an operand was great for obfuscating code for copy protection, but there was one weird instruction that was like ORA $absolute,Y with #$EE or something. I'd love to find out why that worked that way! Thank you for being so rigorous in *knowing* what happened and why.
@herrbonk3635
@herrbonk3635 Жыл бұрын
Z80 has no 'halt and catch fire' instruction. You are probably thinking of 6800 or 6809.
@TheUtuber999
@TheUtuber999 Жыл бұрын
Crazy to think that Janet Jackson's "Rhythm Nation" has been known to knock out hard drives. 😁
25c3: The Ultimate Commodore 64 Talk
1:01:15
Christiaan008
Рет қаралды 152 М.
The first LowSpec Processor
28:11
LowSpecGamer
Рет қаралды 628 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
Reading Silicon: How to Reverse Engineer Integrated Circuits
31:52
A simple BIOS for my breadboard computer
21:53
Ben Eater
Рет қаралды 361 М.
The 6502 CPU Powered a Whole Generation!
25:17
The 8-Bit Guy
Рет қаралды 538 М.
Is Functional Programming DEAD Already?
21:07
Continuous Delivery
Рет қаралды 76 М.
34C3 -  The Ultimate Apollo Guidance Computer Talk
1:01:42
media.ccc.de
Рет қаралды 298 М.
Can this thing double the performance of your vintage PC in just seconds?
30:57
Adrian's Digital Basement
Рет қаралды 446 М.
GeckOS: a Unix-like 6502 operating system | VCFMW 2019
50:29
VCF Midwest
Рет қаралды 82 М.
Intro to Hardware Reversing: Finding a UART and getting a shell
12:07
Tony Gambacorta
Рет қаралды 906 М.
The Dome Paradox: A Loophole in Newton's Laws
22:59
Up and Atom
Рет қаралды 628 М.
Inside the Famicom | 02: The 6502 CPU
16:46
What's Ken Making
Рет қаралды 6 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН