Why are mapping reductions from incomputable Languages OK?
There are two options:


Either the pseudocode means "run $A_{TM}$ on the pair $M,w$" when it says "Simulate $M$ on $w$";
or it really means to simulate $M$ on $w$, and if it ever stops then do something; there is no "else" clause in that case.