You can try to compile your shader with DX shader compiler. I generally use this:
Code:
 fxc /T fx_2_0 /Fc myfile.fxc myfile.fx
The above generates code with assembly instructions useful for optimizing the high-level code.

If you can get your program to compile just fine, then it's most likely the wrong usage of D3DX calls. Remember that you enable D3DX debugging separately in "d3dx9.pas". It probably doesn't say anything because you haven't enabled debug run-time for D3DX.