Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
if you have the internal bochs debugger enabled, the best thing to do is probably to type "trace-on" on the debugger console before "c"ontinuing your program .. this way, you'll know where your program was *before* it jumped/called the bad address ... and you'll be able to find out why it did so (probably a misinitialized pointer to function somewhere ?)
Im just speculating: I think eip's bad value might come from popping eip in an interrupt handler, you are by mistake popping eip and when you do iret, you return to this bad eip value. But just speculating, this is the first thing I can think of. Good luck.