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

Simple Paths between 2 nodes
algorithm for shortest weighted path - frequently changing edges
Depth First Search?
K-Size Subgraphs
Point location in tetrahedron meshes
Determining the big-O runtimes of these different loops?
The 4-way gradient fill. Possible?
Marching Cube Ambiguities Versus Marching Tetrahedron
Is there a complex date filter algorithm?
How to implement a gapless block layout algorithm?
algorithm to control intensities of multiple lights
Binary Indexed Tree (Fenwick Tree) - about updating
Why the node split when inserting into 2-3-4 tree?
Solving “string reduction” challenge
Special Sorting
Codechef PERMUT2 solution

Categories

HOME
google-cloud-platform
oracle12c
spark-streaming
wakanda
gpu
redux-form
angular2-material
case
yahoo-finance
solver
spring-data-mongodb
rds
p2p
categorical-data
openpyxl
ibeacon-android
android-securityexception
mxgraph
xcodebuild
libc
screen-readers
firefox-addon
pyramid
mapstruct
sencha-touch
question2answer
tosca
short-url
roundup
itunes
custom-post-type
pylons
angular-translate
bringtofront
user-defined-functions
calculation
cart
autolisp
processwire
openerp-7
demo
p4merge
spring-mvc-test
numberpicker
portforwarding
print-css
lpsolve
ssrs-2014
contract
knime
servermanager
spring-integration-sftp
corruption
page-replacement
subnet
java-6
oracleclient
sundials
d3-force-directed
django-1.10
rxtx
rsa-archer-grc
rmongo
polyline
gets
pure-css
omxplayer
segment-io
vulcanize
windows-azure-queues
model-associations
hclust
spreadjs
cda
kiosk
blitline
xvim
video-player
fuelcms
pax-exam
amiga
haskell-warp
jsvc
botan
node-serialport
grouping-sets
genymotion-call
ss7
ray
twitter-bootstrap-rails
mt4j
bin
printdialog
beaker-testing
poker
cascadingdropdown
swfobject
web-notifications
entity-attribute-value
denied
xcelsius
mbeans
easyb
application-verifier
image-capture

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