MIPS assembly for a simple for loop

后端 未结 4 1408
长发绾君心
长发绾君心 2021-02-09 00:24

I need to translate this C code to MIPS assembly. Here is the C code:

int tmp = 0; 
for (int  j = 0; j < 15; ++j) 
     tmp = tmp * 2 + 3

Th

4条回答
  •  轮回少年
    2021-02-09 00:53

    Your loop goes from 0 to 14, so your bgt instruction should be: bgt $t0,14,exit I think.

    .

提交回复
热议问题