I just tried this, but it always returns 0...

puka:
IF PWIN=1 THEN
X=X+1
ELSE
LCDOUT $FE, $C0, DEC x, " "
PAUSE 100
x=0
ENDIF
GOTO PUKA