Make your own free website on Tripod.com

SBC A,s

Subtract with borrow accumulator and specified operand.
Function: A <- A - s - C
 
Format: s: may be r, n, (HL), (IX + d), or (IY + d)
 
r  
 
10011rrr
 
n  
 
1101 1110
 
byte 1: DE
 
nnnn nnnn
 
byte 2: immediate data
 
(HL)  
 
1001 1110
 
9E
 
(IX + d)  
 
1101 1101
 
byte 1: DD
 
1001 1110
 
byte 2: 9E
 
dddd dddd
 
byte 3: offset data
 
(IY + d)  
 
1111 1101
 
byte 1: FD
 
1001 1110
 
byte 2: 9E
 
dddd dddd
 
byte 3: offset data
 
r may be any one of:
A
111
B
000
C
001
D
010
E
011
H
100
L
101
Description: The specified operand s, summed with the contents of the carry flag, is subtracted from the contents of the accumulator, and the result is placed in the accumulator. s is defined in the descriptions of the similar ADD instructions.
 
Data Flow:
 
Timing:
s: M cycles: T states: usec
@ 2 MHz:
r
n
(HL)
(IX + d)
(IY + d)
1
2
2
5
5
4
7
7
19
19
2
3.5
3.5
9.5
9.5
 
Addressing Mode: r: implicit; n: immediate; (HL): indirect; (IX + d), (IY+d): indexed.
 
Byte Codes:
SBC  A,r
r:ABCDEHL
9F98999A9B9C9D
 
Flags:
 
Example:
SBC  A,(HL)

OBJECT CODE
Before:
 
After: