Ahmad Shah Masood was initially an ISI Asset alongside Hikmatyar against Daud Khan in Afghanistan due to Daud Khan's Pashtunistan Madness as Ahmad Shah Masood was Islamist and a Tajik so he has lots of reasons to oppose Daud Khan but during Cold War Pakistan's Pashtun Political and Military Lobby(that include Hameed Gul and Maulana Fazalur Rehman as well) was against him while Zia's Political Alley JI was in favor of him as they share Ideological Links with him and that is what cause the whole problem in Pakistan Policy in the beginning otherwise he wasnt a bad option for Pakistan in fact he was Better Option.