📄 cpdata.s
字号:
/************************************************************* * File: lib/cpdata.s * Purpose: Part of C runtime library * Author: Phil Bunce (pjb@carmel.com) * Revision History: * 970304 Start of revision history * 971231 Added ifdef for GHS */#include <mips.h>/* * Copy data from ROM to RAM, used in ROM-based applications. */ .globl cpdata .ent cpdatacpdata: # copy .data to RAM#ifdef BSO_TASKING la t5,__lc_cp beq t5,zero,3f4: lw t1,0(t5) # action beq t1,zero,3f lw t2,4(t5) # dest lw t3,8(t5) # src lw t4,12(t5) # len sll t0,t1,31-2 bgez t0,1f # test CP_REL bit la t0,__lc_zp addu t2,t0 # add _zp to dest1: sll t0,t1,31-1 bltz t0,2f # test CP_BSS bit1: beq t4,zero,2f lw t0,(t3) sw t0,(t2) addu t2,4 addu t3,4 subu t4,4 b 1b2: # next section addu t5,16 # size of entry b 4b3:#else # src=etext dst=a0 stop=edata#ifdef GHS la t0,__ghsbegin_romdata la t2,__ghsend_romdata move t1,a01: lw t3,(t0) sw t3,(t1) addu t0,4 addu t1,4 blt t0,t2,1b#else la t0,etext#ifdef ALGOR /* Algor's convert aligns the start of .data to 16 bytes */ addu t0,15 and t0,~15#endif la t2,edata move t1,a01: lw t3,(t0) sw t3,(t1) addu t0,4 addu t1,4 blt t1,t2,1b#endif#endif j ra .end cpdata
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -