If power fails during ISP or Real-Time ISP, programming will fail with an error to the programming software. If power is restored, you can attempt to re-program the device. If a device is not programmed successfully, upon power-up, all I/O's will tri-state. This fail safe is achieved by a "program_done" bit feature in MAX II which also available in MAX 7000AE/7000B/3000A devices. Program_done is the last bit to be programmed in the device - if it is not set, the device knows programming did not complete and it will not release the I/O's from tri-state.