MIPS (or SPIM): Loading floating point numbers

前端 未结 2 632
醉话见心
醉话见心 2020-12-19 07:57

I am working on a little mini compiler while trying to learn some MIPS here. Here\'s my issue:

MIPS has an instruction li (load immediate) which would work like thi

2条回答
  •  春和景丽
    2020-12-19 08:18

    You will need to use the floating point registers to load your floats.

    Instead of:

    li $5,2.5
    

    Try:

    li.s $f5,2.5
    

    Take a look at mfc1 and mtc1 instructions to move between integer and floating point registers.

提交回复
热议问题