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

Two pairs of numbers with same sum
algorithms complexity performance and space
How is pagerank calculated in a distributed way?
Identify the three types of flow of control that can express any algorithm [closed]
Algorithm to calculate parents and children with values and distances
Perfect square or not?
Expanding 8-bit color to 24-bit color
how to transfer a binary search tree to AVL tree
Evenly distribute Plot Co-ordinates onto a shape in 2D and 3D - For use in Prezi/Jmpress.js
Finding Most Compressible Vector Within Given Bounds?
How O(V+E) is equal to O(b^d) In BFS [closed]
Logic for rate approximation
Hot to find the closest free points on grid
How many traversals need to be known to construct a BST
Pearson Correlation with Haskell Float Type Conflict
Algorithm for polygon with weight on vertices and operations on edges

Categories

HOME
windows
httparty
fabricjs
kentico
api
grafana
bitbucket-api
spring-data-mongodb
google-apps
ado.net
regular-language
babeljs
python-multithreading
mvc5
ipmitool
frequency-distribution
heat
dreamweaver
smartclient
google-container-registry
foreign-keys
solrcloud
guzzle
pagespeed
scriptella
mount
jquery-multiselect
amazon-quicksight
bringtofront
comparable
finagle
ntp
mobx
clickjacking
imx6
apiary.io
magento-1.9.2.4
playframework-2.1
projects-and-solutions
ods
apriori
android-ibeacon
placeholder
libgphoto2
user-defined-fields
lightning
edit
arules
change-tracking
preprocessor
dup
delta
gcloud-ruby
createprocess
ellucian-scribe
kendo-upload
jnlua
boomerang
xenomai
xvim
extjs-grid
atoi
liquid-layout
apache-commons-daemon
canvg
shopizer
bcache
openbabel
android-vibration
structuremap3
trdion2011
named-parameters
lambda-architecture
ios8-extension
git-repo
code-duplication
observium
flex++
font-awesome-4.0.0
patricia-trie
boost-msm
vfs
node-redis
load-time
object-database
nstokenfield
fdf
application-planning
linfu-dynamicproxy

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