Sorry about this really stupid question. But I have been reading my textbook the entire day and its getting really confusing.
I would like to clarify some syntax related questions with MIPS I-type instructions.
I understand that instructions like
addi $21, $22, -50
are possible and the immediate value is interpreted as a decimal (2s complement).
But can I write addi $21, $22, 0xF1DF?
such that the immediate value is in hexadecimal?
That brings me to my next question with andi $10, $11, 0xFFFF
and ori $8, $0, 0x0FA5
. I understand that these 2 codes are correct.
But can I write andi $10, $11, 120
and ori $8, $0, -16
such that the immediate values are in decimal? If it is possible, does it interpret 120
as hexadecimal or does it convert decimal 120
to hexadecimal which equates to 78
in hexadecimal.
I am very confused.