; ; ================================================== ; ; LEDS2P.asm Blinking Led File ; ; Version: 1.0 Released 10/10/2002 ; Author: Gary Karnes ; Compiler: As12 ; Platform: Axiom CML12S ; Purpose: Blink a Led ; ================================================== ; Hardware ; Four Led's with cathode's connected by ; four 1k resistor to ground ; Led anode's connected to Port K bits 0 thru 3. ; ; Blinking Led's ; ; PORTK: equ $32 ; port K data DDRK: equ $33 ; port K direction LED1: equ $01 ; LED 1 select LED2: equ $02 ; LED 2 select LED3: equ $04 ; LED 3 select LED4: equ $08 ; LED 4 select org $1000 ; Setup port K MAIN: movb #$0F,DDRK ; bits 0-3 as outputs bclr PORTK,LED1+LED2+LED3+LED4 ; all bits low jsr DELAY ; ; LED one bset PORTK,LED1 ; LED one On jsr DELAY bclr PORTK,LED1 ; LED one Off jsr DELAY ; LED two bset PORTK,LED2 ; LED two On jsr DELAY bclr PORTK,LED2 ; LED two Off jsr DELAY ; LED three bset PORTK,LED3 ; LED three On jsr DELAY bclr PORTK,LED3 ; LED three Off jsr DELAY ; LED four bset PORTK,LED4 ; LED four On jsr DELAY bclr PORTK,LED4 ; LED four Off jsr DELAY jmp MAIN ; start over ; ; Delay subroutine DELAY: ldab #$0F DELAYL1: ldx #$ffff DELAYL: dbne X,DELAYL dbne B,DELAYL1 rts end