Thank you roboprof for your reply. Im still bit confused how cnvrt actually works.
So in theory I need to get user frame origin in pvar, convert it to tool coordinates and then same thing for tool frame with zero values, so it will be on flange and then offset of these will be coordinates for new tool frame?
edit: cnvrt really helped. I just had to add a few extra movl- commands between the calculations to make it work properly