a guest Dec 23rd, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- .type CoOS_InitMainStack,%function
- //Reset MSP to init
- ldr r0, =0xE000ED08 //r0 = VTOR Use the VTOR offset register to locate the stack.
- ldr r0, [r0] //r0 = *VTOR
- ldr r0, [r0] //r0 = *(e_stack) (stack init)
- sub r0, #32 //r0 = r0 - 32
- msr msp, r0 //MSP = r0
- ldr r1, =_ZN4CoOS16InterruptHandlerEv //r1 = &CoOS::ThreadStart
- add r1, #2
- str r1, [r0, #0x14] // MSP.LR = &CoOS::ThreadStart
- str r1, [r0, #0x18] // MSP.Return Addr = &CoOS::ThreadStart
- bx lr
RAW Paste Data