[Coco] ASM Coders - please help!

David Roper dave at ebonhost.com
Mon Aug 28 23:52:26 EDT 2006


Robert Gault wrote:
> David Roper wrote:
>> <snip>
>> CLRSCRN ldy HSCLEN
>>        ldx HRESSCRN
>> CLRLOOP clr ,X+
>>        leay -1,Y
>>        bne CLRLOOP
>> ENDLOOP jmp ENDLOOP
>>   HRESSCRN equ $2000
>> HSCLEN   equ $2000
>>
>>         end START
>>
>> So!
>>
>> What I end up seeing (in MESS, at least) is a screen of alternating 
>> vertical black and green lines.. and not much else
>>
>> I'm missing something, or messed something up, or generally on the 
>> wrong track *somewhere*, and I'm sure someone out there will have 
>> much more luck explaing where, and why I've gone wrong!
>>
>> Any takers to place me under their wing?
>>
>> Kind regards,
>> David
>>
>>
>>
>
> Here's the problem. Note the ldx and ldy values which are equivalent to
>    ldy  $2000
>    ldx  $2000
> That is not what you wanted or need. What you actually will get is 
> unknown since the contents of $2000-$2001 will vary depending on what 
> is present on the hi-res graphics screen.
>
> You really need
>    ldy  #$2000
>    ldx  #$2000
> because regX is a pointer to the start of the screen and regY is a 
> counter.
>
> And by the way, the value for regY is not large enough to clear the 
> entire screen if that was intended. A 320x200x16 screen requires $7D00 
> bytes.
>
Thanks, Robert!

So the code I should be using (given that I'm using EQU's) is

ldy #HSCLEN
ldx #HRESSCRN

is that right?

Yes, I'm aware that it's not enough to clear the entire screen - if it's 
enough to get -something- plotting, I'm happy!

Apart from that, does everything else seem ok?

Kind regards,
David



More information about the Coco mailing list