Added functions to write VM code.