📄 data_log.asm
字号:
;====================================================================================
; File Name: Data_log.asm
; Module Name: DATA_LOG
;
; Initialization Routine: DATA_LOG_INIT
;
; Description: Stores the realtime values of two user selectable s/w
; variables in the external data RAM provided on the 24x/24xx
; EVM. Two s/w variables are selected by configuring two
; module inputs, dlog_iptr1 and dlog_iptr2, point to the
; address of the two variables. The starting addresses of the
; two RAM locations, where the data values are stored, are set
; to 8000h and 8400h. Each section allows logging of 400 data
; values.
;
; |~~~~~~~~~~~~~~~~~~~~~~~|
; dlog_iptr1 o------>| |
; dlog_iptr2 o------>| DATA_LOG/ Data RAM |
; o------>| |
; |_______________________|
;
;
; Target dependency: C2xx core only
;
;===========================================================================
;Module definitions for external reference.
.def DATA_LOG, DATA_LOG_INIT ;function call
.def input1,input2,input3,input4
; .def dlog_iptr2, dlog_iptr3, dlog_iptr4 ;Inputs
;===========================================================================
.include x24x_app.h
address1 .usect "table1",1000
address2 .usect "table2",1000
address3 .usect "table3",1000
;address4 .usect "table4",1000
start_adr .usect "data_log",1
length .usect "data_log",1
counter .usect "data_log",1
input1 .usect "data_log",1
input2 .usect "data_log",1
input3 .usect "data_log",1
input4 .usect "data_log",1
gezhi .usect "data_log",1 ;ge duo shao ge dian
;chuan yi ci shu
;-----------------------------------------------------------------------------
DATA_LOG_INIT:
;-----------------------------------------------------------------------------
LDP #length
SPLK #0,input1
SPLK #0,input2
SPLK #0,input3
SPLK #0,input4
SPLK #0,counter
SPLK #1000,length
SPLK #11110,start_adr
SPLK #0,gezhi
LAR AR3,#address1
LAR AR4,#address2
LAR AR5,#address3
; LAR AR6,#address4
RET
;---------------------------------------------------------------------------------
DATA_LOG:
;---------------------------------------------------------------------------------
LDP #gezhi
LACC gezhi
ADD #1
SACL gezhi
SUB #0 ;ge duo shao ge zhi lai cun shu
BCND P1, LT
NOP
SPLK #0,gezhi
LDP #counter
LACC counter
ADD #1
SACL counter
SUB start_adr
BCND P1,LT
NOP
NOP
SUB length
BCND P2,GEQ
MAR *,AR3
LACC input1
SACL *+
NOP
NOP
MAR *,AR4
LACC input2
SACL *+
NOP
NOP
MAR *,AR5
LACC input3
SACL *+
NOP
NOP
; MAR *,AR6
; LACC input4
; SACL *+
B P1
P2 NOP
NOP
SUB length
BCND P1,LT
LACC counter
SUB length
SACL counter
P1 NOP
RET
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -