Was ist "IRAM"!!!
Probiers mit

dim x as byte
x=Pinb.1
if x=0 then..........