GB Programming: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
>ISSOtm
m (→‎Chaining conditionals: Fixed a mistake.)
>ISSOtm
(→‎Instructions get!: Remove instructions that don't exist on the Game Boy)
Line 501: Line 501:
!Syntax
!Syntax
!Effect
!Effect
!S
!Z
!Z
!P/V
!C
!C
|-
|-
Line 509: Line 507:
|Adds one to the operand ("increments" it)
|Adds one to the operand ("increments" it)
|Affected, except for reg16
|Affected, except for reg16
|Affected, except for reg16
|Detects overflow, except for reg16
|Not affected
|Not affected
|-
|-
Line 516: Line 512:
|Subtracts one to the operand ("decrements" it)
|Subtracts one to the operand ("decrements" it)
|Affected, except for reg16
|Affected, except for reg16
|Affected, except for reg16
|Detects overflow, except for reg16
|Not affected
|Not affected
|-
|-
|ADD A, <nowiki>{reg8 | imm8 | reg16 | (hl)}</nowiki>
|ADD A, <nowiki>{reg8 | imm8 | (hl)}</nowiki>
|Adds the operand to the accumulator
|Adds the operand to the accumulator
|Affected
|Affected
|Affected
|Detects overflow
|Not affected
|Not affected
|-
|-
Line 530: Line 522:
|Adds the operand to HL
|Adds the operand to HL
|Affected
|Affected
|Affected
|Detects overflow
|Not affected
|Not affected
|-
|-
|SUB <nowiki>{reg8 | imm8 | reg16 | (hl)}</nowiki>
|SUB <nowiki>{reg8 | imm8 | (hl)}</nowiki>
|Subtracts the operand from the accumulator. The syntax SUB A, <nowiki>{...}</nowiki> is also valid but less common.
|Subtracts the operand from the accumulator. The syntax SUB A, <nowiki>{...}</nowiki> is also valid but less common.
|Affected
|Affected
|Affected
|Detects overflow
|Not affected
|-
|SBC HL, reg16
|Subtracts the operand plus the carry flag from HL
|Affected
|Affected
|Detects overflow
|Not affected
|Not affected
|}
|}