Wednesday, March 23, 2016

8051 Long Jump

Long Jump - LJMP addr16

LJMP causes an unconditional branch to the indicated address, by loading the high-order and low-order bytes of the PC (respectively) with the second and third instruction bytes. The destination may therefore be anywhere in the full 64K program memory address space. No flags are affected.

Encoding: 0 0 0 0 0 0 1 0 addr15-addr8 addr7-addr0

The label JMPADR is assigned to the instruction at program memory location 1234H. The instruction,

LJMP JMPADR

at location 0123H will load the program counter with 1234H.

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



Related topics:
8051 Unconditional and Conditional Jump   |   8051 Absolute 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