Live data from Hacker News

Dirty tricks 6502 programmers use

nurpax.github.io

1–10 of 63 posts

Re: Dirty tricks 6502 programmers use

#3
What, if any, modern products still use the 6502?

EDIT: That’s not a dig against the 6502. I still fondly remember leaning BASIC in my C64 and wish now I had ventured into Assembly with it. By today’s standards it seems to have a simpler and more approachable instruction set so I’m wondering if there aren’t products I could hack on to learn Assembly with it. Or maybe I should just break out my old Commie.

Re: Dirty tricks 6502 programmers use

#4
Not to belittle the article, because it's definitely interesting. But as an ex-BBC 6502 programmer, my nitpick here would be that the title should really be named "Dirty tricks C64 6502 programmers use".

On the beeb we had our own set of tricks specific to the memory layout and ROM of our beloved beige and black machines.

Re: Dirty tricks 6502 programmers use

#5
post #3

What, if any, modern products still use the 6502? EDIT: That’s not a dig against the 6502. I still fondly remember leaning BASIC in my C64 and wish now I had ventured into Assembly with it. By today’s standards it seems to have a simpler and more approachable instruction set so I’m wondering if there aren’t products I could hack on to learn Assembly with it. Or maybe I should just break out my old Commie.

Toys - and some of those have minimal RAM.

Re: Dirty tricks 6502 programmers use

#6
There can be a significant trade-off on size vs speed, the more tricks you do to shave down bytes usually adds to the complexity of the iterations.

So assembly programmers may go for the more kludgy looking code as the execution far outpaces the optimized byte count version. Ive heard of such things in video timing and game loops.

Re: Dirty tricks 6502 programmers use

#7
post #4

Not to belittle the article, because it's definitely interesting. But as an ex-BBC 6502 programmer, my nitpick here would be that the title should really be named "Dirty tricks C64 6502 programmers use". On the beeb we had our own set of tricks specific to the memory layout and ROM of our beloved beige and black machines.

title should really be named "Dirty tricks C64 6502 programmers use".

In that case, probably Dirty Tricks 6510 Programmers Use would be even better.

Re: Dirty tricks 6502 programmers use

#8
post #3

What, if any, modern products still use the 6502? EDIT: That’s not a dig against the 6502. I still fondly remember leaning BASIC in my C64 and wish now I had ventured into Assembly with it. By today’s standards it seems to have a simpler and more approachable instruction set so I’m wondering if there aren’t products I could hack on to learn Assembly with it. Or maybe I should just break out my old Commie.

Specifically the 6502, or its successors like the 65C816?

The 65C816 is still being made, so someone must use it for something.

Re: Dirty tricks 6502 programmers use

#10

There can be a significant trade-off on size vs speed, the more tricks you do to shave down bytes usually adds to the complexity of the iterations. So assembly programmers may go for the more kludgy looking code as the execution far outpaces the optimized byte count version. Ive heard of such things in video timing and game loops.

This really depends on the specific architecture and the application. In some cases, you will want to optimize mostly for size, so that your hotspots fit entirely into I-cache. Modern CPUs spend most of their time waiting for data (or instructions) to become available, so often computations are essentially free.
Post reply on HN