The macro that can put a macro assembler into an infinite loop is (ii) only.
Here's why:
Let's analyze macro M2:
.MACRO M2, X
.IF EQ, X
M2 X ; Recursive call with the same argument X
.ENDC
.IF NE, X
.WORD X + 1 ; This line will be expanded for each recursive call
.ENDC
.ENDM
In macro M2, if the condition .IF EQ, X
is true, it makes a recursive call to itself with the same argument X
. This creates an infinite loop because the recursive call will keep expanding with the same argument, leading to an endless cycle.
On the other hand, macro M1 does not have a recursive call within the macro itself. It uses recursion in a way that avoids infinite looping.