Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Easy 6502 (skilldrick.github.io)
151 points by ibobev 5 months ago | hide | past | favorite | 20 comments



If 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


I 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.)


Not nowadays, back in the day as well. People should spend some time on Hugi and Poet archives.


It'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.


C64 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.


Amazing 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!


This and Ben Eater's videos.


Related:

Easy 6502 - 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 - Jan 2017 (84 comments)

Easy 6502 - https://news.ycombinator.com/item?id=9761213 - June 2015 (9 comments)

Easy 6502 - https://news.ycombinator.com/item?id=6345730 - Sept 2013 (28 comments)

Easy 6502 - 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 - July 2012 (78 comments)


Also 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


OK, 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.


Best 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.


I 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.


> 3. 255 numbered registers

255? Isn’t that 256? There’s nothing special about address zero on 6502.


Well, 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.)


Z80 is also much easier to compile HLLs for, and IMHO has more in common with the 8086.


No opinion needed when they're both explicitly derived from the 8080.


Side 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

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.


"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...


Also Terminator and Futurama's Bender. Not to mention Amiga's keyboard.


I read this a few years ago to refresh my 6502 knowledge, it's well done




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: