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 fe…
I believe 6502 instruction set is a good first assembly language
181–190 of 297 posts
Re: I believe 6502 instruction set is a good first assembly language
#182Earlier quoted context omitted.
Could you say why? It doesn’t feel much like it to me at all!
ARM designers liked and had extensive experience with 6502 - it WAS their bread and butter for a long time - and this might be why the mnemonics are so similar (and carry in subtraction - that might have been for making porting easy, but I won't risk assuming that without a primary source). They obviously also studied foundational papers on RISC and understood the possibility of having a simple design (such as the 65…
But I don't think that ARM 'ARM borrowed most of its design from 6502' or (to my mind at least) looks like a refreshed 6502. There are just too many fundamental differences:
- ARM1 was a load/store architecture / 6502 wasn't.
- 6502 had a few special purpose registers / ARM1 had loads of general purpose registers.
Plus there are lots of key innovations in ARM1 that weren't in either 6502 or RISC 1 such as conditional execution. Furber and Wilson were really quite innovative and didn't just borrrow ideas from other ISAs.
Re: I believe 6502 instruction set is a good first assembly language
#183I’ve only ever learned two assembly languages: 6502 (when I was in elementary school in the early 80s) and 370 (my senior year of high school when I had access to the UIC mainframe thanks to taking night classes there). I can roughly follow the output of godbolt on those rare occasions that I’m curious enough to bother, but the complexity of modern CPUs and computer architectures are such that I don’t know that I rea…
Same, learned as a kid. What was your motivation? Mine was wanting to make games and hitting the performance wall in basic.
Re: I believe 6502 instruction set is a good first assembly language
#184Problems with the ISA become obvious the moment you want to scale your program beyond toy complexity. The stack is absurdly tiny, and trying to use it as a calling convention quickly becomes both a performance and a nesting depth bottleneck. I work around this for my larger projects by using zeropage scratch as a sortof manually-managed local scope for routines, but it requires carefully tracking which otherwise global bytes my programs are using at various nesting levels. Recursion is off the table both with this technique (difficult to manage) and with the stack (256 bytes will be exhausted very quickly). The C compilers I'm aware of work around this (slowly!) by using a separate software stack for arguments to functions.
It's pretty fun though! I'm working on a full modern indie game for the NES, which is 100% programmed in 6502 assembly for performance reasons. The existing C toolchains for the NES are either very slow (cc65) or not yet mature (llvm-mos). Most of the true complexity in the project is algorithmic stuff, like resource allocation and deciding how much work to do on a given frame. The 6502 ISA is a bit slower to write than higher level code, but it's not really a major limiter now that I've got my process down.
Here's that game if you're interested: https://zeta0134.itch.io/tactus
Re: I believe 6502 instruction set is a good first assembly language
#185I 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…
(Unless you want to really dive into "how can I work around limitations", and then you pick an F8 and pull your hair as much as you like)
Re: I believe 6502 instruction set is a good first assembly language
#186I learned M68K in a college class in 1995. When I saw x86 asm 2 years later it looked like a mess. But I've never needed to write asm for a job.
I'm thinking about learning 6502 because my first computer (Atari 800) and first dedicated game console (original Nintendo NES) both used the 6502 and it would be fun to write games for them when I retire.
Re: I believe 6502 instruction set is a good first assembly language
#187I'm curious what people's thoughts are on the 65816 (used by the SNES) instead of the 6502 (the NES instruction set). Is this author arguing the 6502 is preferable because it's simpler? Or because there are more/better resources for learning?
Re: I believe 6502 instruction set is a good first assembly language
#188Earlier quoted context omitted.
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 i…
Some people believe that RISC-V is simple and elegant, other people believe that RISC-V is one of the worst and ugliest instruction-set architectures that have ever been conceived. Usually the first class of people consists of people with little experience in assembly programming and the second consists of those who had experience in using multiple ISAs for assembly programming. Using RISC-V for executing programs wr…
I also agree the 6502 is not a simple ISA. However after learning 6502 machine code, MIPS, AVR, and ARMv6-M were all easy to learn.
Re: I believe 6502 instruction set is a good first assembly language
#189Re: I believe 6502 instruction set is a good first assembly language
#190Earlier quoted context omitted.
ARM designers liked and had extensive experience with 6502 - it WAS their bread and butter for a long time - and this might be why the mnemonics are so similar (and carry in subtraction - that might have been for making porting easy, but I won't risk assuming that without a primary source). They obviously also studied foundational papers on RISC and understood the possibility of having a simple design (such as the 65…
Completely agree with all these points and that without the 6502 the ARM1 would not have looked like it did. One might say ARM1 was inspired by the 6502 and it prevented them going down the CISCy 68k route. But I don't think that ARM 'ARM borrowed most of its design from 6502' or (to my mind at least) looks like a refreshed 6502. There are just too many fundamental differences: - ARM1 was a load/store architecture /…
Nobody can ever question that.