If you are working with the link port, you will want to make sure that whenever any of the lines are pulled low, you disable interrupts with di, and when you are done, re-enabling them with ei. Be warned that certain OS routines will either enable interrupts or not work with interrupts off.