code generation for stack machine