z80:Opcodes:SBC

From Learn @ Cemetech
Revision as of 22:37, 5 February 2016 by Maintenance script (talk | contribs) (Initial automated import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Sum of second operand and carry flag is subtracted from the first operand. Results are written into the first operand.

Syntax

   sbc a,op8	;8 bits
   sbc hl,op16	;16 bits

Allowed Instructions

   sbc a,a
   sbc a,b
   sbc a,c
   sbc a,d
   sbc a,e
   sbc a,h
   sbc a,l
   sbc a,ixh
   sbc a,ixl
   sbc a,iyh
   sbc a,iyl
   sbc a,(hl)
   sbc a,(ix+n)
   sbc a,(iy+n)
   sbc a,n		;8 bits
   
   sbc hl,bc
   sbc hl,de
   sbc hl,hl
   sbc hl,sp

Effects

N flag is set, P/V detects overflow, rest modified by definition.

In the case of 16-bit registers, h flag is undefined.

Uses

Multiple precision subtraction

T-States

r denotes 8-bit register. rr represents a two byte register pair: BC, DE, HL, SP

r 4
X 7
(hl) 7
(ix+X) 19
(iy+X) 19
hl, rr 15

See Also

ADC,ADD,DAA,DEC,INC,SUB