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

Find number of items with weight k in a range (with updates and queries)
Find maximum element in hashtable with doubly linked list in each slot
Good hash function for unordered set of ID's
Identifying performance matrices and baseline criteria in comparison of cloud services ranking methods
Compare strings and remove more general pattern in Perl
Game Theory: how to apply it in transcriptomics?
Confusion related to the time complexity of an algorithm
function objects and algorithm to to find numbers within a range in a vector in C++
Why is my Seive of Eratosthenes Algorithm implementation running into infinite loop?
Which search algorithm does google maps use to find paths and why?
Rewriting decay algo such that values don't have to be recalculated
Designate intersections of polygons
Is there any other features matching algorithm except BruteForce and flann?
Trouble approaching Mancala free moves to Minimax Node
Algorithm Efficiency; Growth Function and Big-O Representation
What does the `do` control construct do in Scheme?

Categories

HOME
batch-file
kentico
polymer
merge
flex
camera
composite-primary-key
error-handling
javacc
permissions
pyqt4
x264
vsm
nfs
special-characters
joomla3.0
3nf
springfox
dpdk
aggregation
windows-server-2003
amazon-quicksight
uitapgesturerecognizer
boost-asio
eviews
record
sharepoint-workflow
google-earth-engine
sim-card
magento-1.9.3
contract
xmldocument
wc
strftime
rfc3339
netbeans6.8
wpas
boxing
jqchart
janus
rsa-archer-grc
actor-platform
x-tag
jboss-tools
firebase-security
simevents
sklearn-pandas
wiredep
zen-cart
baasbox
execve
ghcjs
cocos3d
mdichild
kissfft
matrix-inverse
wxformbuilder
notorm
sphinxql
mvc-editor-templates
pagedown
video-codecs
redis-py
veracity
wcf-configuration
clrstoredprocedure
inline-formset
twitterizer
object-database
application-verifier
glui
feasibility
xpsdocument
fail-fast-fail-early
int64
entitykey

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App