Dimitry, you pushed my "brain dump" button :) I use state machines to implement the user interface in my PIC- based loggers. Here's a rough outline of what I did: I have a variable in RAM that is the state variable. There is one display page per state, with a subroutine that displays that data. The program loops, calling the state function for each loop. I use a computed jump (ADDWF PCL) based on the state variable value to dispatch the proper function based on the state. For efficiency, the state functions use some flags to keep track of sub-states. For example, the first time the page is displayed, it has to refresh the entire page. If new data is available, it must refresh the values, but may not want to re-write the titles. And since the state functions are called many times per second, they usually just look for keypresses and do nothing. Each state function deals with button presses in its own way. THe 4 buttons are up, right, left, down. Some pages ignore some presses, some presses change the state variable. So the page "map" is controlled by the state functions changing the state as desired before returning to the main loop. It works well in 'C', also. Standard (if slightly unusual syntax) 'C' creates an array of constant function pointers to the state functions. Then the state variable is the index into the array, which implements the jump table nicely. (Thanks, Clyde!) That's the basic idea. What details did I forget? Barry.