Comment your code, and explain your answers clearly.
Have fun.
Since we're considering 12-bit non-negative integers, you need not worry about the signs of A and B. However, you should return 0 if B is 0.
Don't try to get fancy. You can compute A mod B by
subtracting B from A repeatedly until the remainder is less
than B.
Execution times in micro-seconds for PDP8/E instructions
--------------------------------------------------------
Addressing mode
------------------------------------------
Instruction Indirect with
Type Direct Indirect auto-increment
--------------------------------------------------------
AND 2.6 3.8 4.0
TAD 2.6 3.8 4.0
ISZ 2.6 3.8 4.0
DCA 2.6 3.8 4.0
JMS 2.6 3.8 4.0
JMP 1.2 2.4 2.6
Opcode 7 1.2 (addressing mode irrelevant)
--------------------------------------------------------