*
* ==================================================
*
*   LEDB1P.asm      Blinking LED BAR  
*                                 
*   Version:        1.0   Released 10/09/2002
*   Author:         Gary Karnes 
*   Compiler:       As11
*   Platform:       Axiom CME11E9-EVBU
*   Purpose:        Blink a BAR  
*   Useage:         Example
* ==================================================11
*  Hardware
*   LED BAR with cathode connected thru resistor to ground
*   LED BAR anode connected to PB4 PB5 PB6 PB7
*
* Four Blinking LED BARS
* Using Port B bit 4 thru 7
*          equates
*   File LEDB1P.asm 
* Using Port B bit 4 thru 7
*          equates
PORTB:     equ $1004
LEDB1:     equ $10         * PB4 select 
LEDB2:     equ $20         * PB5 select
LEDB3:     equ $40         * PB6 select
LEDB4:     equ $80         * PB7 select
*
           org $0100
*
Main:
           ldx  #PORTB     * load x with address of PortB
           bclr 0,x LEDB1+LEDB2+LEDB3+LEDB4   * turn all LEDS off
LB1ON:                          
           bset 0,x LEDB1     * turn led one on
           bsr  Delay 
LB1OFF:                   
           bclr 0,x LEDB1  * turn led two off
           bsr  Delay 
* Turn on Led Two
LB2ON:                     
           bset 0,x LEDB2  * turn led two on
           bsr  Delay 

*
* Turn off Led Two
LB2OFF:                   
           bclr 0,x LEDB2  * turn led two off
           bsr  Delay           
LB3ON:                     
           bset 0,x LEDB3  * turn led three on
           bsr  Delay 
LB3OFF:                   
           bclr 0,x LEDB3  * turn led three off
           bsr  Delay           
LB4ON:                     
           bset 0,x LEDB4  * turn led 4 on
           bsr  Delay 
LB4OFF:                    
           bclr 0,x LEDB4  * turn led 4 off
           bsr  Delay 
           bra  Main       * loop forever
*               
* Delay     
Delay:
           ldy  #$ffff      
DelayA:
           dey
           bne  DelayA
           rts             * return 
*
