Ramo - Lab 5
Ramo - Lab 5
5
8051 JUMP INSTRUCTION
I. Introduction
The program execution directly jumps to the specified address. This instruction can be used for
64Kb of memory. It has a range of 65,536 addresses, and can jump over these many addresses. So
named Long jump.
Here Raddress stands for relative address. Instead of giving address locations to the instruction ,
we give difference between the addresses ( not actually the difference ). Here the address consumes 1
byte which means only 256 address jumps can be fetched.
c. AJMP (Absolute Jump)
syntax: AJMP address
In this type of jump instruction , the whole 64Kb memory is divided into 32 parts ( each part is
known as page ) each consisting of 2KB of memory. Each page consists of 2048 locations. Absolute
jump is performed inside a page only. This instruction is of 2 bytes.
2. Conditional Jump
INSTRUCTION ACTION
JZ Jump if A = 0
JNZ Jump if A is not equal to 0
DJNZ Decrement and jump if register is not equal to 0
CJNE A, data Jump if A is not equal to data
CJNE reg, #data Jump if byte is not e0ual to #data
JC Jump if CY = 1
JNC Jump if CY = 0
JB Jump if bit = 1
JNB Jump if bit = 0
JBC Jump if bit = 1 and clear bit
II. Activity
1. Perform the JZ, JNZ, JC and JNC using the 8051 simulator.
2. Perform a program that determines whether the value at the data memory address #10H is an even or
an odd number. Register R7 is equal to #0FH when the value is an odd number; otherwise it is equal to
#0F0H.
3. The program will sum all the values from #10H to #20H data memory addresses using the
conditional jump instructions to perform the looping mechanism.
1. Perform the JZ, JNZ, JC and JNC using the 8051 simulator.
3. The program will sum all the values from #10H to #20H data memory addresses using the
conditional jump instructions to perform the looping mechanism.