[Coco] ASM Coders - please help!

William Astle lost at l-w.ca
Tue Aug 29 01:31:02 EDT 2006

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 

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. :)

William Astle
finger lost at l-w.ca for further information

Geek Code V3.12: GCS/M/S d- s+:+ !a C++ UL++++$ P++ L+++ !E W++ !N w---
!D !M PS PE V-- Y+ PGP t+@ 5++ X !R tv+@ b+++@ !DI D? G e++ h+ y?

More information about the Coco mailing list