la a0, start li a1, 0xbfc00000 la a2, _edata or a0, 0xa0000000 or a2, 0xa0000000 subu t1, a2, a0 srl t1, t1, 2 move t0, a0 move t1, a1 move t2, a2 /* copy text section */ 1: lw t3, 0(t1) nop sw t3, 0(t0) addu t0, 4 addu t1, 4 bne t2, t0, 1b nop PRINTSTR("\ncopy text section done.\r\n") /* Clear BSS */ la a0, _edata la a2, _end or a0, 0xa0000000 or a2, 0xa0000000 2: sw zero, 0(a0) bne a2, a0, 2b addu a0, 4