Don't worry about your English Savnik. I understand how hard it is to explain something when English is not your native language. I'm French... but Canadian

OK let's see one method to do that... yeah the saturday pm one solution
Code:
        PORTB = 0
        TRISB=%10100000
        EEPROMWriteMode VAR PORTB.0
        WriteToEEPROM   var PORTB.1
        MainLed         var PORTB.2
        
        Delay var word

Main:
    MainLed = 1
    if PORTB.5 = 1 THEN GOSUB P_B_sub
    goto main
    
P_B_Sub:
    mainled = 0
    delay = 0
    while (PORTB.5 = 1) and (Delay<1000)
        pause 1     
        delay=delay+1
        wend
    if delay<1000 then return
    
    eepromwritemode=1
    delay = 0
    while (PORTB.7 = 0) and (DELAY<1000)
        pause 1
        delay=delay+1
        wend

    if (delay<1000) then
        writetoeeprom =1
        endif
        
    pause 1000
    eepromwritemode =0
    writetoeeprom = 0
    return
there's still the Timer Interrupt solution...