1. Input A; 2. Input B; 3. Set 0 X; 4. Set 0 z; 5. BranchEq X B 9; 6. Add Z A Z; 7. Add 1 X X; 8. Jump 5; 9. Output Z;