These are the current engine codes used.
     M10       4 Cylinder 1.8L or 2.0L single overhead cam, timing chain.
     M20       6 Cylinder 2.0, 2.3, 2.5 or 2.7L single overhead cam, timing belt.
     M21       6 Cylinder 2.4L Diesel single overhead cam, timing belt.
     M30       6 Cylinder 2.8, 3.0, 3.2, or 3.4L single overhead cam, timing chain.
     M40       4 Cylinder, DOHC
     M41       4 Cylinder Diesel
     M42       4 Cylinder 1.8L DOHC
     M44       4 Cylinder 1.9L DOHC
     M50       6 Cylinder 2.0, 2.3, or 2.5L DOHC
     M50TU   6 Cylinder 2.0, 2.3, or 2.5L DOHC, VANOS variable intake
     M51       6 Cylinder Diesel
     
M52       6 Cylinder 2.0, 2.3, 2.5, or 2.8L DOHC, VANOS variable intake
     M52TU   6 Cylinder 2.5 and 3.0L DOHC, VANOS variable intake and exhaust
     M54       6 Cylinder 2.5 and 3.0L DOHC, VANOS variable intake and exhaust
     M56       6 Cylinder 2.5L DOHC, Dual VANOS, SULEV (low emissions)
     M60       8 Cylinder 3.0 or 4.0L
     M62       8 Cylinder 3.5 or 4.4L
     M70      12 Cylinder 5.0L
     M73      12 Cylinder 5.4L
     M88       6 Cylinder 3.5L, 24 valve Motorsport engine (only in the BMW M1)
     M88/3    same as above, but for all other vehicles
     S14        4 Cylinder 2.3L DOHC Motorsport engine (only in the E30 M3)
     S38        6 Cylinder 3.6 or 3.8L DOHC Motorsport engine
     S50        6 Cylinder 3.0 or 3.2L DOHC, Dual VANOS Motorsport engine (Non-US M3)
     S50US    6 Cylinder 3.0 or 3.2L DOHC, Single VANOS Motorsport engine (US M3)
   
  S52        6 Cylinder 3.2L DOHC, Dual VANOS Motorsport engine
     S54        6 Cylinder 3.2L DOHC, Dual VANOS Motorsport engine
     S62        8 Cylinder 5.0L quad cam, quad VANOS Motorsport engine
     S70       12 Cylinder 5.6L Motorsport engine
source.........................
http://www.pelicanparts.com/bmw/techarticles/JF-Tech/BMW_Designation_faq.htm