OpenCores
URL https://opencores.org/ocsvn/m65c02/m65c02/trunk

Subversion Repositories m65c02

[/] [m65c02/] [trunk/] [Src/] [M65C02-Test-Programs/] [M65C02_Tst5.a65] - Rev 2

Compare with Previous | Blame | View Log

BROM_Start  equ     $F800

SPI_CR      equ     $F7FF

ZP_LED_Cntr equ     $00FD
ZP_Cntr_Lo  equ     $00FE
ZP_Cntr_Hi  equ     $00FF

            bss
;;
Zero_Page:  org     $0000
;;
Stack_Page: org     $0100
;;
RAM_Start:  org     $0200
;;
            code
            org     BROM_Start
;;
Start:      lda     #$00            ;; load initial value to control register
            sta     ZP_LED_Cntr
            sta     SPI_CR          ;; update LEDs
;;
Delay_Loop: ldy     #$04            ;; load outer delay loop counter
            sty     ZP_Cntr_Hi
;;
Delay_Lp1:  ldx     #$00            ;; load inner delay loop counter
            stx     ZP_Cntr_Lo
;;
;Delay_Lp2:  dex                     ;; decrement inner loop counter
Delay_Lp2:  dec     ZP_Cntr_Lo      ;; decrement inner loop counter
            bne     Delay_Lp2       ;; loop until inner loop counter is zero
;;
;            dey                     ;; decrement external loop counter
            dec     ZP_Cntr_Hi
            bne     Delay_Lp1       ;; loop until outer loop counter is zero
;;
;            dec     a               ;; decrement accumulator
            dec     ZP_LED_Cntr
            lda     ZP_LED_Cntr
            sta     SPI_CR          ;; update LEDs

            bra     Delay_Loop      ;; Loop Continously
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
Last_Addrs:
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;  Vector Table
;;
Vect_Table: org     $FFFA
;;
            dw      Start       ;; NMI Interrupt Vector
            dw      Start       ;; Reset Vector
            dw      Start       ;; IRQ/BRK Interrupt Vector
;;
            end     Start

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.