Difference between revisions of "PM Opc NOT"

From SublabWiki
Jump to: navigation, search
m (Conditions)
(NOT = Logical NOT)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
== NOT = Logical NOT ==
 
== NOT = Logical NOT ==
  
{| border="1" style="text-align:left"
+
{| border="1" style="text-align:left" class="sortable"
 
!Hex
 
!Hex
 
!Mnemonic
 
!Mnemonic
Line 14: Line 14:
 
|12
 
|12
 
|-
 
|-
|CE A2
+
|CE A2 nn
 
|NOT [N+#nn]
 
|NOT [N+#nn]
 
|20
 
|20
Line 44: Line 44:
 
Zero: Set when result is 0
 
Zero: Set when result is 0
  
Sign: Set when 7th bit of the result is 1
+
Sign: Set when bit 7 of the result is 1
  
Carry and Overflow remain unchanged.
+
Carry and Overflow remain unchanged
  
 
=== Examples ===
 
=== Examples ===
  
 
  ; A = 0x01
 
  ; A = 0x01
  NOT A
+
  '''NOT A'''
 
  ; A = 0xFE
 
  ; A = 0xFE
  ; F = (Zero = 0):(Sign=1)
+
  ; F = (Zero=0):(Sign=1)
  
 
  ; B = 0x85
 
  ; B = 0x85
  NOT B
+
  '''NOT B'''
 
  ; B = 0x7A
 
  ; B = 0x7A
  ; F = (Zero = 0):(Sign=0)
+
  ; F = (Zero=0):(Sign=0)
  
 
  ; [HL] = 0xFF
 
  ; [HL] = 0xFF
  NOT [HL]
+
  '''NOT [HL]'''
 
  ; [HL] = 0x00
 
  ; [HL] = 0x00
  ; F = (Zero = 1):(Sign=0)
+
  ; F = (Zero=1):(Sign=0)
  
 
[[PM_InstructionList|'''« Back to Instruction set''']]
 
[[PM_InstructionList|'''« Back to Instruction set''']]

Latest revision as of 12:48, 27 March 2010

NOT = Logical NOT

Hex Mnemonic Cycles
CE A0 NOT A 12
CE A1 NOT B 12
CE A2 nn NOT [N+#nn] 20
CE A3 NOT [HL] 16

Execute

A       = Register A
B       = Register B
[N+#nn] = Memory: (I shl 16) or (N shl 8) or #nn
[HL]    = Memory: (I shl 16) or HL
; NOT Ds
;
; Ds = Source/Destination

Ds = Ds XOR $FF

Description

8-Bits Destination is inverted (all bits).

Conditions

Zero: Set when result is 0

Sign: Set when bit 7 of the result is 1

Carry and Overflow remain unchanged

Examples

; A = 0x01
NOT A
; A = 0xFE
; F = (Zero=0):(Sign=1)
; B = 0x85
NOT B
; B = 0x7A
; F = (Zero=0):(Sign=0)
; [HL] = 0xFF
NOT [HL]
; [HL] = 0x00
; F = (Zero=1):(Sign=0)

« Back to Instruction set