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

Re: Assembly Language example

> Hello.
> If I had a led hooked to gpio Port A pin1(ball W1).
> How can I toggle the led in assembly language.
> A assembly language example of how to set data direction registers
> and write to the port would be very appreciated.
> Brian

Here's a small loop I sometimes use for debugingpurpose with the LX 
devboard. Makes the yellow led flash.

	move.d 0x7F, $r0		; FLASH LEDS *FAST* (for debug)
	move.b $r0, [R_PORT_PA_DIR]
1:	move.b 255, $r0
	move.b $r0, [R_PORT_PA_DATA]
	move.b 0, $r0
	move.b $r0, [R_PORT_PA_DATA]
	ba 1b

/Ronny Nilsson