whats the year and model of your car,
your can try doing a stomp test and see what codes come out,
take the key put into ignition and then turn all the way just to where it wont start press gas pedal down 5 times engine light will blink and pause for half a second then it will start blinking out numbers, like say it will blink, blink pause blink pause blink pause blink blink
that means 2112
the codes only come out in four digits soo there is no way to get any 5 or 6 digit codes
after you have the code go to this web site
http://www.scribd.com/doc/12801540/Bmw-Motronic-Codesand see what the code represents, you also should check air filter and spark plugs, and try putting some fuel injector cleaner in your car, before you fill it up agian, SeaFoam is the best but its $10 a bottle
also in really old cat converters the shit thats inside them will crumble up and form into a wall of crud, you might wanna check on that
depending on the year of your car the stomp test might not work for you
1989-94 are equipped with this feature