Skip to content
Snippets Groups Projects
Commit 6f8b429d authored by Adelina Maria ALEXE's avatar Adelina Maria ALEXE
Browse files

modified heading

parent 324d9c8f
No related branches found
No related tags found
No related merge requests found
......@@ -108,7 +108,7 @@ The last 3 rows represent the second operation.
SHL (Shift left) and SHR (Shift right) are bitwise shift instructions.
### Usage - shl, shr
#### Usage - shl, shr
`SHL destination, no_bits_shifted`
......@@ -130,11 +130,11 @@ SHL (Shift left) and SHR (Shift right) are bitwise shift instructions.
### Conditional Statements
### CMP Instrunction
#### CMP Instrunction
`CMP` instruction compares two values by substracting the second operand from the first. It updates CPU flags, but does not store the result.
### Usage - cmp
#### Usage - cmp
`CMP operand1, operand2`
......@@ -159,7 +159,7 @@ Here's a short description of each conditional jump:
- **JL** (Jump if Less): Jumps if the first value is less than the second.
- **JLE** (Jump if Less or Equal): Jumps if the first value is less than or equal to the second.
### Usage
#### Usage
`JMP label`
......@@ -171,7 +171,7 @@ Here's a short description of each conditional jump:
`JL label`
### C - ASM translation
#### C - ASM translation
| **C Code** | **ASM Code** |
|------------- |---------------- |
......@@ -185,7 +185,7 @@ Here's a short description of each conditional jump:
### Loops - for, while
### `for` loop
#### `for` loop
| **C Code** | **ASM Code** |
|------------- |---------------- |
......@@ -198,13 +198,13 @@ Here's a short description of each conditional jump:
| | `JMP start_loop` |
| `}` | `end_loop:` |
### `while` loop
#### `while` loop
| **C Code** | **ASM Code** |
|------------- |---------------- |
| `while (b < 5) {` | `start_loop:` |
| | `CMP ebx, 5` |
| | `JGE end_loop` |
| `// some code here` | `; some code that makes b greater or equal than 5` |
| `// some code here` | `; some code that makes b greater than or equal to 5` |
| | `JMP start_loop` |
| `}` | `end_loop:` |
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment