In this paper, we study bifurcation of limit cycles from a homoclinic loop connecting a saddle of tangent type for a quadratic Hamiltonian system perturbed by nth degree polynomials, n=1,2,…,13. The main tool is the asymptotic expansion of the related Abelian integral near the homoclinic loop, and the maximal number of independent coefficients gives exact number of limit cycles. Our aim is to obtain more limit cycles by exploring more coefficients in the asymptotic expansion. However, it is usually very difficult to obtain the coefficients of the terms with degree greater than or equal to 2 in the asymptotic expansion. To overcome the difficulty, we derive two auxiliary systems and investigate the expansions for the related Abelian integral. The coefficients of lower degree terms in the new asymptotic expansions are equivalent to those of higher degree terms in the original asymptotic expansion. We obtain n−1−n−24 limit cycles near the non-regular homoclinic loop and n−24 limit cycles near the center, and it totally has at least n−1 limit cycles, when n∈{1,2,…,13}. The cyclicity of period annulus is also estimated by the first order Melnikov functions for n=3.