Anonymous user
GB Programming: Difference between revisions
m
Text replacement - "(hl)" to "[hl]"
m (Text replacement - "(\bld(?:|i|l|d|h) (?:.+, ?)?)\((.+)\)" to "$1[$2]") |
m (Text replacement - "(hl)" to "[hl]") |
||
Line 446:
So now, how to access memory? With parentheses! To access memory address $CD38, you just have to use ($CD38). Yay!
To access the memory location pointed to by HL, just do...
So, to retrieve the value at memory address $6511 into register A : ''ld a, [$6511]''
Line 494:
!C
|-
|INC <nowiki>{reg8 | reg16 |
|Adds one to the operand ("increments" it)
|Affected, except for reg16
|Not affected
|-
|DEC <nowiki>{reg8 | reg16 |
|Subtracts one to the operand ("decrements" it)
|Affected, except for reg16
|Not affected
|-
|ADD A, <nowiki>{reg8 | imm8 |
|Adds the operand to the accumulator
|Affected
Line 514:
|Not affected
|-
|SUB <nowiki>{reg8 | imm8 |
|Subtracts the operand from the accumulator. The syntax SUB A, <nowiki>{...}</nowiki> is also valid but less common.
|Affected
Line 582:
ld b, [hl]
sub a, b
inc
inc hl
ld [hl], b
Line 819:
ld b, [hl]
</pre>
If
Otherwise, executions continues through, increments hl twice, then jumps to "someplace"
Line 1,074:
Notice here that doing ''sub a, b'' actually increased A's value!
inc
inc hl ; HL = $C005
|