I'm writing an article about the evolution of programming languages and wrote a small program in MIPS Assembly that calculates the first 100 prime numbers. On of the (pseudo)instructions of this program is 'rem $t3, $t0, $t2' which is converted to the following four native instructions:
bne $10, $0, 0x00000001
break
div $8, $10
mfhi$11
I've never noticed that break instruction before, so I've searched all over the place and could barely find any mention of the break instruction or it's type.
The only two documents I could find where this one that states 'break' as an instruction used by the debugger and this other one that states 'break' as an instruction with three parts: special (6 bits), code (20 bits) and break (6 bits) but it makes no reference to what type this instruction is. It certainly isn't of type R, I or J.
So I was wondering:
- Is the break instruction part of the MIPS ISA or an instruction only MARS recognises?
- What is the instruction type of the break instruction?
- How does it transfer the control to an exception handler, in hardware?
- Does it change the Program Counter (PC) register?