I have a C function that contains all the code that will implement the bytecodes of a bytecode interpreter.
I'm wondering if there is a way to align segments of the compiled code in memory on fixed size boundaries so that I could directly calculate the address to jump to from the value of the bytecode? Sort of the same way an array works but instead of reading from the calculated address, I'm jumping to it.
I am aware that i will have to put the code to perform the next jump at the end of every "bytecode code" segment and that I will have to make the boundary size at least as big as the size of the largest segment.
If this is even possible, how would I tell the compiler/assembler (gcc / g++ / as) to align in said way?