Electronic Circuits - Electronic Tutorials - Electronic Hobby Projects - A Complete Electronic Resource Centre

MICROCONTROLLER TUTORIALS - 8052

Videos

Products

Sitemap

Circuits

Tutorials

8051

Introduction

Chapter 1
Types of Memory

Chapter 2
Special Function Registers

Chapter 3
Basic Registers

Chapter 4
Addressing Modes

Chapter 5
Program Flow

Chapter 6
Low Level Information

Chapter 7
Timers

Chapter 8
Serial Port Operations

Chapter 9
Interrupts

Additional Features in 8052

8052 Instruction Set

8051 / 8052 Microcontroller
Instruction Set 
SUBB - Subtract from Accumulator with Borrow

Operation: SUBB
Function: Subtract from Accumulator With Borrow
Syntax: SUBB A,operand

 

Instructions OpCode Bytes Cycles Flags
SUBB A,#data 0x94 2 1 C, AC, OV
SUBB A,iram addr 0x95 2 1 C, AC, OV
SUBB A,@R0 0x96 1 1 C, AC, OV
SUBB A,@R1 0x97 1 1 C, AC, OV
SUBB A,R0 0x98 1 1 C, AC, OV
SUBB A,R1 0x99 1 1 C, AC, OV
SUBB A,R2 0x9A 1 1 C, AC, OV
SUBB A,R3 0x9B 1 1 C, AC, OV
SUBB A,R4 0x9C 1 1 C, AC, OV
SUBB A,R5 0x9D 1 1 C, AC, OV
SUBB A,R6 0x9E 1 1 C, AC, OV
SUBB A,R7 0x9F 1 1 C, AC, OV

 

Description: SUBB subtract the value of operand from the value of the Accumulator, leaving the resulting value in the Accumulator. The value operand is not affected.

The Carry Bit (C) is set if a borrow was required for bit 7, otherwise it is cleared. In other words, if the unsigned value being subtracted is greater than the Accumulator the Carry Flag is set.

The Auxillary Carry (AC) bit is set if a borrow was required for bit 3, otherwise it is cleared. In other words, the bit is set if the low nibble of the value being subtracted was greater than the low nibble of the Accumulator.

The Overflow (OV) bit is set if a borrow was required for bit 6 or for bit 7, but not both. In other words, the subtraction of two signed bytes resulted in a value outside the range of a signed byte (-128 to 127). Otherwise it is cleared.

See Also: ADD, ADDC, DEC, Instruction Set

 
  <<< Click here to come back on (8051 / 8052 - Instruction Set)
 

<<<<  Back to 8051 / 52  Microcontroller Tutorial