8052 Instruction Set

The auxillary carry (AC) bit is set if there is a carry-out of bit 3. In other words, if the unsigned summed value of the low nibble of the accumulator, operand, and (in the case of ADDC) the carry flag exceeds 15, the auxillary carry flag is set. Otherwise, the auxillary carry flag is cleared.

The overflow (OV) bit is set if there is a carry-out of bit 6 or out of bit 7, but not both. In other words, if the addition of the accumulator, operand, and (in the case of ADDC) the carry flag treated as signed values results in a value that is out of the range of a signed byte (−128 through +127), the Overflow flag is set. Otherwise, the Overflow flag is cleared.

See also: SUBB, DA, INC, DEC

AJMP

Absolute Jump within 2k Block

 

 

 

Syntax

AJMP codeAddress

 

 

 

 

 

 

 

 

 

 

 

 

 

Instructions

OpCode

 

Bytes

Cycles

Flags

 

 

 

 

 

 

 

 

AJMP pg0Addr

0x01

 

2

2

None

 

 

 

 

 

 

 

 

AJMP pg1Addr

0x21

 

2

2

None

 

 

 

 

 

 

 

 

AJMP pg2Addr

0x41

 

2

2

None

 

 

 

 

 

 

 

 

AJMP pg3Addr

0x61

 

2

2

None

 

 

 

 

 

 

 

 

AJMP pg4Addr

0x81

 

2

2

None

 

 

 

 

 

 

 

 

AJMP pg5Addr

0xA1

 

2

2

None

 

 

 

 

 

 

 

 

AJMP pg6Addr

0xC1

 

2

2

None

 

 

 

 

 

 

 

 

AJMP pg7Addr

0xE1

 

2

2

None

 

 

 

 

 

 

 

AJMP unconditionally jumps to the indicated codeAddress. The new value for the program counter is calculated by replacing the least-significant-byte of the program counter with the second byte of the AJMP instruction, and replacing bits 0−2 of the most-significant-byte of the program counter with bits 5−7 of the opcode value. Bits 3−7 of the most-significant-byte of the program counter re- main unchanged.

Jumps must only be made to code located within the same 2k block as the first byte that follows AJMP because only 11 bits of the program counter are af- fected by AJMP.

See also: LJMP, SJMP

8052 Instruction Set

E-5

 

Page 289
Image 289
Texas Instruments MSC1210 manual Absolute Jump within 2k Block, Ajmp codeAddress