Skip to content

Commit

Permalink
Update GUIDE.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
ronknight committed Jul 19, 2024
1 parent c454c92 commit 677ddea
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Assembler/GUIDE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ int 0x80

```

* The first line move the number 56 into register ecx.
* The second line subtract 10 from the ecx register.
* The first line move the number 56 into register ecx.
* The second line subtracts 10 from the ecx register.
* The third line move the number 4 into the eax register. This is for the print-function.
* The fourt line call interrupt 0x80, thus the result will print onto console.
* The fourth line call interrupt 0x80, thus the result will print onto console.
* The fifth line is a new line. This is important.

**Important: close each line with a newline!**
Expand Down Expand Up @@ -67,7 +67,7 @@ int 0x80

```

**Important: The arithmetic commands (add, sub) works only with registers or constants.
**Important: The arithmetic commands (add, sub) work only with registers or constants.
Therefore we must use the register ebx as a placeholder, above.**


Expand All @@ -79,20 +79,20 @@ Result of code, above.

### Comments available

Comments begin with ; and ends with a newline.
We noticed a comment, above.
Comments begin with ; and end with a newline.
We noticed a comment above.

### Push and Pop

Sometimes we must save the content of a register, against losing of data.
Sometimes we must save the content of a register, against losing data.
Therefor we use the push and pop command.

```
push eax

```

This line will push the content of register eax onto the stack.
This line will push the contents of register eax onto the stack.

```
pop ecx
Expand All @@ -109,7 +109,7 @@ pop [register]

### Jumps

With the command **cmp** we can compare two register.
With the command **cmp** we can compare two registers.

```
cmp r0, r1
Expand All @@ -119,7 +119,7 @@ jmp l2
```

Are the two register equal? The the command **je** is actively and jumps to label **l1**
Otherwise the command **jmp** is actively and jumps to label **l2**
Otherwise, the command **jmp** is actively and jumps to label **l2**

#### Labels

Expand Down

0 comments on commit 677ddea

Please sign in to comment.