### algorithm

#### How to “NOT” a register in mips assembly

Since there isn't a NOT logical operator in mips assembly, how can one "not" the contents of a register?

Load -1 into another register, then XOR the registers. https://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Mips/bitwise.html

You can use nor and the zero-register to fit everything into one instruction: nor $<dest_reg> $<in_reg> $zero Another approach would be using xor and -1 as this is encoded as 1111...1111 in 2s-component. li $<help_reg>, -1 # load -1 into help-register xor $<dest_reg>, $<in_reg>, $<help_reg> # actual not-operation

### Related Links

Can sorting Algorithms destroy pre-existing element order?

Advanced Math - Solving Optimal Sets Using a Program

Missing integer in an array

Sorting k-sorted arrays with a min heap

Permutation of lengthy string

Variant Scheduling Algorithm

How do I check if a line is behind a vertex?

Accurate roots of unity for powers of 2?

How to compare the efficiency of two different algorithms written in different language?

Can ziv lempel efficiency be improved by compressing longer repetitions

Why do we need to run DFS on the complement of a graph in the Kosaraju's algorithm?

How to explain this algorithm for calculating the power of a number?

Assigning n players to 3-member teams to reduce number of repeated games?

Algorithm for scaling one list of ranges to another

What state needs to be stored to allow resumable hash computations?

Algorithm to minimize the cost for mechanic [duplicate]