Difference between revisions of "PM Opc INC"

From SublabWiki
Jump to: navigation, search
(Joining 8 and 16 bits INC)
 
m (Execute)
 
Line 57: Line 57:
 
=== Execute ===
 
=== Execute ===
  
  A        = Register A
+
  A        = (8-Bits) Register A
  B        = Register B
+
  B        = (8-Bits) Register B
  L        = Register L
+
  L        = (8-Bits) Register L
  H        = Register H
+
  H        = (8-Bits) Register H
  N        = Register N
+
  N        = (8-Bits) Register N
  SP      = Register SP (Stack Pointer)
+
  SP      = (16-Bits) Register SP (Stack Pointer)
  BA      = Register BA: (B shl 8) or A
+
  BA      = (16-Bits) Register BA: (B shl 8) or A
  HL      = Register HL: (H shl 8) or L
+
  HL      = (16-Bits) Register HL: (H shl 8) or L
  X        = Register X
+
  X        = (16-Bits) Register X
  Y        = Register Y
+
  Y        = (16-Bits) Register Y
  [N+#nn]  = Memory: (I shl 16) or (N shl 8) or #nn
+
  [N+#nn]  = (8-Bits) Memory: (I shl 16) or (N shl 8) or #nn
  [HL]    = Memory: (I shl 16) or HL
+
  [HL]    = (8-Bits) Memory: (I shl 16) or HL
  
 
  ; INC Ds
 
  ; INC Ds
Line 75: Line 75:
 
   
 
   
 
  Ds = Ds + 1
 
  Ds = Ds + 1
+
 
 
=== Description ===
 
=== Description ===
  

Latest revision as of 00:38, 21 April 2009

INC = Increase Register by 1

Hex Mnemonic Cycles
80 INC A 8
81 INC B 8
82 INC L 8
83 INC H 8
84 INC N 8
85 nn INC [N+#nn] 16
86 INC [HL] 12
87 INC SP 8
90 INC BA 8
91 INC HL 8
92 INC X 8
93 INC Y 8

Execute

A        =  (8-Bits) Register A
B        =  (8-Bits) Register B
L        =  (8-Bits) Register L
H        =  (8-Bits) Register H
N        =  (8-Bits) Register N
SP       = (16-Bits) Register SP (Stack Pointer)
BA       = (16-Bits) Register BA: (B shl 8) or A
HL       = (16-Bits) Register HL: (H shl 8) or L
X        = (16-Bits) Register X
Y        = (16-Bits) Register Y
[N+#nn]  =  (8-Bits) Memory: (I shl 16) or (N shl 8) or #nn
[HL]     =  (8-Bits) Memory: (I shl 16) or HL
; INC Ds
;
; Ds = Source/Destination

Ds = Ds + 1

Description

"Destination" is incremented by 1.

Conditions

Zero: Set when result is 0

Carry, Overflow and Sign remain unchanged

Examples

; A = 0x55
INC A
; A = 0x56 (0x55 + 1 = 0x56)
; F = (Zero=0)
; [N+0x88] = 0xFF
INC [N+$88]
; [N+0x88] = 0x00 (0xFF + 1 = 0x00)
; F = (Zero=1)
; BA = 0x2997
INC BA
; BA = 0x2998 (0x2997 + 1 = 0x2998)
; F = (Zero=0)
; X = 0xFFFF
INC X
; X = 0x0000 (0xFFFF + 1 = 0x0000)
; F = (Zero=1)

« Back to Instruction set