Live data from Hacker News

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

news.ycombinator.com

41–50 of 71 posts

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

#41
post #31
post #28

Earlier quoted context omitted.

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…

Is the Apple II Reference Manual good for that ? Or anything specific to the Apple II, like "What's Where in the Apple" or "Understanding the Apple II" ?

All of those are quite useful.

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

#42

I'm seconding the recommendation to look at Rodnay Zack's books. For example, I really enjoyed Advanced 6502 Programming. It's a project-based tutorial for a custom 6502 machine. The design and schematics are in the book. https://archive.org/details/Advanced_6502_Programming/mode/2...

WRT advanced 6502 programming texts, allow me plug my (free) book "EOR #$FF: 6502 Ponderables and Befuddlements". It's 64 assembly snippets to ponder, with explanations for each in the 2nd-half of the book: https://archive.org/details/eor6502

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

#44

They screen memory layout on the Apple II was a clever hardware hack but makes programming the machine more difficult. I think you'd be better off using a "trainer", like a KIM-1 simulator [0] to get your feet wet. (The KIM-1 was made by MOS Technologies, manufacturers of the 6502, as a demonstration and prototyping platform for the CPU.) If you can do simple exercises on a machine like that and get comfortable with…

If you aren't doing hires graphics, you don't have to mess with the screen memory directly. You can just call the ROM routines which has the nice side effect of working with 40- or 80-columns automatically. If you are doing hires graphics you are going to use a lookup table regardless as doing the multiplication to get the base address of a particular scanline is far too slow. You can, one time, either make a table manually, which you can use forever, or you can write a short routine that counts from 0 to 191, stick 0 in X and the scanline number in A and JSR $F411. It'll leave the base address of the scanline in $36 and $37. Which you can stick in your table.

As in other comments, if you are specifically interested in the Apple II line, the Assembly Lines books by Roger Wagner is fantastic.

Also, if you can find it Sandy Mossberg's Disassembly Lines articles in Nibble magazine were great too. Start with Assembly Lines, then read the Disassembly Lines and you'll be quite expert.

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

#45

Next to a book on 6502 assembly, you can google "apple 2 original system manual" and download it. I contains ROM assembly source code and schematics.

"reference manual" I think is what you mean. This is a link to a PDF pf the reference manual that includes the ROM disassembly: http://cini.classiccmp.org/pdf/Apple/Apple%20II%20Reference%...

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

#46
post #8

The answer would depend on what programming experience you have? Do you have any assembly language experience ? with other targets? ie have you used an assembler ( and maybe linker ) before. Are you familiar with hex? bytes, bits etc , You will learn this and much more ... Id look for a book that targets Assembly programming on a Apple 2, ie not a book on general 6502 programming. Such a book Id expect to discuss thi…

I have litteraly no programming experience, that's partly why I want to learn 6502 Assembly.

Assembly is a type of programming that is unlike most programming languages, and as such, would be a really tough introduction to the field.

Can you explain a bit more about how you became interested in assembly and programming the Apple II? And specifically, why you want to start the journey towards programming there?

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

#47
post #32

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…

I second this -- I just found the Ben Eater series a month or so ago and put together his computer clock over the holidays. It really helps you understand clock cycles, logic chips, etc, and is a good foundation for the 6502 kit you build later in the course. And learning Assembly before BASIC is the right learning path IMO, if only to understand how CPU registers work at the electron level.

If one is interested in how internal PC registers work, than these build series do the classic eeprom microcode based CPU builds. Fabian's series is highly accessible, and builds a python based assembler from scratch. James series ends with a simple game design.

Cheers, =3

"Build a Superscalar CPU" (Fabian Schuiki)

https://www.youtube.com/watch?v=bwjMLyBU4RU&list=PLyR4neQXqQ...

https://github.com/fabianschuiki/superscalar-cpu

"Making an 8 Bit pipelined CPU" (James Sharman)

https://www.youtube.com/watch?v=3iHag4k4yEg&list=PLFhc0MFC8M...

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

#48
post #20
post #19

Earlier quoted context omitted.

Google can be very helpful for these types of queries: https://www.google.com/search?q=apple+2+game+programming+tut... Formulating questions is a valuable skill as is finding existing resources. As some one from that era, it is truly amazing how much information there is online about all aspects of 8 bit computers

I don't think online tutorials are a good ressources to learn programming. We just have to look at what juniors can do nowadays (they can't even write a simple program, and I'm from that generation). That's why I asked for books.

You don't have any programming experience, and yet hold strong opinions on good resources to learn programming? There's some wonderful book recommendations in this thread, but I wouldn't underestimate how much great long-form content and tutorials there are on the Web these days (vs just learning by copying snippets off StackExchange)

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

#50
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 ?

https://mmphosis.netlify.app/hires/
Post reply on HN