Is it possible to directly manipulate bitstrings in MIPS?

Hello,

I am wondering whether bitstrings can be manipulated directly by changing the values of single bits at a time and not just bytes.

Thanks for possible answers!

Hello,

If by bitstring you mean a piece of memory where you care about individual bits, then the answer is no.

Processors usually (and MIPS is no exception) operate on bytes. The reasons are mostly historic, but also that computation instructions on individual bits are unnecessary, as you can just simulate them using the instructions operating on bytes instead.

In some other instruction sets (like x86), there are instructions where you can modify memory directly, i.e. you can and a memory location and a register and (maybe even atomically) write the result back to memory in one instruction. But I would still qualify these instructions as operating on bytes. MIPS does not have them, though.

Hope this helps,
Johannes

4 Likes

yes, that helps, thanks for the quick (and thorough) answer!

1 Like