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

Symbolic Differentiation Algorithm
Dynamic programming graph algorithm
Graph: count cycles that include a node
What is the inductive invariant of the simple concurrent program?
Preventing lines from overlapping
Optimising manipulation of large vectors
Linked List Class in MATLAB - Insert node manually without insertAfter()
How to solve this with simple forward-backward algorithm?
Keep only largest/smallest sized versioned file each in a directory?
What is the next number in this sequence of numbers? [closed]
2D map translation computation
Find Shortest path to the items in a grocery store [duplicate]
Finding keywords in a set of small texts
Removing duplicate strings with limited memory [closed]
How to find the index of a k-permutation from n elements?
What does decrease-by-one algorithm mean? [duplicate]

Categories

HOME
design-patterns
linkedin
youtube-data-api-v3
fftw
edge
static-site
entity-framework-core
nsbundle
pearson-correlation
x264
data-visualization
missing-data
angularfire2
odoo-8
pattern-matching
project
little-proxy
openstreetmap
resultset
naivebayes
code-generation
docx
symfony-2.8
atlassian-stash
standards
intershop
template-engine
windows-xp
systemtime
react-toolbox
epsilon
interpreter
jquery-callback
xunit
strongname
game-theory
siri
moses
opentk
soot
dotspatial
dst
left-join
card.io
classcastexception
html-encode
mnist
processwire
video-capture
python-pptx
reactivekit
bc
unordered-map
azure-arm
naming
x++
pom.xml
dynamic-linq
serde
chai-as-promised
facebook-pixel
carrot2
oracleclient
boo
flac
django-1.10
swingworker
reachability
rmongo
async.js
appscale
qiime
fink
nio2
jbase
directdraw
lazybones
fuelcms
avahi
mraid
uvc
bcache
exceldatareader
mass-assignment
uncaught-typeerror
entry-point
strawberry-perl
mintty
dsym
sbcl
notorm
mongohq
observium
jquery-1.9
android-icons
video-codecs
alice
robotlegs
qi4j
qtconcurrent
subgraph
lambdaj
jdb
jquery-address
urlrewriter
xcelsius
linfu-dynamicproxy
int64
leader
netbeans6.1

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