In a routine in x86 assembly, what happens if the code contains a jump that points to a valid address in between two valid addresses? Here is an artificial example:
0x0001: mov ...
0x0005: add ...
0x0009: jmp 0x0003
Besides, how can I experiment with something like this on a local machine or online? I checked the online x86 editor like https://defuse.ca/online-x86-assembler.htm#disassembly, but it does not allow me to put the instruction addresses like "0x0001".
There is no such thing as a “valid” or an “invalid” address. Every address can be jumped to and if the corresponding page is mapped, executed.
So what happens when you jump “between” instructions? Well, the processor does not know where you intend instructions to begin and end. It just executes the bytes it sees. This code will be different from what you expect because the CPU tries to parse the middle of some other instruction as an opcode.
Your specific example is not sufficiently specified for me to say what instructions result. Perhaps you can provide a completely specified example (including the machine code) so I can give a better explanation.