Wednesday, March 23, 2016

8051 Absolute Jump

Absolute Jump - AJMP addr11

AJMP transfers program execution to the indicated address, which is formed at run-time by concatenating the high-order five bits of the PC (after incrementing the PC twice), opcode bits 7 through 5, and the second byte of the instruction. The destination must therefore be within the same 2 K block of program memory as the first byte of the instruction following AJMP.

Encoding: a10 a9 a8 0 0 0 0 1 a7 a6 a5 a4 a3 a2 a1 a0

The label JMPADR is at program memory location 0123H. The following instruction,

AJMP JMPADR

is at location 0345H and loads the PC with 0123H.
Following example is to demonstrate instruction and not application oriented.

Example:
ORG 0H
MAIN :
MOV A, #00H
ADD A, #12H
...; Assume thousand bytes of code here
AJMP MAIN
END; end of asm source file



Related topics:
8051 Unconditional and Conditional Jump   |   8051 Long Jump   |   8051 Short Jump   |   8051 Indirect Jump   |   8051 Jump if Accumulator Zero   |   8051 Jump if Accumulator Not Zero   |   8051 Compare and Jump if Not Equal   |   8051 Decrement and Jump if Not Zero   |   8051 Jump if Carry is Set   |   8051 Jump if Carry is Not Set   |   8051 Jump if Bit Set   |   8051 Jump if Bit Not Set   |   8051 Jump if Bit is Set and Clear Bit

List of topics: 8051

No comments:

Post a Comment