Just to try something, I was playing with a working example.

By changing the values written to Port B I would have expected the LED pattern to change. It didn't is stayed exactly the same.

Even when I removed all the calls to write to all the ports they kept on flashing as per the original program.

Do I have to delete the old .hex file and then recompile? I would have expected a recompile to overwrite a previous version ?