mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-18 02:06:43 +00:00
Added INC and DEC instructions
parent
fedb7c89c8
commit
47995c9580
@ -8,9 +8,11 @@
|
||||
| [**BRK**](#brk) | *None* | 0x00 |`- - - - 1` |
|
||||
| [**CALL**](#call) *target* | *mem/reg/imm* | 0x15 |`- - - - -` |
|
||||
| [**CMP**](#cmp) *destination*, *source* | *mem/reg*, *mem/reg/imm* | 0x0C |`X X X X -` |
|
||||
| [**DEC**](#dec) *destination* | *mem/reg* | 0x2B | `- X X X -` |
|
||||
| [**DIV**](#div) *source* | *mem/reg/imm* | 0x18 |`- - - - -` |
|
||||
| [**HWI**](#hwi) *source* | *mem/reg/imm* | 0x09 |`- - - - -` |
|
||||
| [**HWQ**](#hwq) *source* | *mem/reg/imm* | 0x1C |`- - - - -` |
|
||||
| [**INC**](#inc) *destination* | *mem/reg* | 0x2A | `- X X X -` |
|
||||
| [**JC**](#jc) *target* | *mem/reg/imm* | 0x21 |`- - - - -` |
|
||||
| [**JG**](#jg) *target* | *mem/reg/imm* | 0x0F |`- - - - -` |
|
||||
| [**JGE**](#jge) *target* | *mem/reg/imm* | 0x10 |`- - - - -` |
|
||||
@ -857,6 +859,32 @@ if count == 1:
|
||||
OVERFLOW_FLAG = (old_sign_bit != new_sign_bit)
|
||||
```
|
||||
|
||||
### INC
|
||||
#### Details
|
||||
| mnemonic | opcode | operands | carry | zero | sign | overflow | break |
|
||||
| -------- | ------ | -------- | ----- | ---- | ---- | -------- | ----- |
|
||||
| `INC destination` | `0x2A` | `destination` : `mem` / `reg` | `-` | `X` | `X` | `X` | `-` |
|
||||
#### Description
|
||||
`INC` adds one to the value of destination, replacing the previous value. Unlike [**ADD**](#add) the carry flag is not modified. If you wish the carry flag to be modified then use `add dest, 1` instead
|
||||
|
||||
### Pseudo code
|
||||
```py
|
||||
destination = destination + 1
|
||||
```
|
||||
### DEC
|
||||
#### Details
|
||||
| mnemonic | opcode | operands | carry | zero | sign | overflow | break |
|
||||
| -------- | ------ | -------- | ----- | ---- | ---- | -------- | ----- |
|
||||
| `DEC destination` | `0x2B` | `destination` : `mem` / `reg` | `-` | `X` | `X` | `X` | `-` |
|
||||
#### Description
|
||||
`DEC` adds one to the value of destination, replacing the previous value. Unlike [**SUB**](#sub) the carry flag is not modified. If you wish the carry flag to be modified then use `sub dest, 1` instead
|
||||
|
||||
### Pseudo code
|
||||
```py
|
||||
destination = destination - 1
|
||||
```
|
||||
|
||||
|
||||
### NOP
|
||||
#### Details
|
||||
| mnemonic | opcode | operands | carry | zero | sign | overflow | break |
|
||||
|
Loading…
x
Reference in New Issue
Block a user