mirror of
https://github.com/pkivolowitz/asm_book.git
synced 2026-06-23 07:28:04 +08:00
Update ldr.md
This commit is contained in:
parent
1cdc7f4c92
commit
0b4d55f0e3
1 changed files with 1 additions and 1 deletions
|
|
@ -163,7 +163,7 @@ is implemented as:
|
||||||
add x1, x0, x1, lsl 3
|
add x1, x0, x1, lsl 3
|
||||||
```
|
```
|
||||||
|
|
||||||
We are performing address arithmetic on `longs`. Each `long` is 8 bytes wide. `x1, lsl 3` means "before adding the value of `x1` to `x0`, multiple `x1` by 8." Eight is 2 raised to the power of 3. `lsl 3` means shift left by 3 bits ... shifting is a fast way of integer multiplication (and division) by powers of 2.
|
We are performing address arithmetic on `longs`. Each `long` is 8 bytes wide. `x1, lsl 3` means "before adding the value of `x1` to `x0`, multiply `x1` by 8." Eight is 2 raised to the power of 3. `lsl 3` means shift left by 3 bits ... shifting is a fast way of integer multiplication (and division) by powers of 2.
|
||||||
|
|
||||||
`Line 13` is the branch to the *bottom* of the loop where the decision code is written. We saw how this can save an instruction [here](../for/README.md).
|
`Line 13` is the branch to the *bottom* of the loop where the decision code is written. We saw how this can save an instruction [here](../for/README.md).
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue