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

Graph theory questions from my Algorithms quiz today that I'd like help understanding
Are there any open source Hierarchical Temporal Memory libraries? [closed]
Is there an algorithm for computing permutation of distances?
trying to understand string permutations?
Algorithm for sorting multisets
Sample algorithm to “linearize” a graph
Ticket drafting algorithm
Proof of detecting the start of cycle in linked list
Tiling patterns
Algorithm for schematizing (metro) maps
Frequency Count Of Algorithms
Big O complexity of finding cycles in an Undirected graph
Best approach for specific Object/Image Recognition task?
Algorithm to find fewest number of tags that encompass all items?
Algorithmic solution to find closest city based on lat/lon
Pagerank - Trouble

Categories

HOME
notepad++
asp.net-web-api
nunit
rsa
fftw
apiblueprint
dojo
visual-studio-emulator
google-cloud-datalab
opengl-3
sendgrid-api-v3
drop-down-menu
fhir
mel
enthought
watson-conversation
mxgraph
selenium-ide
3nf
http-post
job-scheduling
google-content-api
google-picker
enterprise-miner
sencha-touch
selinux
roslyn
direct3d11
licensing
underscore.js
tpm
paperjs
constexpr
autodesk-designautomation
aws-codecommit
mobx
cognos-bi
database-comparison
autolisp
wacom
github3.py
twos-complement
keras-layer
hibernate-search
roblox
salesforce-communities
timing
filesystemwatcher
mongoose-schema
file-sharing
apache-directory
strftime
dapper-simplecrud
optimizely
libgphoto2
zenhub
stdmap
colorbar
backbone-collections
git-flow
sundials
swingworker
rsa-archer-grc
pytables
winusb
tinkerpop3
delta
cassia
createprocess
findfirst
cycle2
highland.js
file-move
page.js
dock
rpart
zxspectrum
bcache
grouping-sets
document-repository
addressing-mode
entry-point
cbind
parallel-testing
jquery-slider
draw2d-js
rolify
beaker-testing
composite-component
pagedown
cardreader
mysql-error-2013
vfs
correlated-subquery
josql
predicatebuilder
w3c-geolocation
dataform
instantiationexception
drupal-fivestar
message-passing
application-verifier
pos-for-.net
strtod
perl5.12
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