Dynamically generate instruction functions