Re: A92: Re: keyb matrix


[Prev][Next][Index][Thread]

Re: A92: Re: keyb matrix




Klaus wrote:
> 
> ...
> Getkey:
> movem.l d0-d1/a0,-(a7)
> lea keystat(pc),a0
> move.w #$FFFE,d0
> move.w #9,d1
> GetKeys:
> move.w d0,$600018
> nop
> nop
> nop
> nop
> nop
> nop
> nop
> nop
> nop
> move.b $60001B,(a0)+
> rol.w #1,d0
> dbra.w d1,GetKeys
> movem.l (a7)+,d0-d1/a0
> rts
> 

Use
	move.l (a7),(a7)
	move.l (a7),(a7)
	move.l (a7),(a7)
instead of the NOPs. It's a little bit smaller, since the move-
instructions take more time. 
Redirection could be done by more effectively by making all
vectors point to the _same_ rte. (everything else would be 
memory wasting). Instead of redirecting all those ints, you
could just switch them off by:

	move.w	#$700,d0
	trap	#1		; switch off interrupts, old state: d0
	
	...			;(don't change d0!)

	trap	#1		; restore interrupts


References: