Live data from Hacker News

I believe 6502 instruction set is a good first assembly language

nemanjatrifunovic.substack.com

51–60 of 297 posts

Re: I believe 6502 instruction set is a good first assembly language

#51

Earlier quoted context omitted.

It's $8 and can't run without external ROM and RAM and a clock circuit and some glue logic. A RISC-V CH32V003 32 bit processor with 2k RAM and 16k of flash running at 48 MHz costs $0.10 for an 8 pin package (6 available I/O pins) or $0.20 for the 20 pin package. Once programmed, it needs only electricity between 2.8V and 5.5V to be applied to start running. https://www.aliexpress.com/item/1005005036714708.html You ca…

Sounds nice, but the 6502 is certainly real, available hardware that you can buy and set up on a breadboard. There are tutorials on youtube for it as well, such as Ben Eater's tutorial.

Yes I'm well aware. I have a 65C02 on a breadboard. I have a 6809 on a breadboard. I've seen all Ben's videos.

The *only* advantage the 6502 has is the exposed and non-multiplexed address and data busses, which you can single-step and examine with an Arduino or something.

The whole setup is going to cost you the thick end of $100.

But you can do that just as easily in an emulator.

And meanwhile with RISC-V you can get an ESP32-C3 board with 400k RAM for a dollar or two, or the 1 GHz 64 MB RAM 64 bit Linux Milk-V Duo for $5. And if you wish, run exactly the same programs on a $2500 64 core 128 GB RAM Pioneer. And bunches of $10, $30, $70, $100, $200 boards (and now $400 laptops) in between.

Only ARM gives you similar breadth, but the instruction sets of a Cortex-M0 and M4 Mac are so different they might as well be from different companies.

Re: I believe 6502 instruction set is a good first assembly language

#52

Earlier quoted context omitted.

Sounds nice, but the 6502 is certainly real, available hardware that you can buy and set up on a breadboard. There are tutorials on youtube for it as well, such as Ben Eater's tutorial.

Yes I'm well aware. I have a 65C02 on a breadboard. I have a 6809 on a breadboard. I've seen all Ben's videos. The *only* advantage the 6502 has is the exposed and non-multiplexed address and data busses, which you can single-step and examine with an Arduino or something. The whole setup is going to cost you the thick end of $100. But you can do that just as easily in an emulator. And meanwhile with RISC-V you can ge…

[deleted]

Re: I believe 6502 instruction set is a good first assembly language

#53
I have mixed feelings here. On the one hand yes. It’s a good introduction because the simple patterns and instructions mean you can only do X a specific way. But when you start to write real programs, especially from a mindset of a programmer from the post 2010 times its starts to feel weird because the patterns become harder to grasp. So I‘m not 100% sure myself here. I love the 6502 and the instruction set. But on the other hand I feel that basic c and unoptimized assembly give you a more real live introduction to assembly? The issue is that it’s hard to judge for someone who already got introduced and grasps the concepts.

Re: I believe 6502 instruction set is a good first assembly language

#54
I first went deep on programming learning Z80 assembly for my TI-83. It has a lot of idiosyncracies, such as 8-bit registers that can be combined for 16-bit operations. But it was a lot of fun learning from tutorials and from reading other people's code. It put me way ahead when I got to college, as I had already learned a lot about computer architecture.

Re: I believe 6502 instruction set is a good first assembly language

#55

Can anyone speak on how it is to move from an older assembly, to a modern CPU? I asked to take an assembly class in local/public college, and was told they wouldn't hold the class because not enough students were interested. This was in 1998, and I truly couldn't believe my ears. I feel like learning modern assembly would be more useful, but maybe 6502 assembly is far easier to pick up? The first language I learned w…

Check out Assembly Language for x86 Processors by Kip Irvine. It’s probably one of the best books on x86. The older editions are way cheaper.

Doesn't it still treat 64-bit code as something of an afterthought?

Re: I believe 6502 instruction set is a good first assembly language

#56
post #31

Can anyone speak on how it is to move from an older assembly, to a modern CPU? I asked to take an assembly class in local/public college, and was told they wouldn't hold the class because not enough students were interested. This was in 1998, and I truly couldn't believe my ears. I feel like learning modern assembly would be more useful, but maybe 6502 assembly is far easier to pick up? The first language I learned w…

I started with BASIC on a Vic 20 in 1979 in a computer class for kids. Then I got my own Atari 400 at home, so I learned BASIC on that. Then around 1984 I got a Commodore 64 and it was amazing. I quickly got past the BASIC part of the C64 manual and in the back of the manual they had a memory map, all the hardware registers for all the chips, and then all the 6502/6510 opcodes. There was even an entire schematic for…

Was the 400 as much of a pain to type on as it looks? I was lucky to inherit an 800 when my uncle bought his first IBM clone, and those had nice keyboards.

Re: I believe 6502 instruction set is a good first assembly language

#57

I cannot agree that the simplicity of the 6502 wins over the 68000. The 68000 has more registers and wider data types: but the registers are all uniformly the same. It's really just two registers A and D, copied a bunch of times in to D0 to D7, and A0 to A7. Whatever you can do with D0 can be done with D3 and so on. Some A's are dedicated, like for a stack pointer. Simplicity of structure has to be balanced with simp…

> The best way to learn how to hack around the limitations of a tiny machine is to completely ignore them and become a seasoned software engineer Learning to hack around the limitations of a tiny machine is a good step toward becoming a seasoned software (and possibly hardware) engineer! The advantage of tiny systems is that you can understand them completely, from silicon to OS to software. The 6809 is simpler than…

I love the 6809 and friends, but knowing 6502 just seems so much more relevant and easier to get real hardware as well.
Post reply on HN