papezjustin
papezjustin

Reputation: 2355

MIPS can li and sb be combined into one instruction?

I am new to MIPS so I apologize if this is a dumb question. I can't seem to find an answer to this question on the web. Can these two instructions be written as one instruction? The code I have below feels redundant:

li    $t0, 23
sb    $t0, 0x10010000

Thanks in advance for your responses!

Upvotes: 0

Views: 156

Answers (1)

Tom
Tom

Reputation: 45114

No, they can´t be combined. There is no such thing as a "store inmediate to memory" instruction.

Mips implements a simple ISA. Being a RISC architecture, the only way to store a byte in memory is to use the sb instruction.

Upvotes: 1

Related Questions