Live data from Hacker News

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

news.ycombinator.com

21–30 of 71 posts

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

#23
post #16

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 the 6502 is going to bring you up hard against its addressing modes. Better IMHO to learn about memory and how to access it using arrays in BASIC first.

Depends on learning goals, as BASIC teaches people some really bad habits.

They say "one always ends up coding in whatever your first language was... regardless of what language you are using".

People could always bring up the BASIC software Rom at the end of the build if interest arises after learning how a simple computer works. =3

https://github.com/chelsea6502/BeebEater

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

#24

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

Sather's book is the most comprehensive I've ever read. He even discusses the split screen vblank trick.

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

#25

Machine Language for Beginners, Charles Mansfield https://archive.org/details/ataribooks-machine-language-for-... This book specifically targets beginners that are new to 6502 assembly. The examples cover all of the 1980s-era computers including the Apple II. It's free on archive.org and the introductory chapters are worth reading.

This is what I read as a middle schooler learning 6502 on a C64. Does a good covering the basics in a very conversational manner.

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

#26
My running joke after showing off some amazing LLM-driven work is...

if you think this is impressive, I once opened a modal dialog on an Apple IIGS in 65C816 assembly

I don't think you need to learn BASIC, if you know concepts like conditionals and looping and indexing. It is interesting to compare the higher-level language of the time with its companion assembly. And you might find yourself writing BASIC programs to complement your assembly, if you stick to that platform.

A friend dropped me a BASIC program that ran and wrote text to the Apple IIGS border. He asked me to figure it out, because it wasn't obvious what was going on. OG hacker puzzle... it was a BASIC program that jumped to hidden assembly after the apparent end of the text file (hidden chars maybe, I forget) and the assembly was changing the border at appropriate rate to "draw" on it. Those were the days... trying to find some reference to this and am failing.

I certainly credit my stack-frame debugging capability to dealing with that stuff so long ago. Oddly enough, I didn't really find it helpful for computer architecture class. Just because you know registers exists and how to manipulate them, doesn't exactly map architecting modern hardware system. But being fluent in logic operations and bit-twiddling and indexing does help a lot.

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

#27
There is "Apple Machine Language for Beginners" by Richard Mansfield https://archive.org/details/Apple_Machine_Language_for_Begin...

I have fond memories from the late 1980s of trying to get the assembler contained within this book working, typing line after line of the MLX listing in. Unfortunately I never did finish it back then.

A week or so ago I got the urge to complete this project and I literally just finished getting the source in it to a point where it can be compiled online and then within an emulator: https://github.com/jlmcgraw/LADS_DOS33

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

#28
post #18
post #15

Earlier quoted context omitted.

Seconded. I bought the first edition of "Programming the 6502" way back in the neolithic, and I enjoyed it greatly. I even read parts of it again now and then these days too, just because I like it. I used to write assembly on, at first, the AIM-65, and later the Apple II.

Is Programming the 6502 enough to learn Assembly on the Apple II ? But it doesn't explain the memory and screen management, right ? So how can we learn that ?

For that you'll need Apple II documentation - though that's device-specific information. It's easy to find online, e.g. https://nicole.express/2024/phasing-in-and-out-of-existence...., but there's lots more with various levels of info. This one, for example: https://www.kreativekorp.com/miscpages/a2info/memorymap.shtm...

For actual 6502 programming you'll need a dedicated 6502 assembly programming book, for example the aforementioned Rodney Zaks books.

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

#29
post #16

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 the 6502 is going to bring you up hard against its addressing modes. Better IMHO to learn about memory and how to access it using arrays in BASIC first.

My opinion differs - learning how memory is accessed via assembly language will make it super easy to understand e.g. how C pointers actually work, something which can be surprisingly difficult for those who go directly to a high level (compared to assembly) language, but very easy if you come from machine code/assembly.

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

#30
No, you don't need to learn BASIC before assembly, but many books of the time went that route, e.g.,

https://www.goodreads.com/en/book/show/5011686-apple-machine...

Here is an interesting article on porting a BASIC game for the Apple II to GW BASIC:

https://nanochess.org/akalabeth.html

and it includes a link to the documented source code for Akalabeth (also known as Ultima 0)

Somewhere, there's an article discussing the assembly-language like bit-blitting used to draw the high-res graphics in a timely fashion and the variable/memory management techniques needed to drive that which I'm sure a bit of searching will turn up (or one can derive it from the source).

Post reply on HN