mirror of
https://github.com/pkivolowitz/asm_book.git
synced 2026-06-25 00:16:44 +08:00
spelling and moving around chapters
This commit is contained in:
parent
eb80d99d37
commit
45db9bbb07
7 changed files with 50 additions and 35 deletions
16
.vscode/settings.json
vendored
16
.vscode/settings.json
vendored
|
|
@ -4,12 +4,23 @@
|
||||||
"argc",
|
"argc",
|
||||||
"argv",
|
"argv",
|
||||||
"asciz",
|
"asciz",
|
||||||
|
"cbnz",
|
||||||
"cout",
|
"cout",
|
||||||
"csel",
|
"csel",
|
||||||
|
"fizzbuzz",
|
||||||
|
"fname",
|
||||||
"Formulus",
|
"Formulus",
|
||||||
|
"funcs",
|
||||||
"iostream",
|
"iostream",
|
||||||
|
"ldrb",
|
||||||
|
"ldrh",
|
||||||
|
"lname",
|
||||||
"memcpy",
|
"memcpy",
|
||||||
|
"pimm",
|
||||||
"pseudocode",
|
"pseudocode",
|
||||||
|
"regs",
|
||||||
|
"simm",
|
||||||
|
"smaddl",
|
||||||
"stringstream",
|
"stringstream",
|
||||||
"strncpy",
|
"strncpy",
|
||||||
"struct",
|
"struct",
|
||||||
|
|
@ -17,5 +28,8 @@
|
||||||
],
|
],
|
||||||
"markdownlint.config": {
|
"markdownlint.config": {
|
||||||
"MD024":false
|
"MD024":false
|
||||||
}
|
},
|
||||||
|
"cSpell.ignoreWords": [
|
||||||
|
"foov"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
19
README.md
19
README.md
|
|
@ -45,15 +45,16 @@ the 64 bit ARM Instruction Set Architecture (ISA).
|
||||||
| 1 | [Hello World](./section_1/hello_world/README.md) |
|
| 1 | [Hello World](./section_1/hello_world/README.md) |
|
||||||
| 2 | [If Statements](./section_1/if/README.md) |
|
| 2 | [If Statements](./section_1/if/README.md) |
|
||||||
| 3 | Loops |
|
| 3 | Loops |
|
||||||
| 3 a | [ While Loops](./section_1/while/README.md) |
|
| 3 a | [....While Loops](./section_1/while/README.md) |
|
||||||
| 3 b | [ For Loops](./section_1/for/README.md) |
|
| 3 b | [....For Loops](./section_1/for/README.md) |
|
||||||
| 3 c | [ Implementing Continue](./section_1/for/README.md#implementing-a-continue)
|
| 3 c | [....Implementing Continue](./section_1/for/README.md#implementing-a-continue)
|
||||||
| 3 d | [ Implementing Break](./section_1/for/README.md#implementing-a-break)
|
| 3 d | [....Implementing Break](./section_1/for/README.md#implementing-a-break)
|
||||||
| 4 | [Interlude - Registers](./section_1/regs/README.md) |
|
| 4 | Interludes |
|
||||||
| 5 | [Interlude - Load and Store](./section_1/regs/ldr.md) |
|
| 4 a | [....Registers](./section_1/regs/README.md) |
|
||||||
| 6 | [Calling and Returning From Functions](./section_1/funcs/README.md) |
|
| 4 b | [....Load and Store](./section_1/regs/ldr.md) |
|
||||||
| 7 | [Passing Parameters To Functions](./section_1/funcs/README2.md) |
|
| 5 | [Calling and Returning From Functions](./section_1/funcs/README.md) |
|
||||||
| 8 | [FizzBuzz - a Complete Program](./section_1/fizzbuzz/README.md) |
|
| 6 | [Passing Parameters To Functions](./section_1/funcs/README2.md) |
|
||||||
|
| 7 | [FizzBuzz - a Complete Program](./section_1/fizzbuzz/README.md) |
|
||||||
|
|
||||||
## Section 2 - Stuff
|
## Section 2 - Stuff
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Section 1 / Chapter 8 / FizzBuzz
|
# Section 1 / Chapter 7 / FizzBuzz
|
||||||
|
|
||||||
In this chapter we build the classic tech interview question: FizzBuzz.
|
In this chapter we build the classic tech interview question: FizzBuzz.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Section 1 / Chapter 6 / Calling and Returning From Functions
|
# Section 1 / Chapter 5 / Calling and Returning From Functions
|
||||||
|
|
||||||
Calling functions, passing parameters to them and receiving back return values is basic to using `C` and and `C++`. Calling methods (which are functions connected to classes) is similar but with enough differences to warrant its own discussion to be provided later in the chapter on [structs](../struct/structs.md).
|
Calling functions, passing parameters to them and receiving back return values is basic to using `C` and and `C++`. Calling methods (which are functions connected to classes) is similar but with enough differences to warrant its own discussion to be provided later in the chapter on [structs](../struct/structs.md).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Section 1 / Chapter 7 / Passing Parameters To Functions
|
# Section 1 / Chapter 6 / Passing Parameters To Functions
|
||||||
|
|
||||||
Up to 8 parameters can be passed directly via registers. Each parameter can be up to the size of an address, long or double (8 bytes). If you need to pass more than 8 parameters or you need to pass parameters which are larger than 8 bytes or are `structs`, you would use a different technique described later.
|
Up to 8 parameters can be passed directly via registers. Each parameter can be up to the size of an address, long or double (8 bytes). If you need to pass more than 8 parameters or you need to pass parameters which are larger than 8 bytes or are `structs`, you would use a different technique described later.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Section 1 / Chapter 4 / Interlude - Registers
|
# Section 1 / Chapter 4 a / Interlude - Registers
|
||||||
|
|
||||||
We have discussed and used registers in the previous chapters without explanation. This chapter
|
We have discussed and used registers in the previous chapters without explanation. This chapter
|
||||||
introduces the concept of registers and explains why registers are critical.
|
introduces the concept of registers and explains why registers are critical.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Section 1 / Chapter 5 / Interlude - Load and Store
|
# Section 1 / Chapter 4 b / Interlude - Load and Store
|
||||||
|
|
||||||
In this section we will review the `ldr` and `str` families of instructions.
|
In this section we will review the `ldr` and `str` families of instructions.
|
||||||
|
|
||||||
|
|
@ -487,7 +487,7 @@ of 8.
|
||||||
smaddl x4, w1, w5, x3 // initialize end_ptr // 19
|
smaddl x4, w1, w5, x3 // initialize end_ptr // 19
|
||||||
```
|
```
|
||||||
|
|
||||||
`w1` (the length) will be multipled by `w5` (the size of each array member), added to `x3` (the base address of the array) and the result will be placed into `x4`. This assembly language instruction implements this in C:
|
`w1` (the length) will be multiplied by `w5` (the size of each array member), added to `x3` (the base address of the array) and the result will be placed into `x4`. This assembly language instruction implements this in C:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
struct Person * end_ptr = people + length; /* 20 */
|
struct Person * end_ptr = people + length; /* 20 */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue