0% found this document useful (0 votes)
9 views

Ramo - Lab 5

The document describes three types of jump instructions for the 8051 microcontroller: LJMP, SJMP, and AJMP. It also lists several conditional jump instructions and their actions. The activity section has the student simulate examples using different jump instructions in an 8051 simulator, including determining if a value is even or odd and using conditional jumps to sum values between two addresses.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Ramo - Lab 5

The document describes three types of jump instructions for the 8051 microcontroller: LJMP, SJMP, and AJMP. It also lists several conditional jump instructions and their actions. The activity section has the student simulate examples using different jump instructions in an 8051 simulator, including determining if a value is even or odd and using conditional jumps to sum values between two addresses.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

LABORATORY ACTIVITY NO.

5
8051 JUMP INSTRUCTION

Name: Christian Ray B. Ramo Course: BSEE-3 Section: SA23

I. Introduction

1. Three types of jump instruction:

a. LJMP (Long Jump)


Syntax:
LJMP address

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.

This instruction consumes 3 bytes of instruction( size of instruction ).

b. SJMP (Small Jump)

syntax: SJMP Raddress

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.

1 byte for AJMP data type


1 byte for address ( 8 bit address is given )

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.

Simulation Data Results


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.

Simulation Data Results

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.

Simulation Data Results

You might also like