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

📄 startup.s

📁 潜入是烧写flash的程序
💻 S
字号:
#include "lx_regs.h"        #        # Set up some room for a stack. We just grab a chunk of memory.        #        .globl  start#ifdef __mips16        .set nomips16        .align 2#endif#define STKSIZE 32768        .comm   stack, STKSIZE        .text        # Without the following nop, GDB thinks _start is a data variable.        #  This is probably a bug in GDB in handling a symbol that is at the        #  start of the .text section.        # ======================        # start here        # ======================        .globl  _start        .globl  fail        .globl  pass        .ent    _startstart:_start:        nop        .set    noreorder        li      v0, 0           # kernel mode, intr disable, BEV=0 [0x8000 0080]        mtc0    v0, C0_SR        nop        # clear bss#        la      t0, _fbss#        la      t1, end# _1:    sw      $0, 0x0(t0)#        sw      $0, 0x4(t0)#        sw      $0, 0x8(t0)#        sw      $0, 0xc(t0)#        addu    t0, 16#        blt     t0, t1, 1b        # first set up a K1seg sp & gp        la      sp, stack+STKSIZE-24        or      sp, K1BASE        la      gp, _gp        or      gp, K1BASE        # call test program        la      t0, TestEntry        jal     t0        nop        # verify result_2:        bltz    v0, fail        noppass:        # notify sim model        nop        j       pass        nopfail:        # notify sim model        nop        j       fail        nop        .end _start/*************************************************************** enableInts(bits)* Enable specified interrupts.*/        .globl enableInts        .ent enableIntsenableInts:        .set noreorder        mtc0    zero, C0_CAUSE  # make sure sw bits are cleared        mfc0    t1, C0_SR        nop        nop        or      t1, a0          # enable selected ints        and     t1, ~SR_BEV     # clear BEV        or      t1, SR_IEC      # overall int enable        mtc0    t1, C0_SR       # set those bits        .set reorder        j       ra        nop        .end enableInts        .globl EnableInterrupt        .ent EnableInterruptEnableInterrupt:        .set noreorder        mfc0    t1, C0_SR        nop        or      t1, SR_IEC      # overall int enable        mtc0    t1, C0_SR       # set those bits        .set reorder        j       ra        nop        .end EnableInterrupt        .globl DisableInterrupt        .ent DisableInterruptDisableInterrupt:        .set noreorder        mfc0    t1, C0_SR        nop        and     t1, ~SR_IEC     # overall int disable        mtc0    t1, C0_SR       # set those bits        .set reorder        j       ra        nop        .end DisableInterrupt

⌨️ 快捷键说明

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