. MLZ -1 -47 1; first argument
. MLZ -1 3 2; second argument
. MLZ 0 0 0;
. MLZ -1 A1 3; move arg to result
. XOR A3 -32768 4; flip sign and store in scratch
. MLZ A4 A0 0; if scratch is negative (arg was positive), do next line twice
. XOR A3 -1 3; invert result
. SRL A3 A2 3; perform shift
. MLZ A4 A0 0; if scratch is negative (arg was positive), do next line twice
. XOR A3 -1 3; invert result