?? lfdips.asm
字號(hào):
;*********************************************************************
; File Name: lfdips.asm
; Target System: C24x Evaluation Board
;
; Description: This sample program demonstrates fetching data from
; I/O space from the DIP switches and then sending the
; data back to I/O space to the LEDs on the F240
; EVM Development Board
;
; The state of the LED (ON/OFF) reflects the state of
; the corresponding DIP switch.
;
; Revision: 1.00
;
;*********************************************************************
.include 240x.h
;---------------------------------------------------------------------
; I/O Mapped EVM Register Declarations
;---------------------------------------------------------------------
SWITCHES .set 0008h ;DIP Switch Register
LEDS .set 000Ch ;LEDs Register
temp .set 8000h
;---------------------------------------------------------------------
; Variable Declarations for on chip RAM Blocks
;---------------------------------------------------------------------
.bss GPR0,1 ;General purpose register.
.bss LED_STATUS,1 ;LED Status Register
.bss SW_STATUS,1 ;DIP Switch Status Register
;===========================================================================================
; V E C T O R T A B L E ( including RT monitor traps )
;===========================================================================================
.copy "vector.h"
;==========================================================================================
; M A I N C O D E - starts here
;==========================================================================================
.text
START: LDP #0h
SETC INTM ;Disable interrupts
SETC CNF
SPLK #0h, IMR ;Mask all INTs
LACC IFR ;Read Interrupt flags
SACL IFR ;Clear all interrupt flags
CLRC SXM ;Clear Sign Extension Mode
CLRC OVM ;Reset Overflow Mode
CLRC CNF ;Config Block B0 to Data mem.
LDP #00E0h
SPLK #0285h, SCSR1 ; x2 PLL, ADC en, EV1 en, clr Ill Addr flg
SPLK #006Fh, WDCR ;Disable WD if VCCP=5V
KICK_DOG
SPLK #0h, GPR0 ;Set 1 wait states for I/O space
OUT GPR0, WSGR
LOOP IN SW_STATUS,SWITCHES ;Get the status of each DIP switch
LACC SW_STATUS ;Load the status into the accumulator
SACL LED_STATUS ;Store the DIP status into the LEDs status
OUT LED_STATUS,LEDS ;Output the DIP status to the LEDS
B LOOP ; A DIP that is on will turn on the
; corresponding LED
; A DIP that is off will turn off the
; corresponding LED
;=====================================================================
; I S R - PHANTOM
;
; Description: Dummy ISR, used to trap spurious interrupts.
;
; Modifies: Nothing
;
; Last Update: 16 June 95
;=====================================================================
PHANTOM KICK_DOG ;Resets WD counter
B PHANTOM
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -