⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 first.s

📁 我自己编译使用的dspic源代码.简单实用.
💻 S
字号:
;------------------------------------------------------------------------------
; Write LCD with text using PSV feature and flash LED1 with a Timer1 loop
;------------------------------------------------------------------------------

	.equ __30F4011, 1
	.include "p30F4011.inc"

;------------------------------------------------------------------------------
;Global Declarations:

    .global __reset			    ;The label for the first line of code. 
 	.global	__OscillatorFail	;Declare Oscillator Fail trap routine label
 	.global	__AddressError		;Declare Address Error trap routine label
	.global	__StackError		;Declare Stack Error trap routine label
	.global	__MathError		    ;Declare Math Error trap routine label

;------------------------------------------------------------------------------
;Data Declarations in near data space
	   .section .nbss
  


;------------------------------------------------------------------------------
;Program Specific Constants (literals used in code)

	.equ	Fcy, #7372800

;------------------------------------------------------------------------------
;Start of code

	.text				;Start of Code section
__reset:    mov	 #__SP_init,w15 ;Initalize the Stack Pointer
	        mov	 #__SPLIM_init,w0
	        mov	 w0,SPLIM	    ;Initialize the Stack Pointer Limit Register
	        nop			        ;Add NOP to follow SPLIM initialization
	        
;------------------------------------------------------------------------------
;Initialize LED outputs on PORTD bits 0-4

loop1:	        mov	 #0x0,w0  ;Initialize LED pin data to off state
	        mov	 w0,LATE
	        mov	 #0x0000,w0  ;Set LED pins as outputs
            mov	 w0,TRISE
            bset LATE,#RE0	 ;Turn LED1 on
			bset LATE,#RE1
			bset LATE,#RE2	
			bset LATE,#RE3
			bset LATE,#RE4
			bset LATE,#RE5
            bclr LATE,#RE0	 ;Turn LED1 on
			bclr LATE,#RE1
			bclr LATE,#RE2	
			bclr LATE,#RE3
			bclr LATE,#RE4
			bclr LATE,#RE5
			

			nop
			bra loop1
			nop
			nop

	.end				;End of code in this file

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -