4 ms·
Amazing that MSP430 has the same mnemonics as x86.
by pwdisswordfish9 5y ago
Amazing that MSP430 has the same mnemonics as x86.
- akira2501 5y agolol.. was just trying to be familiar. here's some old code I dug up that used it: ; find next task in circular list Next(6 cycles) Top(14 cycles) { add.w #10, r10 ;2 increment pointer to next task area cmp.w #mms_task.end, r10 ;2 are we at the end of the task list? jnz { ;2 no? start next task .init: eint ;1 ensure interrupts are enabled bis.w #MMS_EACH, &mms_task.state ;5 ensure EACH state flag is set mov.w #mms_task.list, r10 ;2 restart at top of list } ; build state and check against task Skip(12 cycles) Take(31 cycles) mov.b &IFG2, r8 ;3 r8 = ifg2 interrupt flags and.w #(MMS_TX+MMS_RX), r8 ;1 get only TX and RX ready flags mov.w &mms_task.state, r9 ;3 r9 = current task state bis.w r8, r9 ;1 add TX and TX flags to global state ; determine if this task needs to run bit.w @r10, r9 ;2 task request flags & system flags }:jz ;2 no matches? find next task ; load the task state and return into it mov.w r10, &mms_task.ptr ;4 set current task area to r10 mov.w @r10+, r12 ;2 r12 = task[0] (request flags) mov.w @r10+, r8 ;2 r8 = task[1] (PC) mov.w @r10+, r4 ;2 r4 = task[2] mov.w @r10+, r5 ;2 r5 = task[3] mov.b @r10+, r6 ;2 r6 = task[4] (low byte) mov.b @r10, r7 ;2 r7 = task[4] (high byte) mov.w #0, r10 ;1 clear r10 pointer for safety mov.w r8, PC ;2 "return" into the yield