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

Deleting an element from a kd-tree of two dimensions
Calculating task start times
Advanced Banner-Rotation Algorithms
Programming experiments
Algorithm(s) for spotting anomalies (“spikes”) in traffic data
Algorithm to auto-arrange entity relationship diagram
Indexing algorithms to develop an app like google desktop search?
Lesser known string similarity metrics
IntelliSense rules for “get best match” during member selection
Which sorting algorithm is best suited to re-sort an almost fully sorted list?
Algorithm to minimize the space complexity of a sparse matrix? [closed]
What is an algorithm for joining PCM files?
Find the first un-repeated character in a string
How to encode latitude/longitude for box search?
I have an algorithm problem having to do with scheduling teams in rotation as fairly as possible
Find unique common element from 3 arrays

Categories

HOME
uml
cygwin
spark-streaming
ggplot2
flex
static-site
cq5
vxml
code-coverage
google-cloud-datalab
trac
google-schemas
siddhi
windows-ce
mautic
stellar.js
favicon
symmetricds
heat
entitymanager
undertow
ksh
spring-async
backpack-for-laravel
ms-access-web-app
amazon-quicksight
sinch
gp
custom-controls
xbox
cognos-bi
git-squash
android-sugarorm
github3.py
contacts
sharding
ovf
magento-2.0.7
vugen
aquamacs
filehandle
skin
reshape
swingworker
rocks
spring-cloud-feign
uicolor
beamer
scaffolding
installshield-2010
avspeechsynthesizer
firebase-security
nullable
asyncdisplaykit
avisynth
dock
batik
graphics2d
pyobjc
typeconverter
fail2ban
rapidsvn
deform
spring-remoting
decoupling
clickbank
amslidemenu
drupal-nodes
kendo-dataviz
dolby-audio-api
pclzip
virtual-pc
fb.ui
idn
mkv
cakephp-1.2
zope.interface
listitem
lambdaj
usertype
google-maps-mobile
relative
update-statement
google-ajax-api
cgbitmapcontextcreate
dataform
msr
qglwidget
objective-j
facebook-iframe
rowlex
web-garden
zen
unmanagedresources
lemmatization

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App