[Coco] ASM Coders - please help!
David Roper
dave at ebonhost.com
Tue Aug 29 03:57:09 EDT 2006
William Astle wrote:
> David Roper wrote:
>> orcc #$50
>> lda #$30 first block of graphics screen at $60000
>> sta $FFA1 mapped to $2000
>> andcc #$AF
>
> Since someone else already corrected the X/Y loading problem, I'll
> comment on the above:
>
> The CC operations are actually spurious and not needed. You only need
> to disable interrupts if you are switching the stack and/or the
> interrupt handlers out of the logical address space. Since you're
> moving only $2000-$3FFF, you're not going to be touching either unless
> someone has loaded something odd before you run your code.
>
> Also, note that you are reenabling interrupts immediately after
> swapping the memory block. That's rather pointless as it turns the two
> CC operations into essentially NOPs because there is no possible
> danger to switching the MMU with interrupts enabled except as noted in
> my previous paragraph.
>
> Also, from an "optimizing the initialization code" point of view, I'd
> probably use U for the index register and X for the counter. Saves 1
> byte of code. (LDU opcode is 1 byte, LDY opcode is 2). Of course,
> optimizing that case is rather pointless. Of course, if you were using
> U for something else before, that would be a different story. :)
>
Hi William,
Thankyou for your comments - this sort of information is invaluable, and
almost impossible to find in books!
Do you mind if I fire other questions towards you when and if they arise?
Once I've had a chance to rework my code, I'll post an updated copy,
just for the record :P
Once again, thanks William - and Robert too!
Kind regards,
David
More information about the Coco
mailing list