move.w inputValue, r1 move.w currentState, r2 leftshift #4, r2 ; multiply by 16 move.w (r2+tableBase), r3 $1: move.w (r3)+, r4 and.w r1, r4 cmp.w r4, (r3)+ ; r3 pointed at inputMatch, inc to nextState jmp.eq $2 add #ENTRYOFFSET, r3 ; offset to start of next state entry jmp $1 $2: move.w (r3)+, r2 move.w r2, currentState call (r3) ; subroutine must end with a return returnThis is pretty fast and can handle pretty much anything. If this is the core of an interrupt service routine, don't forget to turn interrupts back on as soon as possible. +
file: /Techref/method/process/states-rb.htm, NaNKB (1 imgs) in 0.075s is NaNKBps, updated: 2013/8/27 21:38, local time: 2025/4/10 15:58,
owner: JMN-EFP-786,
18.218.106.24:LOG IN
|
©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/TECHREF/method/process/states-rb.htm"> A compact state machine engine by Ron Braithwaite</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.