MEGA65 / mega65-user-guide

MEGA65 User Guide
75 stars 51 forks source link

Errors in assembly snippets for dma controller use #140

Closed woepaul closed 3 years ago

woepaul commented 3 years ago

The code for pushing the dmalist address into $D700-$D701 looks wrong. See https://github.com/MEGA65/mega65-user-guide/blob/aa53f224943e217b7d12158397b1948cf1b2fcaa/appendix-dmagic.tex#L192-L195 Instead shouldn't it be

  LDA #>dmalist  ; Set MSB of DMA list address
  STA $D701 
  LDA #<dmalist  ; Set LSB of DMA list address, and execute DMA
  STA $D700

(Note the #<dmalist in the second store) The same mistake can also be found later: https://github.com/MEGA65/mega65-user-guide/blob/aa53f224943e217b7d12158397b1948cf1b2fcaa/appendix-dmagic.tex#L219 and https://github.com/MEGA65/mega65-user-guide/blob/aa53f224943e217b7d12158397b1948cf1b2fcaa/appendix-dmagic.tex#L257

@gardners please let me know if this is really a bug in the example or if I'm misinterpreting the assembly syntax.

gardners commented 3 years ago

Well spotted. This is indeed an error.