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

📄 brnch.asm

📁 lf2407自检源代码
💻 ASM
字号:
	.title "TMS320C2xx PROCESSOR SELFCHECK -- BRANCH INSTRUCTIONS TEST"
	.length 60
	.width 120
	.option X
************************************************************
*                                                          *
* BRANCH INSTRUCTIONS TEST                                 *
*                                                          *
* This routine checks various branch instructions.         *
*                                                          *
* Written by David M. Alter                                *
*            member technical staff                        *
*            Texas Instruments Inc.                        *
*                                                          *
* Release Version 1.0                                      *
*                                                          *
************************************************************
	.def    brnch
	.nolist
	.copy   "options.h"
	.copy   "memmap.h"
	.list
	
		 
	.text
brnch: .set    $+SS

;test BACC instruction
	LACC    #brnch1         ;ACC points to branch1
	BACC                    ;branch to branch1
	B       erbrnch         ;error if previous didn't branch

;test BANZ instruction
brnch1: .set   $+SS
	LAR     AR0,#1h         ;AR0 = 1h
	LAR     AR1,#0h         ;AR1 = 0h
	MAR     *,AR0           ;ARP --> AR0
	BANZ    brnch2,*,AR1    ;branch to brnch2
	B       erbrnch         ;error if previous didn't branch
brnch2: .set   $+SS
	BANZ    erbrnch,*       ;error if branch taken here

;test CALA instruction
	LACC    #brnchsub       ;ACC points to brnchsub subroutine
	CALA                    ;call brnchsub subroutine
	BCND    erbrnch,NEQ     ;if ACC != 0 then error

;test CC instruction
	LACL    #1h             ;ACC = 1h
	CC      brnchsub,NEQ    ;call brnchsub
	BCND    erbrnch,NEQ     ;if ACC != 0 then error

;test RETC instruction
	RETC    EQ              ;test passes

*
* ERROR HANDLERS
*

erbrnch: .set    $+SS
	LACL    #40h            ;branch instructions error
	RET                     ;test fails


	.page
************************************************************
*                                                          *
* SUBROUTINE brnchsub                                      *
*                                                          *
* This subroutine clears the accumulator and returns.      *
*                                                          *
************************************************************

brnchsub: .set    $+SS
	LACL    #0h             ;ACC = 0
	RET

⌨️ 快捷键说明

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