Very useful extensive tutorial for anyone who wants to start out with asm. Although it's very beginner-friendly, I'd recommend using this in combination with Ersanio's two tutorials on asm, and experimenting with the various sprite codes on the site.
I've noticed a flaw at page 118 talking about MVN/MVP, when setting it up, the LDA #$XXXX is actually XXXX is the number of bytes, plus 1 (example: LDA #$0000 means 1 byte transferred, LDA #$0001 means 2 bytes, and so on). Meaning:
Code
REP #$30 ; set A/X/Y to 16-bit mode 2
LDA #$0010 ; size = 0x10 bytes
LDX #$8010 ; source = $xx8010
LDY #$2000 ; dest = $xx2000
MVN $007E ; initiate transfer from $008010 -> $7E2000
SEP #$30 ; send A/X/Y back to 8-bit mode
is incorrect. This will transfer 0x11 bytes, from $8010-$8020 (not $8010-801F) to $2000-$2010 (not $2000-$200F).
This is because most numbers start at 0 when dealing with things like indexing (like 0-based numbering), for tables, for example have 2 bytes, their indexes aren't 1 and 2, but rather 0 and 1. With 16-bit numbers, multiply them by 2 (0*2=0 and 1*2=2).
Huge thanks to our ASM Workshop teachers for their contributions to this wonderful compilation, and special thanks to Major Flare for compiling the document itself - it's great to finally have this thing in the section proper.
In my personal and honest opinion, this document isn't terribly well suited for teaching a beginner from scratch. It makes for an excellent companion document to reinforce lessons learned from elsewhere, but many of the the earlier lessons tend to move very quickly and/or broach intermediate concepts like addressing modes and processor flags with the promise of "to be described later." And to be perfectly fair they are, and their mention makes sense as they are core concepts, but their early introduction in the asides gets to be confusing for someone who just learned what CMP is.
Where I feel this document truly shines is in reinforcing intermediate concepts, and helping intermediate-level coders start to understand and master the advanced topics. The coverage of stack manipulation and (H)DMA, the in-depth look into memory mapping and screen rendering, many higher-level topics are laid out very comprehensively (there are some neat tools and visual aids linked in the document, too).
Be aware that in many respects this document is still a transcript of the workshop itself - there are instances of exercises without answers, or other minor oddities that reflect the relatively extemporaneous nature of a live presentation. I could only find two outright technical errors in the document - the HDMA example code on Page 107 contains an unnecessary REP #$20, and Page 122 incorrectly claims that 4 NOPs is equivalent to 16 cycles (which would be 8 NOPs).
I don't know if this document directly mentions that if you ADC/SBC, it does affect the carry flag depending if it unsigned overflow or underflow. If A goes past the maxiumum using ADC, it sets the carry, and if SBC makes A go less than 0, then it clears the carry. I think INC and DEC does not touch the carry flag.
Follow Us On