generate code for packed writing (currently as comment only)