So I have been thinking about making a project to create macros but can't think of a creative way to save on the code space.

Here is a simple way of explaining what I am attempting to do.

So lets say we have 5 leds and each has it's it's own tactile switch to turn it on. The way I have envisioned the code is have an included file called "button checks" which has a routine that checks each button (tris register) and sets a bit if the button is pressed. In the main program, you have the routines that check the bits and turn on the LED if the bit returns the expected value.

Now, say I want to have a "macro" button that can be programmed to turn on a particular set of LED's when it's pressed. So of course you would have a programming mode and while it's in the programming mode, you would press the buttons for which leds you want to turn on with the macro button. So out of the 5 led's, lets say I wanted the button to turn on the red and green leds with the macro button.

While I know I could do this using a lot of code space, I am trying to find a creative way to do it with the least amount of code space. There are a lot of commands in picbasic that I have yet to use, or use in the best way, that I am hoping will help keep this project low in code space.

Any thoughts?