Please read the first text of this blog for an easy version of computer moral that you could start with!
When one wants to build a more complex moral for a computer, one could read my book http://www.angelfire.com/planet/paradisewins/2013paradise.rtf . It is written so that it's truths could be easy for a theoretical physicist (or an engineer) to put to a computer programmable form. Just pick a box/block/term for each entity in the world, so that the computer can refer to the entity by using the term. The book is about rationally grounded selfishness-based moral.