9 - Chapter 9 Program Control Instructions 1 Learning...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Chapter 9 Program Control Instructions
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Learning Outcomes Be able to use both conditional and unconditional jump instructions to control the flow of the programme. Be able to use the relational assembly language statements .IF, .REPEAT, .WHILE in the programme. Be able to use the call and return instructions to include the procedures in the programme structure. Be able to explain the operation of the interrupts and interrupt control instructions.
Background image of page 2
3 JMP The JMP instruction is a GOTO that is found in all computer languages. JMP passes program flow to another part of the program. The JMP instruction comes in 3 forms, short , near , and far . Short jumps are within +127 and -128 bytes from the JMP instruction. Near jumps are within ±32KB (protected mode near jumps are ±2GB. Far jumps are anywhere within the memory system.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Figure 6 1 The three main forms of the JMP instruction. Note that Disp is either an 8- or 16- bit signed displacement or distance.
Background image of page 4
5 Short Jump Called relative jumps because they can be moved, with related software, to any location in the current code segment without a change. jump address is not stored with the opcode a distance , or displacement, follows the opcode The short jump displacement is a distance represented by a 1-byte signed number whose value ranges between +127 and –128. Short jump instruction appears in Figure 6–2.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Figure 6 2 A short jump to four memory locations beyond the address of the next instruction. when the microprocessor executes a short jump, the displacement is sign-extended and added to the instruction pointer (IP/EIP) to generate the jump address within the current code segment The instruction branches to this new address for the next instruction in the program
Background image of page 6
7 When a jump references an address, a label normally identifies the address. The JMP NEXT instruction is an example.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 36

9 - Chapter 9 Program Control Instructions 1 Learning...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online