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

How to convert a polygon to a set on non-overlapping triangles?
Finding path with maximum minimum capacity in graph
Consolidate 10 bit Value into a Unique Byte
How to implement a pure tail-recursive insert for BST?
how to test a pop order is legal or not?
Interval Tree Using C++ STL <map> or <set>
recurrence relation dependent inversly on n
How do I get a 3D cross section of a 4D mesh?
Volleyball Player Combination
Understanding the select algorithm
Aranging integers in a specific order
Finding the largest connected Lines In Map [closed]
factorial algorithm in pseudo code
Confused in my Linear Search Algo
Computational complexity of k-means
Calculate distance using GPS : How to consider accuracy differences

Categories

HOME
phantom-dsl
fpga
angular-formly
package
google-apps
onclick
google-cloud-datalab
recordrtc
p2p
okhttp
libc
dynatrace
altera
keytool
event-sourcing
job-scheduling
microsoft-dynamics-nav
feathersjs
vuejs
sigma.js
sar
string-concatenation
visual-studio-extensions
joptionpane
hta
zxing
siri
android-things
winexe
exchangewebservices
ceylon
bioinformatics
dotspatial
cart
testbed
jmockit
glib
html-encode
protege4
latitude-longitude
docfx
alphabetical
reactivekit
tex
password-protection
metawidget
opensmpp
oracle-service-bus
bindingnavigator
http-request
apache-spark-dataset
x++
jide
flask-restful
openresty
convex-optimization
trojan
oracleclient
reshape
filenet
branch-prediction
taocp
segment-io
hclust
nservicebus5
angular-ui-typeahead
phpwebsocket
lz77
halcon
realsense
spring-retry
concurrentmodification
tfs-workitem
themoviedb-api
django-urls
.bash-profile
evolus-pencil
nutiteq
gamekit
code-documentation
viewer
android-vibration
administration
raygun
with-statement
lambda-architecture
mintty
gae-quotas
koala
inappsettingskit
pclzip
composite-component
insert-id
stacky
chart-director
apache-abdera
device-width
pstack
fragmenttransaction
uimanageddocument
inkcanvas
cross-database
entity-attribute-value
matlab-load
mysql-error-1205
uideviceorientation
silent
isapi-extension
wordprocessingml
perl5.12
application-planning
commercial-application

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