Hi, I am trying to implement a switch statement in assembly using MIPS. I can get it to jump to the target, but I was wondering if beq $s2, 1, C1 is valid MIPS code and not pseducode, I know that code works just not sure if its "proper" I guess. $s2 contains the integer that controls what case the program should jump to.

It depends. In MAL and TAL: no, it is not legal (the second item must also be a register). In SAL, sure.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.