I don't think that we can define morality to ZERO or ONE (ie: black OR white) to machine... even for us humans, there are times when we are in 'grey' areas as there are other variables to be thought of before making any decision...
Scary thought though if machine is programmed to decide on morality...