Live data from Hacker News

I believe 6502 instruction set is a good first assembly language

nemanjatrifunovic.substack.com

61–70 of 297 posts

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

#61
When I learned assembly at university, we were required to learn Intel 8086. I remember hating every second of it, because it was so useless.

Around the same timey I had to learn AVR8 family assembly (for ATMega328P) which was a joy in comparison.

I don't think AVR assembly is any better or easier then 16bit Intel, but just the fact that it's a usable and actually triable thing makes a world of difference.

I guess what i'm trying to say is that you shouldn't underestimate the importance of learning something useful instead of something antiquated, even when it is not the simplest thing to do.

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

#62

> modern RISC architectures such as ARM, MIPS or RISC-V. At some point, a serious assembly programmer should definitely learn some of them. Yes. > However, they are not ideal to start with: the “S” in RISC stands for “simple”, but the simplicity is more about internal implementation of the chips than the instruction set. That is in fact a much better description of the 6502, which is not even a RISC but rather someth…

[deleted]

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

#64

Earlier quoted context omitted.

The era in which there was nothing but assembly language was very short-lived. By the time the 1950s were over, we had higher level languages. Like before The Beatles recorded their first album.

6502-based microcomputers like the Apple II shipped with BASIC and a 6502 monitor. The reason is that BASIC and low-level monitors can fit into tiny amounts of memory.

My C64 didn't come with a monitor. I typed one in from a magazine, then learned assembly by entering instructions directly into it. I was so thrilled to discover assemblers later.

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

#65

When I learned assembly at university, we were required to learn Intel 8086. I remember hating every second of it, because it was so useless. Around the same timey I had to learn AVR8 family assembly (for ATMega328P) which was a joy in comparison. I don't think AVR assembly is any better or easier then 16bit Intel, but just the fact that it's a usable and actually triable thing makes a world of difference. I guess wh…

These days just learn RISC V. Plenty of chips and MCUs.

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

#67

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…

6502 is a better "toy" asm than the Z80, but that's not saying much. It's not even obviously better than the AVR 8-bit insn set. As far as more modern platforms, I think there is a strong case for teaching RISC-V over something like MC68k. RISC-V can be very simple and elegant (in the base integer insn set) while still being very similar to other modern architectures like ARM, Aarch-64 and MIPS. It's also available in both 32 and 64-bit varieties, and the official documentation is very accessible.

MC68k just has tons of quirks which aren't really going to be relevant in the modern day and age. (About the only thing it has going for it is the huge variety of hardware platforms that happened to make use of it, many of which still have thriving retro communities around them. But that's more of a curiosity as opposed to something genuinely relevant.)

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

#68

I really don't see how. When students are first exposed to computer programming, it might make sense to start with toy / compact languages that don't have any real-world use. But assembly is not the first language you're supposed to learn! It's very utilitarian and most commonly just used for debugging and reverse engineering. So why would you waste time on the assembly language of a long-obsolete platform? Plus, the…

Understandable... but this is not that the point of the article. The article says "...a good first assembly language".

Nowadays, normally people learn assembly after they learn higher level lang like C or Java.

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

#69

I really don't see how. When students are first exposed to computer programming, it might make sense to start with toy / compact languages that don't have any real-world use. But assembly is not the first language you're supposed to learn! It's very utilitarian and most commonly just used for debugging and reverse engineering. So why would you waste time on the assembly language of a long-obsolete platform? Plus, the…

I struggled with C until I learned to hex and assembly program on the 68HC11. Maybe I'm just a moron, but things like pointers for a complete beginner seemed so abstract and obtuse until I learned how to do indirect addressing in assembly, then suddenly it was painfully obvious why C had pointers and how they worked. Before that I just mostly used Python where it's far more abstracted away. People forget that many features like pointers exist to address hardware/performance limitations, which is not immediately obvious to new devs the "why and what" of what they're actually doing inside the cpu which limits your intuitive understanding.

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

#70

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 68K is still a tiny bit awkward, with its 24-bit bus and alignment restrictions and middling support for indexing into arrays (no scale factor). The 68020 is about as close to C as an ISA can get - it’s extraordinarily pleasant.
Post reply on HN