Both cars(m3 and 540) use Getrag S6S 420G transmisions, both cars have identical gear ration.
In fact all of these cars mentioned below use this tranny
* 1996-1999 BMW E36 M3 (Euro)
* 2001-2006 BMW E46 M3
* 1988-1995 BMW E34 540i and M5
* 1996-2004 BMW E39 540i and M5
* 1995-2001 BMW E38 7 Series
* 1989-1999 BMW E31 8 series
* 2000-2003 BMW E52 Z8
But bellhousing bolt patters is OBVIOUSLY different.
Just look at both the pic of a M62 bolt pattern and an 50 series pattern (m52,54,s52,54) and you can clearly see that the pattern is different.
BASICALLY ,remember this. The trans are interchangeable between their series bothers ONLY.
M60, M62, S62 are all interchangeable
M50,M52,M54,S50,S52, S54 all all interchangeable
And such. A V8 trans wont ever line up to a 6cyl .