Bitwise Operations Flashcards
ands and its alias
sets or clears N and Z flags according to the result
tst is an alias for ands stored in xzr
The use of bitmasking
Setting certain bits in a number
Bit Clear’s logical equivalent
AND NOT
Alias of mvn
orn with xzr
Logical Shift Left
0 is shifted into rightmost bit
Shifted out bits are lost
Logical Shift right
0 is shifted into leftmost bit
Shifted out bits are lost
(T/F)LSR is division by power of two and LSL is multiplication by power of two
TRUE
Arithmetic Shift RIght
Sign bit is duplicated when shifting
Preserves sign when dividing by power of two
Rotate Right
Bits shifted out on the right are inserted on the left
Sign Extend Byte(sxtb)
Sign extends bit 7 into bits 8-31
Sign extend Halfword(sxth)
Sign-extends bit 15 to bits 16-31
Signed extend word(sxtw)
sign extends bit 31 into bits 32-63
Unsigned extend byts(uxtb)
Zero-extends bits 8-31
Unsigned Extend Halfword(uxth)
Zero-extends bits 16-31