3 ms·
Essentially all CISC ISA's were designed for "assembly being written by humans". But I'd still choose RISC-V as a first platform to learn assembly for, before
by zozbot123 8y ago
Essentially all CISC ISA's were designed for "assembly being written by humans". But I'd still choose RISC-V as a first platform to learn assembly for, before anything else. 6502 is particularly crappy in that it only has a 256-byte, non-relocatable stack, which is not really designed for the familiar use (to us) of enabling reentrant subroutines as in C... so even before you take the limitation to a 16-bit address space into account, the most complex thing you're going to be able to "naturally" compile for the platform is some sort of old-school FORTRAN- or BASIC-like language. I can see being interested in the 6502 for the history or the simplicity on the hardware side, but it does have a lot of baggage that's frankly a bit primitive from a modern POV.
- chongli 8y agoCompile into 6502? The CPU was designed to be programmed in assembly, by humans. If your first instinct is to reach for a compiler, you're using the wrong CPU. I think one great reason to learn 6502 assembly is to write your own Nintendo games and play them on real hardware. Admittedly, that's an extremely niche thing to do, yet there's a thriving community [1] dedicated to the hobby. [1] https://forums.nesdev.com/ https://forums.nesdev.com/
- userbinator 8y agoThe 6502 is still used today in cheap embedded devices, where they are often programmed in an HLL (some C subset is common); its architecture is more similar to that of microcontrollers, which are just as if not more "unusual" and constrained (8051, Microchip PIC) --- and for which compilers exist too.
- AnIdiotOnTheNet 8y agoNES/SNES, Commodore computers, Atari computers (including the 2600), BBC Micro, Acorn computers, and the Apple I-III. There's a reason the 6502 and its variants were the proc of choice for so many computers.
- microtherion 8y agoThe 6502 was also a perfectly decent target for FORTH. And of course UCSD Pascal was quite powerful for the time.
- zozbot123 8y agoIt's also a decent target for C, if you use cc65 (though proper reentrancy is indeed going to be a challenge). But it's hard to describe C, FORTH or PASCAL as the most "natural" high-level languages for the platform, given that the ISA doesn't really make it easy to manage a user stack.