I want to display a few numbers on an 16x4 lcd.

If I have 502, I want to divide it by 256 and display the number in decimal like 1.96

I have created a routine but something is wrong as the display is not showing the correct numbers.

Code:
p1 var byte
p2 var byte
p3 var byte
Value=502
		LCDOUT $FE,$90,"Value>",DEC Value 
			P1=(Value/256) DIG 0
			P2=(Value//256) DIG 1
			P3=(Value//256) DIG 0
		LCDOUT $FE,$80,"Val>",DEC P1,".",DEC P2,DEC P3
The display shows : 502 & 1.46