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

📄 rand16i.asm

📁 CCS3.3自带的TI 5400系列DSP的dsplib文件。文档说明可以在TI公司网站上下载。
💻 ASM
字号:
;***********************************************************
; Version 2.20.01                                           
;***********************************************************
;****************************************************************
;  Filename:	rand16init.asm
;  Description: initializes random number generator for rand16
;----------------------------------------------------------------
;  Synopsis:
;
;  void rand16init(void)
;                                                              
;----------------------------------------------------------------
;  Description
;
;     Initializes seed for 16 bit random number generation routine
;----------------------------------------------------------------
;  Algorithm
;
;-----------------------------------------------------------------------------
;  Benchmarks
;
;  cycles	:	7    cycles		(core)
;			
;			add 1 cycle when far mode is selected
;
;  code size	:	5 words
;
;-----------------------------------------------------------------------------
;  Revision History:
;  0.0         	Eric West       09/30/93   Original Draft   
;  0.001       	Alex Tessarolo  01/03/96   Optimized code
;  1.0		Jeff Axelrod	08/31/98   Vectorized code.
;-----------------------------------------------------------------------------

	.mmregs

;-----------------------------------------------------------------------------
; Reserve space in DATA memory for seed 
;-----------------------------------------------------------------------------
 .bss rndnum,1 
 .def rndnum
	
;-----------------------------------------------------------------------------
; DEFINE CONSTANTS:
;-----------------------------------------------------------------------------

RNDSEED .set    21845           ; seed value (i.e. rndnum(1) = 21845)
RNDMULT	.set	31821		; Multiplier value
RNDINC	.set	13849		; Increment value

;-----------------------------------------------------------------------------
; Initialize Random Number Generator -	Load the SEED value
;-----------------------------------------------------------------------------

	.def	_rand16init
	.text

_rand16init:
	ld 	#RNDSEED,a	; 2 cycles

	.if __far_mode
	fretd			; 4 cycles
	.else
	retd			; 3 cycle
	.endif
	stl	a,*(rndnum)	; 2 cycles, delay slot;  rndnum = RNDSEED  load seed value

;end of file. please do not remove. it is left here to ensure that no lines of code are removed by any editor

	

⌨️ 快捷键说明

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