Live data from Hacker News

Ask HN: Books to learn 6502 ASM and the Apple II

news.ycombinator.com

51–60 of 71 posts

Re: Ask HN: Books to learn 6502 ASM and the Apple II

#51
post #12

Earlier quoted context omitted.

Much easier to start with BASIC. After all, why not?

I respectfully disagree, BASIC/Java/Arduino hides too much about how the CPU works from users. Getting a 6502 kit from Ben Eater, and walking though how the CPU works will implicitly show how languages abstracted away whats actually happening. And more importantly, the skills necessary to understand how to write efficient programs. https://www.youtube.com/watch?v=LnzuMJLZRdU&list=PLowKtXNTBy... https://eater.net/6502…

Starting with Assembly is simply a bad idea because the tooling is terrible, and the learning curve of the tooling is steep. Filled with arcane codes and abbreviations and workflow right out the gate.

Programming concepts are pretty much universal. Being distanced from computer architecture is not a limitation for novice programmers, Python et al succeeds for a reason.

If you're determined to start with assembly, then I hope you can find someone to help you get started with all the machinations necessary to get from LDA #0 to A9 00 with as little drama as possible. Someone to show you how to use the assembler, what the directives mean, the linker, a symbolic debugger (if you're lucky). Someone to provide you with a .DUMPREG "START OF SORT" and .DUMPMEM BUFF $80 "AFTER INPUT" macros that you can liberally scatter throughout your code so you actually progress and get some insight into what the heck you code is doing. Perhaps some way to stop your programs that doesn't include hitting the reset button on the machine.

I mention that because, again, the tooling is terrible. All of the is easier said than done. None of the assembly books address this, none of the assembly program reference guides do either. Assembly is VERY black box. It's a large step up to even get started.

It's much easier to "learn programming" first at a higher level, where you can quickly progress and succeed, before turning into the dark hole that is assembly, particularly on older machines.

At least on a KIM-1 you can hit the STOP button and cursor through memory (being conscious that the memory architecture of the KIM is quite funky), something that simple is quite difficult on an Apple ][.

Re: Ask HN: Books to learn 6502 ASM and the Apple II

#52

For Apple-II specific info, consider The Assembly Lines book -- https://archive.org/details/AssemblyLinesCompleteWagner Understanding the Apple IIe -- https://archive.org/details/understandingapp0000sath Understanding the Apple II -- https://archive.org/details/understanding_the_apple_ii

As mentioned in the link above, Assembly Lines is still in print as a paper book (maybe it's print on demand, but it's a hardcover).

I just noticed that Understanding the Apple IIe also got a re-issue from Call-A.P.P.L.E. in 2024 (print edition from Lulu) - https://www.callapple.org/books-3/understanding-the-apple-ii... .

Re: Ask HN: Books to learn 6502 ASM and the Apple II

#53
There are a few distinct things here. Learning 6502 assembly is straightforward, and you'd be better learning about simple (not modern) assembly languages at a high level--opcodes, registers, noop, branch, jump, compare, accumulators, program counters, and clock cycles. From there, start writing 6502 in an emulator and seeing what happens. That's where you're going to learn, and the feedback will be a lot faster. Programming for an Apple II will be more about learning how to interact with devices through memory.

Re: Ask HN: Books to learn 6502 ASM and the Apple II

#54

There are a few distinct things here. Learning 6502 assembly is straightforward, and you'd be better learning about simple (not modern) assembly languages at a high level--opcodes, registers, noop, branch, jump, compare, accumulators, program counters, and clock cycles. From there, start writing 6502 in an emulator and seeing what happens. That's where you're going to learn, and the feedback will be a lot faster. Pro…

When you say 'start writing 6502 in an emulator', do you mean a couple emulator like py65, and not a system emulator like Elkulator?

Re: Ask HN: Books to learn 6502 ASM and the Apple II

#55
You don't need to learn BASIC first but it might be helpful for bootstrapping at the beginning. Since it's included in the computer you can PEEK and POKE memory locations from BASIC and get a feel for how memory and machine code works without needing to understand the whole entire hardware, bootloading process, etc. first.

In my opinion BASIC, with its line numbers and GOTO / GOSUB feels assembly-ish anyway - you'll be doing a lot of JMP / JSR to control program flow which is different to how modern high levels are normally written.

Re: Ask HN: Books to learn 6502 ASM and the Apple II

#56

Earlier quoted context omitted.

I respectfully disagree, BASIC/Java/Arduino hides too much about how the CPU works from users. Getting a 6502 kit from Ben Eater, and walking though how the CPU works will implicitly show how languages abstracted away whats actually happening. And more importantly, the skills necessary to understand how to write efficient programs. https://www.youtube.com/watch?v=LnzuMJLZRdU&list=PLowKtXNTBy... https://eater.net/6502…

Starting with Assembly is simply a bad idea because the tooling is terrible, and the learning curve of the tooling is steep. Filled with arcane codes and abbreviations and workflow right out the gate. Programming concepts are pretty much universal. Being distanced from computer architecture is not a limitation for novice programmers, Python et al succeeds for a reason. If you're determined to start with assembly, the…

In general, Assembly for a simple well documented CPU is fairly close to most familiar calculator operations, and is demonstrated as a 1 to 1 relationship in the binary firmware. If folks drop on abstractions like Scratch/Basic/Python/Java the students will develop a random notion of what Register/Stack/Heap even means.

I would recommend looking at a few random samples of Ben's build series, as he covers most first year subjects in subtle efficient ways.

Soldering kit PCB or Emulators are insufficient to demonstrate a physical bus wire harness, clock timing, and memory layout. Best of luck =3

Re: Ask HN: Books to learn 6502 ASM and the Apple II

#57
6502 Assembly Language Programming by Leventhal.

This is how I learned. This book is great. I have the worn paper copy sitting 6 feet behind me as I type this. It's worth getting a paper copy if that is still possible.

https://archive.org/details/6502-assembly-language-programmi...

Re: Ask HN: Books to learn 6502 ASM and the Apple II

#58
Honestly if you want to learn retro stuff for retro reasons... maybe consider using the retro materials? Here's the MOS programming manual for the original parts, it's what Woz would have used when hand-assembling Integer BASIC:

https://archive.org/details/mos_microcomputers_programming_m...

And it's really not so complicated! The chip is simple, so the docs are simple. There's more to read about the history to come later, but there's also something to be said for understanding it in the context its designers presented it.

Re: Ask HN: Books to learn 6502 ASM and the Apple II

#60
I strongly recommend "What's Where in the Apple": https://archive.org/details/whatswhereinappl0000lueb I loved that book back in the day. Specific, directly addressable memory locations are mapped to system devices in a way that is quite foreign and Wild West when compared to modern computer architectures.
Post reply on HN