3 ms·
> 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, th
by brucehoult 2y ago
> 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 something almost prehistoric, where you figure out how much circuitry you could fit on a chip (or board) and then figured out what instruction set you could fit to that hardware.
Note that 6502 was the first machine code I learned as a 17 year old in 1980, after I got bored with BASIC after two days. I learned z80 on a ZX81 the year after and PDP-11 the same year. VAX in 1982, 6809 in 1983, and 68000 in 1984.
> Modern microprocessors are almost exclusively programmed with high-level languages and the direct usage of assembly instruction is not high on the list of priorities for CPU designers nowadays.
That's just absolutely not true.
They might be in some way "harder" than a CISC instruction set such as VAX but any of the above are far simpler to program than 6502, especially the base RISC-V RV32I instruction set.
> To illustrate this point, loading a 64-bit constant to a register on ARM64 can take 4 instructions with bit shifting.
Whereas you can't do it at all on a 6502! Loading a 64 bit constant into 8 zero page locations takes 16 instructions and 32 bytes of code on a 6502.
Let's not even talk about adding or comparing or multiplying two such values.
The GNU assembler for ARM64 doesn't help you out, but on RISC-V you can just type ...
li x10,0xfedcba9876543210
... and the assembler will generate the multiple instructions for you.
- deleted 2y ago[deleted]