Earlier quoted context omitted.
I come from a similar but different angle. Have been at 6502, 68k, z80, and some x86/64 over past few decades (mostly demo). I also wonder if this article/post was written by AI - he argues for 6502 that it has 6 registers, and thus it's simple. ANYONE who ever touched 6502 for more than a week will know you're pretty much dealing with three, and that's where the nickname of a sempahore CPU comes from (three register…
6502 really has 262 registers: 256 zero page plus those standard ones mentioned. Or 260 for 6510, as zero page addresses 0 and 1 are for I/O. Practically anything non-trivial uses those zero page addresses as extra registers.
I believe 6502 instruction set is a good first assembly language
171–180 of 297 posts
Re: I believe 6502 instruction set is a good first assembly language
#172Is 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
#173I would argue that 6502 is a bad first ISA to learn if you want learn assembly. You‘ll spend most of your time fighting the quirks of this clever, but deeply flawed architecture. The idioms you learn to work around them don‘t translate to any better designed architecture that wasn‘t constrained by the tools and budget available to MOS at the time. If you want to learn a small, yet powerful instruction set with a few…
I can't even guess what you might be referring to.
Re: I believe 6502 instruction set is a good first assembly language
#174https://en.wikipedia.org/wiki/MMIX
has a quite deep corpus and what looks to be a good introduction:
https://www.mmix.cs.hm.edu/getstarted.html
(and I say that as a person who owns a much battered copy of Inman & Inman's _Apple Machine Language_)
Re: I believe 6502 instruction set is a good first assembly language
#175In university we we're taught a version of MIPS that was implemented into a decent simulator with an IDE showing the state of memory and registers with fine grained debug stepping. Some quirks of processor pipelines (i.e. nops after branch) could be enabled for realism or turned off to make things easier for new students. That was pretty great for learning assembly, I can't comment on any other approach - no doubt th…
Re: I believe 6502 instruction set is a good first assembly language
#176Re: I believe 6502 instruction set is a good first assembly language
#177I would argue that 6502 is a bad first ISA to learn if you want learn assembly. You‘ll spend most of your time fighting the quirks of this clever, but deeply flawed architecture. The idioms you learn to work around them don‘t translate to any better designed architecture that wasn‘t constrained by the tools and budget available to MOS at the time. If you want to learn a small, yet powerful instruction set with a few…
The early ARM ISAs are good, as you say.
Re: I believe 6502 instruction set is a good first assembly language
#178Earlier quoted context omitted.
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.
I thought I was in heaven when I got the Action Replay cartridge (not the genuine, but a clone with the same software) that came with a monitor, a "freezer", fastloader, and various disk utilities.
Re: I believe 6502 instruction set is a good first assembly language
#179Earlier quoted context omitted.
Modern CPUs are more difficult to program in assembly. The simplicity of RISC-V is illusory. Because it lacks many features of normal ISAs, like ARM or Intel/AMD x86-64, writing programs that are both efficient and robust, i.e. which handle safely any errors, is quite difficult in assembly language. For a simpler programming in assembly language it is hard to beat DEC PDP-11 and Motorola 68000 derivatives. However th…
> Because it lacks many features of normal ISAs Do you have some examples of this?
There are absolutely no reasons for omitting these essential features, because their hardware implementation is many times simpler and cheaper than either the software workarounds for their absence or than the hardware workarounds that can be implemented in other parts of the CPU core, e.g. instruction fusion.
6502 is much more similar to a normal CPU than RISC-V, because it has both integer overflow detection and indexed addressing.
While I believe that other ISAs are better than 6502 for learning assembly language for the first time, I consider 6502 as a much better choice than RISC-V.
RISC-V could be used for teaching if that would be done in the right way, i.e. by showing how to implement with the existing RISC-V instructions everything that is missing in RISC-V. In that case the students would still learn how to write real programs instead of toy didactic programs.
However I have not seen any source teaching RISC-V in this way and it would be tedious for newbies, in the same way as if they were first taught how to implement a floating-point library on a CPU without floating-point instructions, instead of being allowed to use the floating-point instructions that any CPU has today.
Re: I believe 6502 instruction set is a good first assembly language
#1806502 was my first assembly, though we didn't have an assembler - we entered raw opcodes into the Epyx FastLoad monitor on the C64. You kids with your symbol tables and your fancy mnemonics. a9 01 8d 20 d0 a9 93 20 d2 ff ... When we got a KIM-1, we were able to write meaningful programs on it in a weekend, since we already had memorized all the hex.
I've forgotten so much of that, but I'll go to my grave remembering that LDA #97 JSR $FFD2 writes "A" to the screen.
It was even more of a pain with 80 columns when half of the text was in the main memory and the other half was the bank switched memory.