PRINT_INT = 1 PRINT_STR = 4 READ_INT = 5 PRINT_CHAR = 11 MIN = 2 #define MIN 2 MAX = 20 #define MAX 20 # int main(void){ # int n; # printf("Enter a number: "); # scanf("%d",&n); # if(n <= MIN) # goto out_of_range; # if(n > MAX) # goto out_of_range; # in_range: # printf("In range\n"); # goto end; # out_of_range: # printf("Out of range\n"); # end: # return(0); # } .text main: #Mapping #$t0 = n li $v0, PRINT_STR la $a0, prompt_1 syscall li $v0, READ_INT syscall move $t0, $v0 check_cond: #TODO ble $t0, MIN, out_of_range bgt $t0, MAX, out_of_range in_range: li $v0, PRINT_STR la $a0, message_1 syscall b end; out_of_range: li $v0, PRINT_STR la $a0, message_2 syscall end: li $v0, 0 jr $ra .data prompt_1: .asciiz "Enter a number :" message_1: .asciiz "In range\n" message_2: .asciiz "Out of range\n"