4 ms·
Easy 6502
- zabzonk 2y agoOK, but I think a diagram or two of the architecture would help. And personally, I think the Z80 is easier to understand (no zero-page, no limited stack size, etc.) but that is probably just me, though I did write professional 6502 and Z80 code way back when.
- dapperdrake 2y agoBest descriptions I heard of the zero page: 1. A bunch of numbered "local" variables 2. Data cache with numbered entries 3. 255 numbered registers IIRC it was mentioned here on HN, but sadly I lost the reference. EDIT: Formatting.
- Someone 2y ago> 3. 255 numbered registers 255? Isn’t that 256? There’s nothing special about address zero on 6502.
- masswerk 2y agoWell, on the 6510 address $01 is a port register and address $00 the related data direction register. Therefore, C64 folks tend to ignore these addresses. (So there are just 254 usable zeropage addresses on the 6510, while on a stock 6502 and other variants the full complement of 256 zeropage addresses is usable.)
- masswerk 2y agoI tend to think of them as slow registers, since they provide crucial functionality, as in pre-indexed and post-indexed indirect address modes. There is simply no indirect addressing on the 6502 without them. But the notion of "local variables" (as related to the speed advantage) may be useful, as well.
- userbinator 2y agoZ80 is also much easier to compile HLLs for, and IMHO has more in common with the 8086.
- o11c 2y agoNo opinion needed when they're both explicitly derived from the 8080.
- khanan 2y agoIf you're into 6502 and more specifically the Commodore 64, you should give the winning demo from last weekends Fjälldata a look. Quite insane stuff they do nowadays... https://www.youtube.com/watch?v=WtpPPgFSwxE https://www.youtube.com/watch?v=WtpPPgFSwxE
- basementcat 2y agoI feel this was an example of the crazy things you can do with PAL C64 hardware and not necessarily what can be done with a 6502. I feel Apple // demos are more representative of what a 6502 can do (without hardware assisted sprites, character generators, ADSR waveform generators, etc.)
- pjmlp 2y agoNot nowadays, back in the day as well. People should spend some time on Hugi and Poet archives.
- wkat4242 2y agoIt's kinda amazing that the people who wrote this probably know every single byte of code that's running on that computer, rom included. Without such deep knowledge you can't get this kind of performance. With a modern computer that is simply unthinkable.
- vardump 2y agoC64 demo coders don't generally care about ROM contents, there's nothing useful in there. ROMs are usually switched off. Although there might be a few exceptions.
- levodelellis 2y agoI read this a few years ago to refresh my 6502 knowledge, it's well done
- dang 2y agoRelated: Easy 6502 - https://news.ycombinator.com/item?id=31548311 https://news.ycombinator.com/item?id=31548311 - May 2022 (28 comments) Easy 6502 – How to get started writing 6502 assembly language - https://news.ycombinator.com/item?id=13324978 https://news.ycombinator.com/item?id=13324978 - Jan 2017 (84 comments) Easy 6502 - https://news.ycombinator.com/item?id=9761213 https://news.ycombinator.com/item?id=9761213 - June 2015 (9 comments) Easy 6502 - https://news.ycombinator.com/item?id=6345730 https://news.ycombinator.com/item?id=6345730 - Sept 2013 (28 comments) Easy 6502 - https://news.ycombinator.com/item?id=5180937 https://news.ycombinator.com/item?id=5180937 - Feb 2013 (59 comments) Easy 6502 - Learn the 6502 Assembly Language - https://news.ycombinator.com/item?id=4213806 https://news.ycombinator.com/item?id=4213806 - July 2012 (78 comments)
- jolmg 2y agoAlso related from yesterday, though not the same article: > I believe 6502 instruction set is a good first assembly language https://news.ycombinator.com/item?id=42957823 https://news.ycombinator.com/item?id=42957823
- nicetryguy 2y agoAmazing resource, classic at this point, still probably the best place to start a 6502 journey. I became an NES romhacker with released projects thanks to this as a first step!
- wkjagt 2y agoThis and Ben Eater's videos.
- DidYaWipe 2y ago"powering famous computers like the BBC Micro, Atari 2600, Commodore 64, Apple II, and the Nintendo Entertainment System." Oddly omitting the standard-setting Atari 8-bit computer line...
- vardump 2y agoAlso Terminator and Futurama's Bender. Not to mention Amiga's keyboard.
- markus_zhang 2y agoSide topic: for anyone who wants to do x64 assembly game programming, check out this video for reference: https://m.youtube.com/watch?v=p60L-TOecik&t=1042s https://m.youtube.com/watch?v=p60L-TOecik&t=1042s I think I can start in C and check the -s assembly code too, and gradually be comfortable with writing directly in assembly. After all a lot of the code is just function calls into libraries.
- deleted 2y ago[deleted]