In addition to context, there's phonology and phonetics,
-ed is pronounced as [t] in
asked the man: [aesk
t] the man. It's pronounced as [t], a voiceless sound, because the sound the comes before, notably [k], is also voicesless. The last three consonants, [skt], all share voicelessness.
Now, if your first language doesn't have syllable-final voiceless stops (e.g., [t], [k]) or syllabels that end in three consonants (e.g., [skt], then that might be one reason you're having difficulty picking up [t] in [aeskt].
Now, if it's not your ears, but rather native speaker pronunciation that's the problem, there are a few additional pronunciations for
asked:
(1) asked, [aesk
d]
=> in this case a native speaker pronounces final -
ed as [d], a voiced sound. What happens here is the speaker finds that having three consonants at the end is either too difficult to say or it's just too inefficient, so s/he makes the string easier by making the last sound in the -sked string voiced, thereby making the string easier to pronounce: /aeskt/ => [askd]
(2) asked, [ae
kst] (sounds like
axed)
=> in this case, the native speaker makes the string easier to pronounce by switching /s/ and /k/ around: sk => ks
===
asked the man => ask [d]e man
In this case, final [d] and initial 'th' produce
ask[d]e man. What happens here is 'th' becomes [d], sharing place of articulation with final [d]. The reason, with consonant clusters, especially across word or syllable boundaries, it's easier to pronounce similar sounds than it is to pronounce different sounds, like [d] then stop and make a new sound 'th'.
Hope that helps out a bit.