2 ms·
I was doing a lot of 6502 and 68000 assembly programming. Then (around 1988?) I got a PC with an 80286, and bought a book that described the 80286 instruction s
by chihuahua 2y ago
I was doing a lot of 6502 and 68000 assembly programming. Then (around 1988?) I got a PC with an 80286, and bought a book that described the 80286 instruction set. After reading it, I said "this is some bullshit" and returned the book for a refund. I had zero interest in writing a single line of code for that processor.
- dougvj 2y agoI first learned assembly on the x86 and wasn't until years later that I picked up m68k asm for a hobby computer and all that time I just assumed assembly was either gnarly and difficult like x86 or very bare bones for compilers (like the RISC isas). I didn't realize there was a such thing as nice, programmer oriented assembly.
- Pet_Ant 2y agoCan you tell us what the vast difference was that made you give up programming for it? I've only assembled SPARC in college, so I have no basis of comparison.
- chihuahua 2y agoIt was a long time ago (37 years?) but the main difference is this: The Motorola 68000 has 8 32-bit data registers and 8 32-bit address registers. They are named D0..D7 and A0..A7. You can use these in most instructions in the obvious/expected way. Maybe it's not completely orthogonal, but close enough. With those registers, you can keep 8 intermediate values and 8 pointers, and perform reasonable operations on them (add this and that, and store at that address) The 80286 instruction has just 4 16-bit registers, 4 more registers with strange names (BP, SI, DI, SP) and 4 segment registers. None of these are general-purpose. I just looked it up and apparently, you can only use AX and DX for multiply/divide instructions. The segmented addressing is what is most repulsive about the whole thing: you can't just put an address into a register. You have to use a segment register and use an offset so the real address is (segment register value)*16 + offset. The reason for all this bad design is presumably compatibility with even more primitive earlier processors (8086, 8088, 8085, 8080). All this backward compatibility is so painful and limiting. The 68k was launched in 1979 and it gets all of this right (32-bit addresses, general purpose registers), but the 8086 was launched in 1978 and it's so primitive and ugly. It reminds me of Windows which even today has certain dumb features such as "\" being the path separator for compatibility with CP/M, some primitive relic of the 1970s. I understand the importance of backward compatibility for commercial success, but it's so ugly and I just don't want to have to deal with it decades later. Yes I know that the NT kernel can theoretically use a different path separator, but in practice, we're all still using \ for paths and / for command line options. Because CP/M was so incredibly great in 1975.