Live data from Hacker News

I believe 6502 instruction set is a good first assembly language

nemanjatrifunovic.substack.com

271–280 of 297 posts

Re: I believe 6502 instruction set is a good first assembly language

#271
post #201

Earlier quoted context omitted.

Having a large body of old software and games, written for various random platforms across 20+ years is also a killer feature.

And you'd have to spend a ton of time porting to each target system. OTOH, the Z80 is better for this, because you can at least get CP/M up and running with a minimum of trouble.

With an 8088 you could port DOS (which resembles CP/M-86) though games would require more memory and a video chip. But we've kind of left true 8-bit territory at this point.

Re: I believe 6502 instruction set is a good first assembly language

#272

Earlier quoted context omitted.

RISC-V has a simple instruction encoding, but the 6502 has 151 instructions total.

Counting instructions is problematic. 6502 has 56 mnemonics, RV32I/RV32E has 37. But mnemonics are arbitrary. Are BCC, BCS, BEQ, BMI, BNE, BPL, BVC, BVS really different instructions, or just one instruction with a field specifying the condition. If you look at 8080 and Z80 assembly languages you see the same binary instructions represented with different mnemonics and some things that have different mnemonics in one…

Maybe it's just me, but I consider data "data" and addresses "addresses" rather than instructions. I do understand your point, and I'm fine with saying there are 151 opcodes/instructions.

Re: I believe 6502 instruction set is a good first assembly language

#273

Earlier quoted context omitted.

> 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…

I learned assembly on a 6809 (TRS-80 CoCo) platform. It was only later that I really appreciated how cool of a CPU it really was. It’s a shame that Tandy missed the boat on including coprocessors for game support in their computers, especially that one. If they’d just included decent audio and maybe something for sprite management it would’ve been highly competitive.

Apple II had primitive graphics and sound, but was incredibly successful.

Atari 800 featured powerful video processing with display lists and sprites, 4-channel audio, etc., but was much less successful.

As I understand it, Radio Shack did not encourage third-party software and support for its systems, not realizing that it was the key to success.

OS-9, originally a 6809 OS, seems to have survived for quite some time.

https://en.wikipedia.org/wiki/OS-9

Re: I believe 6502 instruction set is a good first assembly language

#274

Earlier quoted context omitted.

Ouch. That sounds painful. Yeah, I usually ended up writing to screen RAM at $400. It was convenient to let the kernal manage cursor position and all that, though.

Yeah, in 40 column mode, each row was separate by 320 bytes. In 80 column mode, each even character on a line was in main memory and each odd column was in the second 64K block in extended memory.

I’m certain there was a good reason for that. Woz was an engineer’s engineer. But wow, I can’t imagine what it would’ve been.

Re: I believe 6502 instruction set is a good first assembly language

#275

Earlier quoted context omitted.

I learned assembly on a 6809 (TRS-80 CoCo) platform. It was only later that I really appreciated how cool of a CPU it really was. It’s a shame that Tandy missed the boat on including coprocessors for game support in their computers, especially that one. If they’d just included decent audio and maybe something for sprite management it would’ve been highly competitive.

Apple II had primitive graphics and sound, but was incredibly successful. Atari 800 featured powerful video processing with display lists and sprites, 4-channel audio, etc., but was much less successful. As I understand it, Radio Shack did not encourage third-party software and support for its systems, not realizing that it was the key to success. OS-9, originally a 6809 OS, seems to have survived for quite some time…

Yeah, once OS-9 came out we got some decent game ports too. That’s where I discovered Epyx Rogue! It was very late in the lifespan of the system though.

C64/128 was what I was thinking of more than anything re 8-bit competition, keeping in mind I’m talking mid-late 80s by this point. I do also remember Atari 800 (and later) doing considerably better than you imply. But you’re right, Apple captured the early-mid 80s gaming market nicely.

Re: I believe 6502 instruction set is a good first assembly language

#276
post #70

I 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 68K is still a tiny bit awkward, with its 24-bit bus and alignment restrictions and middling support for indexing into arrays (no scale factor). The 68020 is about as close to C as an ISA can get - it’s extraordinarily pleasant.

The 24-bit bus means that you can use the top bits of a pointer as a tag. In a small system we don't need that much memory, this can actually be a great advantage. We are rediscovering the value of tag bits in 64-bit systems.

Re: I believe 6502 instruction set is a good first assembly language

#277

Earlier quoted context omitted.

Counting instructions is problematic. 6502 has 56 mnemonics, RV32I/RV32E has 37. But mnemonics are arbitrary. Are BCC, BCS, BEQ, BMI, BNE, BPL, BVC, BVS really different instructions, or just one instruction with a field specifying the condition. If you look at 8080 and Z80 assembly languages you see the same binary instructions represented with different mnemonics and some things that have different mnemonics in one…

Maybe it's just me, but I consider data "data" and addresses "addresses" rather than instructions. I do understand your point, and I'm fine with saying there are 151 opcodes/instructions.

Do you consider binary code patterns that do exactly the same thing except for using different register(s) to be the same or different instructions?

For example, on RISC-V `sub Rd,Rs1,Rs2` has no immediate data or addresses but can have 32768 different results on the machine state (less the 1024 with Rd = x0, and I guess the same number with Rs1 = Rs2)

Re: I believe 6502 instruction set is a good first assembly language

#278

My first program was 6800 Machine Language. My second, was 6502 (VIC-20), my first ASM was 8085. With that, I actually wrote an embedded OS. The byte order seemed strange to me, after the Motorola chips. Also, the two-part memory addressing. Eventually, I ended up doing ASM with 68000 (Mac Plus), but by then, I was well on my way with higher-level languages. Starting from Machine Language helped me a lot in understan…

[flagged]

Re: I believe 6502 instruction set is a good first assembly language

#279
post #138

Earlier quoted context omitted.

> Even getting an OS, compiler etc is not that easy. There's a GCC fork [0], macro11 [1] (GCC and clang also both have macro11 backends), ack [2] and more. Getting hold of a modern compiler is trivial. > It's kind of hard to get hold of a PDP-11 these days. The PiDP-11 [3] emulator that runs on a Pi, is fairly popular among the retro crowd. So sourcing something hardware wise that behaves that way is easily possible.…

You can find original PDP-11s in the $400-$500 range?

Through a few of the computer-oriented antique dealers, yes. Not so much online. Part of being locally located, means the device has been sitting on their shelves for over a decade without anyone even making a bid. Several would take even less.

But for a hobbyist, I'd still probably recommend something like the PiDP. Run the system and learn it, without having to take the power bill of an early machine.

Re: I believe 6502 instruction set is a good first assembly language

#280

Earlier quoted context omitted.

Lol. I've been programming assembly language since 1980, on at least (that I can remember) 6502, 6800, 6809, 680x0, z80, 8086, PDP-11, VAX, Z8000, MIPS, SPARC, PA-RISC, PowerPC, Arm32, Arm64, AVR, PIC, MSP430, SuperH, and some proprietary ISAs on custom chips. RISC-V is simply the best ISA I've ever used. It's got everything you need, without unnecessary complexity. > RISC ISAs were intended to be programmed exclusiv…

> RISC ISAs were intended to be programmed exclusively in high-level languages and never in assembly language. > That's a misunderstanding. RISC was designed to include only the instructions that high level language compilers found useful. There was never any intention to make assembly language programming difficult. That is no misunderstanding, but almost a quotation of the 4th point in the definition of the term "R…

"4. Support high-level languages (HLL). An explanation of the degree of support follows. Our intention is always to use high-level languages with RISC I."

That doesn't say anything about making it difficult to use assembly language. It speaks only to making it UNNECESSARY, to the largest extent practical.

Maybe you weren't around at the time, but I remember very clearly the literature on the software crisis and the VAX being designed to make assembly language programming as productive as possible, EVEN at the expense of raw machine speed (the VAX 11/780 was slower than the PDP 11/70), because no one trusted the performance of high level languages.

The above aim of RISC was to make a machine fast enough and easy enough for compilers to use effectively that there would seldom be a reason to move out of the more productive high level language.

Post reply on HN