bsongen: Pointer support

Code gen is slightly ugly, but it does the right thing.