> > I hope someone can help me with this, because I dont have any bright > > ideas right now ;) Is there a nifty little piece of code out there > > what does the same as the "case", e/g/ "switch" statement? > > > There are many ways to do this... Here's how I usually manage it: > > CASE: > > XORLW 1 > BZ W_CONTAINED_1 > > XORLW 2^1 Note how you have to duplicate the last case value here because of the previous XOR. Keeping lists like this intact when you add/remove values to test for is a pain -> use a macro to do the work. > BZ W_CONTAINED_2 > > XORLW 3^2 > BZ W_CONTAINED_3 Yes, this is the normal way to do it for few and/or widely separated (e.g. ASCII) values to test for. If the cases to test for are all near each other, then a jump table might be useful (with code handling unused entries of course). I actually use some macros for this, so I can write: switch case "?",Copyright ; xorlw "?":bz Copyright case "G",Go case "K",Kill case "Z",Sleep endswitch ; code continues here if no match The switch and endswitch macros handle setting up a compile-time variable to keep the last case value in (required because of the XOR) Full source for this and many other macros are in http://www.falstaff.demon.co.uk/picres.html (see macros.i) Frank