📄 asm_func.asm
字号:
; ******************************************************************************
; File: ASM_func.asm
; Author: Bhargavi Nisarga, Texas Instruments Inc
; Date: June 2007
;
; Routines to get address of a data table, read and write a 20-bit value
; to locked register R4.
; Accessed out of C as standard extern Calls.
;
; Note 1: The linker command file for this project has to be modified to
; create a new memory segment (.Chigh - in this example). The
; linker command .Chigh : {} > FLASH2 is used to create a
; new memory segment in the extended memory FLASH2(0x10000 - 0x1FFFF).
;
; ******************************************************************************
.global __Get_Address20
; Data Table in extended memory
;NAME Sin_tab
.sect ".Chigh"
.align 2
Sin_tab .word 2048, 2447, 2831, 3185, 3495, 3750, 3939, 4056
.word 4095, 4056, 3939, 3750, 3495, 3185, 2831, 2447
.word 2048, 1648, 1264, 910, 600, 345, 156, 39
.word 0, 39, 156, 345, 600, 910, 1264, 1648
;===============================================================================
; "unsigned long __Get_Address20(void)"
; This function is used to get the 20-bit address of the data table (Sin_tab),
; initialized in the extended memory.
; Passing parameter : Void
; Return parameter : unsigned long - the 32-bit return value is returned in two
; words; lower word in R12 and upper word in R13
;===============================================================================
.text
__Get_Address20
movx.a #Sin_tab, R12 ;R12 now has the 20-bit address
;Split into two 16-bit words to return data to C
andx.a #0x00FFFF, R12
movx.a #Sin_tab, R13
;Rotate 20bit addr in R13, 16 times to its right arithmetically
rpt #16 ||
rrax.a R13
reta ; Return
.end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -