Bit manipulations

Z MAM wiki

(Rozdíly mezi verzemi)
Přejít na: navigace, hledání
(bit manip. instr.)
(few words about bit instructions)
 
Řádka 1: Řádka 1:
See [http://www.atmel.com/atmel/acrobat/doc0856.pdf AVR Instruction Set Manual] for details of instructions.
See [http://www.atmel.com/atmel/acrobat/doc0856.pdf AVR Instruction Set Manual] for details of instructions.
 +
These are the basic instructions you want to know:
* LSL, LSR, ASR, ROL, ROR - shifts and rotations
* LSL, LSR, ASR, ROL, ROR - shifts and rotations
* AND, OR, EOR, ANDI, ORI - logical functions bit-per-bit (usable with hex masks)
* AND, OR, EOR, ANDI, ORI - logical functions bit-per-bit (usable with hex masks)
 +
 +
These are special for small chips but quite handy (last resort if those above are not good):
* BST, BLD - one-bit moves via T flag
* BST, BLD - one-bit moves via T flag
 +
 +
And you can also use:
 +
* SWAP

Aktuální verze z 15. 3. 2012, 15:01

See AVR Instruction Set Manual for details of instructions.

These are the basic instructions you want to know:

  • LSL, LSR, ASR, ROL, ROR - shifts and rotations
  • AND, OR, EOR, ANDI, ORI - logical functions bit-per-bit (usable with hex masks)

These are special for small chips but quite handy (last resort if those above are not good):

  • BST, BLD - one-bit moves via T flag

And you can also use:

  • SWAP
Osobní nástroje