added two more instruction descriptions to the review chapter for bit fields

This commit is contained in:
Perry Kivolowitz 2022-06-18 18:00:44 -05:00
parent 7395a6dd14
commit eb8199ce77

View file

@ -72,9 +72,46 @@ conditional branch to follow the instruction.
## `bfi`
This instruction mnemonic stands for Bit Field Insert. The word *Insert* should
really be copy. The official ARM [documentation](https://developer.arm.com/documentation/dui0801/g/A64-General-Instructions/BFI) explains this instruction
very well so we'll repeat it here:
*Bit Field Insert copies any number of low-order bits from a source register into the same number of adjacent bits at any position in the destination register, leaving other bits unchanged.*
The instruction has the following format:
```asm
bfi rd, rs, lsb, width
```
Starting at bit 0 of `rs`, `width` bits are copied to `rd` starting at bit
`lsb`.
The `bfi` instruction replaces as many as three instructions: likely a shift,
an `and` and an `orr`.
## `mvn`
This instruction takes only takes two operands (but permits an optional shift
to be explained below).
The basic syntax is:
```asm
mvn rd, rs
```
This flips all the bits in the source and copies them to the destination.
In addition to the basic instruction, there is also:
```asm
mvn rd, rs, *shift* num_bits
```
The *shift* and `num_bits` function the same way as described above including
the option to use `*shift*` as one of `lsl`, `lsr`, `asr` or `ror`.
## `lsl`
## `orr`