solutions
This commit is contained in:
parent
6407f8f478
commit
de4ee10ee2
1 changed files with 46 additions and 0 deletions
46
asm/solutions.md
Normal file
46
asm/solutions.md
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
# zero
|
||||||
|
|
||||||
|
```
|
||||||
|
xor eax, eax
|
||||||
|
```
|
||||||
|
|
||||||
|
# one
|
||||||
|
```
|
||||||
|
xor eax, eax
|
||||||
|
inc eax
|
||||||
|
```
|
||||||
|
|
||||||
|
# next
|
||||||
|
```
|
||||||
|
inc ax
|
||||||
|
```
|
||||||
|
|
||||||
|
# prev
|
||||||
|
```
|
||||||
|
dec ax
|
||||||
|
```
|
||||||
|
|
||||||
|
# sum
|
||||||
|
```
|
||||||
|
mov dx, ax
|
||||||
|
add dx, bx
|
||||||
|
```
|
||||||
|
|
||||||
|
# sub
|
||||||
|
```
|
||||||
|
mov rdx, rax
|
||||||
|
sub rdx, rbx
|
||||||
|
```
|
||||||
|
|
||||||
|
# imul
|
||||||
|
```
|
||||||
|
imul bl
|
||||||
|
mov dx, ax
|
||||||
|
```
|
||||||
|
|
||||||
|
# idiv
|
||||||
|
```
|
||||||
|
cwd
|
||||||
|
idiv bx
|
||||||
|
mov dx, ax
|
||||||
|
```
|
Reference in a new issue