0% found this document useful (0 votes)
321 views0 pages

Microprocessors, Programming P, G G & Interfacing: DR Anita Agrawal Dr. Anita Agrawal

This document discusses different types of jump instructions in microprocessors, including unconditional jumps, relative jumps, direct jumps, indirect jumps, and intersegment jumps. It explains the different address ranges for short jumps versus near jumps and how indirect and double indirect jumps work. Intersegment jumps use a segment and offset to calculate the effective branch address. Relative jumps use a signed displacement relative to the instruction pointer.

Uploaded by

aggarwalmegha
Copyright
© Attribution Non-Commercial (BY-NC)
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)
321 views0 pages

Microprocessors, Programming P, G G & Interfacing: DR Anita Agrawal Dr. Anita Agrawal

This document discusses different types of jump instructions in microprocessors, including unconditional jumps, relative jumps, direct jumps, indirect jumps, and intersegment jumps. It explains the different address ranges for short jumps versus near jumps and how indirect and double indirect jumps work. Intersegment jumps use a segment and offset to calculate the effective branch address. Relative jumps use a signed displacement relative to the instruction pointer.

Uploaded by

aggarwalmegha
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 0

Microprocessors, Programming p , g g

& Interfacing
(ES C263)
BITS PILANI K.K. BIRLA GOA CAMPUS
L 13 Lecture 13
Dr Anita Agrawal Dr. Anita Agrawal
UnconditionalJumpgroupofinstructions
Unconditionaljump
Intrasegment Jump
Relativejump
Shortjump(128to+127)
Near jump (32768 to 32767) Nearjump(32768to32767)
Indirectjump
IntersegmentJump
Directjump
Indirectjump
Indirectindirect (double indirect) Indirectindirect(doubleindirect)
2
(Intersegment)DirectProgrammemory
I t ti
Offset
Instruction
(CS) Seg Offset (CS) Seg.
(IP)
P.S.R/Mcontentscanbeaccessedusingany
of the addressing modes except immediate
3
oftheaddressingmodesexceptimmediate
mode
Mic.Prog.& Interfacing
Intersegment(FAR)contd
J MP address
Segment
Address
+
Effective branch address
Offset
+
Address
O Off(L) Off(H) S (L) S (H)
EA 00 00 00 10
Op Off(L) Off(H) Seg(L) Seg(H)
4 Mic.Prog.& Interfacing Dr.Anita Agrawal
Intersegment(FAR)indirect
1 1 1 1 1 1 1 1
M OD
1 0 1 R/M
Example Example
J MP dword ptr 2000h[bx]
Dr.Anita Agrawal Mic.Prog.& Interfacing 5
Relative(intrasegment)
Relative to the instruction pointer Relativetotheinstructionpointer
Ex:JMP[2]
1-byte
8-bit/16 bit signed disp.(+/-)
y
8 bit/16 bit signed disp.( / )
1byte:short jumps
2byte:nearjumpsandcalls
It is anywhere within the current code segment
6
Itisanywherewithinthecurrentcodesegment
IftheDisp.(16bits)istoofar,thensome
assemblersusethedirect jump.
8 bit di h t b t 8bit disp: short range between
+127 to 128 bytes from the next y
instruction.
b d f kb 16bitdisp:near rangeof32kbytes
7 Mic.Prog.& Interfacing Dr.Anita Agrawal
Indirectmode(Intrasegment)
Usesany16bitregister:
AX,BX,CX,DX,SP,BP,DI,SI;(near)
Relativeregister :
[BP],[BX],[SI],[DI]
Indirectindirectordoubleindirect
Relativeregisterwithadisplacement
8 Mic.Prog.& Interfacing Dr.Anita Agrawal
IntrasegmentIndirectnearjump
1 1 1 1 1 1 1 1
M OD
1 0 0 R/M
Dr.Anita Agrawal Mic.Prog.& Interfacing 9
Ex:1. JMP BX; BX contains offset address
(near current code segment) (near, current code segment)
it is near jump it is near jump
Ex:2. JMP [BX]; contents of BX point to the
M L h h dd i il bl M.L. where the address is available
(intrasegment)
it is near jump
10
Ex:3.JMP[BX+2];
Dr.Anita Agrawal Mic.Prog.& Interfacing 11

You might also like