Changes

Jump to: navigation, search

GBZ80

837 bytes added, 23 April
/* GBZ80 instructions */
|-
| cp n || 11111110 nnnnnnnn || 2 || tmp := a - n
|}
 
=== BCD group ===
 
{| class="wikitable" style="white-space: nowrap;"
|-
! Instruction !! Opcode !! Cycles !! Z !! N !! H !! C !! Effect !! Description
|-
| daa || 00100111 || 1 || + || - || X || X || tmp := a,
if nf then
if hf or [a and 0x0f > 9] then tmp -= 0x06
if cf or [a > 0x99] then tmp -= 0x60
else
if hf or [a and 0x0f > 9] then tmp += 0x06
if cf or [a > 0x99] then tmp += 0x60
endif,
tmp => flags, cf := cf or [a > 0x99],
hf := a.4 xor tmp.4, a := tmp
|| Decimal Adjust Accumulator
|-
| rrd || ED 01100111 || 5 || + || 0 || 0 || - || tmp := (hl), (hl) := [tmp >> 4] + [[a and 0x0f] << 4],
a := [a and 0xf0] + [tmp and 0x0f] => flags
|| Rotate Right Decimal
|-
| rld || ED 01101111 || 5 || + || 0 || 0 || - || tmp := [(hl) << 4] + [a and 0x0f], (hl) := tmp,
a := [a and 0xf0] + [tmp >> 8] => flags
|| Rotate Left Decimal
|}
13,173
edits