So I have this code snippet in C
int unit_test_case08(int a, int b)
{
int success = 1336;
if(a != b)
{
success = 1337;
}
else
{
success = -1;
}
return success;
}
Which translates in MIPS to
unit_test_case08:
addiu $sp,$sp,-24
sw $fp,20($sp)
move $fp,$sp
sw $4,24($fp)
sw $5,28($fp)
sw $6,32($fp)
li $2,1336 # 0x538
sw $2,8($fp)
lw $3,24($fp)
lw $2,28($fp)
nop
beq $3,$2,$L2
nop
li $2,1337 # 0x539
sw $2,8($fp)
b $L3
nop
$L2:
li $2,-1 # 0xffffffffffffffff
sw $2,8($fp)
$L3:
lw $2,8($fp)
move $sp,$fp
lw $fp,20($sp)
addiu $sp,$sp,24
jr $31
nop
But for my question, im trying to create some test cases for my emulator, but am finding it hard to generate some code in C that will get me BEQL instead of BEQ?
beq $3,$2,$L2
This question extends to most of the "Likelys" if possible. I am a very new to MIPS.
I would like to learn how to code a test case in C that would translate to BEQL instead of BEQ.