chriscam Posted April 12, 2008 Share Posted April 12, 2008 Hello, First, gotta say how happy I am that you all are here! You have totally inspired me to break out my old A800 and code binge. Thank you! Hopefully you will be kind to a newbie... I have many questions but I promise not to be annoying. Ok, so, I decided to take the plunge into assembly, and am both studying and assembling the following PMG example: Assembly Language Programming for the Atari Computers, by By Mark Chasin Chapter 10, http://www.atariarchives.org/alp/chapter_10.php The Problem: Clearing out the PM area of memory doesn't really clear anything, but rather stores alot of data: The offending code: ; ****************************** ; Now clear out PM area of RAM ; ****************************** LDY #0 ;use as counter LDA #0 ;byte to be stored CLEAR STA (XLOC),Y ;clear 1st byte DEY ;is page finished? BNE CLEAR ;page not done yet INC XLOC+1 ;page is done LDA XLOC+1 ;on to next page CMP STOTOP ;are we done? BEQ CLEAR ;one more page BCC CLEAR ;keep going When I remove the above section of code, everything appears normal, meaning my little tie fighter is drawn to the screen and there are no garbage bits elsewhere in the PM area. Since this code is right out of the book, I assume it was *reasonably* tested. So, I'm at a complete loss. Anyone know what could be going on? Best regards, Chris Quote Link to comment Share on other sites More sharing options...
Fröhn Posted April 12, 2008 Share Posted April 12, 2008 Corrected: ; ****************************** ; Now clear out PM area of RAM ; ****************************** LDY #0 ;use as counter CLEAR2 LDA #0 ;byte to be stored CLEAR STA (XLOC),Y ;clear 1st byte DEY ;is page finished? BNE CLEAR ;page not done yet INC XLOC+1 ;page is done LDA XLOC+1 ;on to next page CMP STOTOP ;are we done? BEQ CLEAR2 ;one more page BCC CLEAR2 ;keep going You basically only cleared the first page, and after that filled the pages with the high byte of the page pointer. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.