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

Optimizing the total sum of weighted intervals
Algorithm for minimizing schedule collisions for conferences
Selling Apartments Recursive Definition
Algorithm to Maximize Degree Centrality of Subgraph
Algorithm to find matching real values in a list
An efficient solution to find if n vertex disjoint path exist
Search in locality sensitive hashing
Trie with association between words
Iterative/ Non-Recursive Merge Sort
Decompress delta compressed sequence of numbers in Scala
Best Algorithm to distribute n elements to x groups
Dynamic programming: box stacking variation
Implementing Babai's quasi-polynomial graph isomorphism?
can t(n)=2t(n/2)+n^0.5/logn can be solved using masters theorem?
search binary tree linear function [closed]
Algorithm to calculate shortest time in which two people can collect K items from N cities

Categories

HOME
service-worker
shell
developer-tools
c++11
c99
redux-form
ns-3
spring-data-redis
rendering
appcelerator
onclick
jax-ws
syntaxnet
commonjs
android-securityexception
line
php-5.6
supervisor
frequency-distribution
cumulocity
docx
keytool
google-data-studio
html5-appcache
charles
lilypond
inno-download-plugin
roslyn
dynamically-generated
asymptotic-complexity
cppreference
nsurl
hibernate-search
latitude-longitude
zoomify
git-rewrite-history
jpad
datacachefactory
xmldocument
plan-9
puredata
fwrite
tinymce-3
activeperl
opengl-4
skin
objectscript
shinobi
smartfoxserver
node-request
docpad
parfor
pacemaker
myspace
burrows-wheeler-transform
x-tag
tooleap
lean
upx
inf
linklabel
wso2greg
dnssec
typeconverter
j-security-check
at-job
theos
cosine-similarity
webfinger
appserver
kissfft
alternate
draw2d-js
syndicationfeed
eclipse-kepler
gd-graph
sphinxql
neos-server
css-reset
pagedown
cardreader
asplinkbutton
wimax
cakephp-1.2
correlated-subquery
urlrewriter
denied
update-statement
lr
massive
cuteeditor
opml
dsl-tools
cldc
product-management
lemmatization
appliance

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