#include "C:\miniide\hcs12.inc" org $1000 org $1500 movb #$FF,DDRB ; configure port B for output bset DDRJ,$02 ; configure PJ1 pin for output bclr PTJ,$02 ; enable LEDs to light forever ldaa #16 ; initialize loop count to 8 ldx #led_tab ; Use X as the pointer to LED pattern table led_lp movb 1,x+,PORTB ; turn on one LED ldy #5 ; wait for half a second jsr delayby100ms ; " dbne a,led_lp ; reach the end of the table yet? bra forever ; start from beginning led_tab dc.b $80,$40,$20,$10,$08,$04,$02,$01 dc.b $01,$02,$04,$08,$10,$20,$40,$80 #include "C:\miniide\delay.asm" end