  .section    .boot, "ax", @progbits

 .global _start
_start:
        j       _start1
        .word   0xb1507d38              # Magic number for loader

        .org 0x08
_trap_entry:
        j       _trap_entry

_start1:
        mv      x1, zero        # ra
	la      sp, _fstack
        la      gp, _gp         # Initialize global pointer
        mv      x4, zero        # tp
        mv      x5, zero
        mv      x6, zero
        mv      x7, zero
        mv      x8, zero
        mv      x9, zero
        mv      x10, zero
        mv      x11, zero
        mv      x12, zero
        mv      x13, zero
        mv      x14, zero
        mv      x15, zero
        mv      x16, zero
        mv      x17, zero
        mv      x18, zero
        mv      x19, zero
        mv      x20, zero
        mv      x21, zero
        mv      x22, zero
        mv      x23, zero
        mv      x24, zero
        mv      x25, zero
        mv      x26, zero
        mv      x27, zero
        mv      x28, zero
        mv      x29, zero
        mv      x30, zero
        mv      x31, zero

#        # Watchdog
#        lui	a5,0xc0424
#        lui	a4,0x80
#        addi	a5,a5,-1079 # c0423bc9 <_fstack+0xc04137c9>
#        sw	a5,20(a4) # 80014 <_fstack+0x6fc14>

        call    init

        # Reload registers
1:      
        la      gp, _gp                 # Initialize global pointer
	la      sp, _fstack
        call    main
        j       1b
