SlideShare a Scribd company logo
Selection and Iteration Chapter 8 S. Dandamudi
Outline Unconditional jump Compare instruction Conditional jumps Single flags Unsigned comparisons Signed comparisons Loop instructions Implementing high-level language decision structures Selection structures Iteration structures  Illustrative examples Indirect jumps Multiway conditional statements
Unconditional Jump Unconditional jump transfers control to the instruction at the target address Format jmp  target Specification of target Direct Target address is specified as a part of the instruction Indirect Target address is specified indirectly either through  memory  or a general-purpose  register
Unconditional Jump (cont’d) Example Two jump instructions Forward jump   jmp  ECX_init_done Backward jump   jmp  repeat1 Programmer specifies target by a label Assembler computes the offset using the symbol table . . . mov  ECX,10 jmp  ECX_init_done init_CX_20: mov  ECX,20 CX_init_done: mov  EAX,ECX repeat1: dec  ECX . . . jmp  repeat1 . . .
Unconditional Jump (cont’d) Address specified in the jump instruction is not the absolute address Uses relative address  Specifies relative byte displacement between the target instruction and the instruction following the jump instruction Displacement is w.r.t the instruction following  jmp Reason:  EIP is already pointing to this instruction Execution of  jmp  involves adding the displacement value to current EIP Displacement is a signed number Negative value for backward jumps Positive value for forward jumps
Target Location Inter-segment jump Target is in another segment CS = target-segment  (2 bytes) EIP = target-offset  (4 bytes) Called  far jumps  (needs five bytes to encode  jmp ) Intra-segment jumps Target is in the same segment EIP = EIP + relative-displacement Uses 1-byte displacement if target is within   128  to +127 Called  short jumps  (needs two bytes to encode  jmp ) If target is outside this range, uses 2/4-byte displacement Called  near jumps  (needs 3 or 5 bytes to encode  jmp )
Target Location (cont’d) In most cases, the assembler can figure out the type of jump  For backward jumps, assembler can decide whether to use the short jump form or not For forward jumps, it needs a hint from the programmer Use SHORT prefix to the target label If such a hint is not given  Assembler reserves three bytes for  jmp  instruction If short jump can be used, leaves one byte of rogue data See the next example for details
Example .  .  .  167  0…09  EB  14   jmp  SHORT ECX_init_done  0…1F – 0…0B = 0…014   168  0…0B  B9 78563412  mov  ECX,12345678H  169  0…10  E9  0A000000   jmp  ECX_init_done  0…1F – 0…15 = 0…00A   170   init_ECX: 171  0…15  B9 12EFCDAB  mov  ECX,0ABCDEF12H 172  0…1A  E9  52060000   jmp  near_jump 0…671 – 0…01F = 0…652   173   ECX_init_done:   174  0…1F  89 C8  mov  EAX,ECX
Example (cont’d) 175  repeat1:   176 0…21  49  dec  ECX  177 0…22  EB  FD   jmp  repeat1 0…21 – 0…24 = -3 = FD   .  .  .  557 0…662  EB  05000000   jmp  short_jump 0…66C – 0…667 = 5   558 0…667  B9 FFFF00FF  mov  ECX, 0FF00FFFFH  559  short_jump:   560 0…66C  BA 32547698  mov  EDX, 98765432H  561  near_jump:   562 0…671  E9  9FF9FFFF   jmp  init_ECX 0…015 – 0…676 = FFFFF99F
Compare Instruction Compare instruction can be used to test the conditions Format cmp  destination, source Updates the arithmetic flags by performing destination - source The flags can be tested by a subsequent conditional jump instruction
Conditional Jumps Three types of conditional jumps Jumps based on the value of a single flag Arithmetic flags such as zero, carry can be tested using these instructions Jumps based on unsigned comparisons The operands of  cmp  instruction are treated as unsigned numbers Jumps based on signed comparisons The operands of  cmp  instruction are treated as signed numbers
Jumps Based on Single Flags Testing for zero jz jump if zero    jumps if ZF = 1 je jump if equal    jumps if ZF = 1 jnz jump if not zero   jumps if ZF = 0 jne jump if not equal   jumps if ZF = 0 jcxz jump if CX = 0  jumps if CX = 0     (Flags are not tested)
Jumps Based on Single Flags (cont’d) Testing for carry jc jump if carry    jumps if CF = 1 jnc jump if no carry  jumps if CF = 0 Testing for overflow jo jump if overflow   jumps if OF = 1 jno jump if no overflow    jumps if OF = 0 Testing for sign js jump if negative   jumps if SF = 1 jns jump if not negative    jumps if SF = 0
Jumps Based on Single Flags (cont’d) Testing for parity jp jump if parity    jumps if PF = 1 jpe jump if parity   jumps if PF = 1 is even jnp jump if not parity   jumps if PF = 0 jpo jump if parity   jumps if PF = 0 is odd
Jumps Based on Unsigned Comparisons Mnemonic Meaning Condition je jump if equal ZF = 1 jz jump if zero ZF = 1 jne jump if not equal ZF = 0 jnz jump if not zero ZF = 0 ja jump if above CF = ZF = 0 jnbe jump if not below  CF = ZF = 0 or equal
Jumps Based on Unsigned Comparisons Mnemonic Meaning Condition jae jump if above CF = 0 or equal jnb jump if not below CF = 0 jb jump if below CF = 1 jnae jump if not above CF = 1 or equal jbe jump if below CF=1 or ZF=1 or equal jna  jump if not above  CF=1 or ZF=1
Jumps Based on Signed Comparisons Mnemonic Meaning Condition je jump if equal ZF = 1 jz jump if zero ZF = 1 jne jump if not equal ZF = 0 jnz jump if not zero ZF = 0 jg jump if greater ZF=0 & SF=OF jnle   jump if not less  ZF=0 & SF=OF or equal
Jumps Based on Signed Comparisons (cont’d) Mnemonic Meaning Condition jge jump if greater   SF = OF or equal jnl jump if not less   SF = OF jl jump if less   SF    OF jnge jump if not greater   SF    OF or equal jle jump if less ZF=1 or SF    OF or equal jng  jump if not greater ZF=1 or SF    OF
A Note on Conditional Jumps target: . . .  cmp  AX,BX je  target mov  CX,10 . . .  traget  is out of range for a short jump Use this code to get around target: . . .  cmp  AX,BX jne  skip1 jmp  target skip1: mov  CX,10 . . .  All conditional jumps are encoded using 2 bytes Treated as short jumps What if the target is outside this range?
Loop Instructions Loop instructions use CX/ECX to maintain the count value target  should be within the range of a short jump as in conditional jump instructions Three loop instructions loop  target Action: ECX = ECX  1   Jump to target if ECX    0
Loop Instructions (cont’d) The following two loop instructions also test the zero flag status loope/loopz  target Action: ECX = ECX    1   Jump to target if (ECX    0 and ZF = 1) loopne/loopnz  target Action: ECX = ECX    1   Jump to target if (ECX    0 and ZF = 0)
Instruction Execution Times Functionally,  loop  instruction can be replaced by dec  ECX jnz  target loop  instruction is slower than  dec/jnz  version loop  requires 5/6 clocks whereas  dec/jnz  takes only 2 clocks jcxz  also takes 5/6 clocks Equivalent code (shown below) takes only 2 clocks cmp  ECX,0 jz  target
Implementing HLL Decision Structures High-level language decision structures can be implemented in a straightforward way See Section 8.5 for examples that implement if-then-else if-then-else with a relational operator if-then-else with logical operators AND and OR while loop repeat-until loop for loop
Illustrative Examples Two example programs Linear search LIN_SRCH.ASM Searches an array of non-negative numbers for a given input number Selection sort SEL_SORT.ASM Uses selection sort algorithm to sort an integer array in ascending order
Indirect Jumps Jump target address is not specified directly as a part of the jump instruction With indirect jump, we can specify target via a general-purpose register or memory Example: Assuming ECX has the offset value jmp   [ECX] Note: The offset value in indirect jump is the absolute value (not relative value as in the direct jumps) Program example IJUMP.ASM Uses a jump table to direct the jump
Indirect Jumps (cont’d) Another example Implementing multiway jumps We use  switch  statement of C We can use a table with appropriate target pointers for the indirect jump Segment override is needed jump_table  is in the code segment (not in the data segment) switch (ch) { case '0': count[0]++;  break; case '1': count[1]++; break; case '2': count[2]++; break; case '3': count[3]++; break; default: count[4]++; }
Indirect Jumps (cont’d) _main  PROC  NEAR  .  .  .  mov  AL,ch  cbw  sub  AX,48 ; 48 =‘0’  mov  BX,AX  cmp  BX,3  ja  default  shl  BX,1  ; BX= BX*2  jmp  WORD PTR  CS:jump_table[BX]   case_0:  inc  WORD PTR [BP-10] jmp  SHORT end_switch case_1:  inc  WORD PTR [BP-8]  jmp  SHORT end_switch case_2:  inc  WORD PTR [BP-6]  jmp  SHORT end_switch case_3:  inc  WORD PTR [BP-4]  jmp  SHORT end_switch default:  inc  WORD PTR [BP-2]  end_switch:  .  .  .  _main  ENDP ;end of main jump_table  LABEL  WORD  dw  case_0  dw  case_1  dw  case_2  dw  case_3  .  .  . Last slide

More Related Content

PPTX
Flag control
PPTX
PPT
Jumps in Assembly Language.
PPTX
[ASM]Lab5
PPTX
[ASM]Lab7
PPTX
[ASM]Lab4
PPTX
[ASM]Lab6
PPTX
[ASM]Lab8
Flag control
Jumps in Assembly Language.
[ASM]Lab5
[ASM]Lab7
[ASM]Lab4
[ASM]Lab6
[ASM]Lab8

What's hot (14)

PPTX
Theory of computation:Finite Automata, Regualr Expression, Pumping Lemma
DOCX
PPT
Assignment on alp
PPT
PDF
Control statements anil
PDF
CFD for Rotating Machinery using OpenFOAM
PPT
Chapt 06
PDF
Spatial Interpolation Schemes in OpenFOAM
PPT
Flow of Control
PPTX
Program control statements in c#
PPT
Repetition Structure
PPT
L3 control
PPT
04 control structures 1
PPT
Iteration
Theory of computation:Finite Automata, Regualr Expression, Pumping Lemma
Assignment on alp
Control statements anil
CFD for Rotating Machinery using OpenFOAM
Chapt 06
Spatial Interpolation Schemes in OpenFOAM
Flow of Control
Program control statements in c#
Repetition Structure
L3 control
04 control structures 1
Iteration
Ad

Similar to Al2ed chapter8 (20)

PPT
Chapt 06
PPT
1344 Alp Of 8086
PPTX
Program control instructions
PPTX
Chapter3 program flow control instructions
PPTX
Chap3 program flow control instructions
PPTX
Microprocessor Week 7: Branch Instruction
PPTX
Jump&Loop instruction
PPTX
Branch instructions in 8051 micrcocontroller
PPT
chapt5 and 06assemblylanguagecodesandmachinelanguage.ppt
PPT
microcontroller.ppt
PPT
3_JumpAndCall_v21_presenatationb also.ppt
PPTX
Assembly jmp presentation
PPT
Assembly Language Lecture 5
PDF
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
PPT
Chapter6-mikroprocessor
PDF
program-control-instruction.pdf
PDF
Assembly language 8086 intermediate
PPTX
LECTURE_5 Program Control Instructions.pptx
PDF
Assembly language 8086
Chapt 06
1344 Alp Of 8086
Program control instructions
Chapter3 program flow control instructions
Chap3 program flow control instructions
Microprocessor Week 7: Branch Instruction
Jump&Loop instruction
Branch instructions in 8051 micrcocontroller
chapt5 and 06assemblylanguagecodesandmachinelanguage.ppt
microcontroller.ppt
3_JumpAndCall_v21_presenatationb also.ppt
Assembly jmp presentation
Assembly Language Lecture 5
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Chapter6-mikroprocessor
program-control-instruction.pdf
Assembly language 8086 intermediate
LECTURE_5 Program Control Instructions.pptx
Assembly language 8086
Ad

More from Abdullelah Al-Fahad (17)

PPT
Al2ed chapter17
PPT
Al2ed chapter16
PPT
Al2ed chapter15
PPT
Al2ed chapter14
PPT
Al2ed chapter13
PPT
Al2ed chapter12
PPT
Al2ed chapter11
PPT
Al2ed chapter10
PPT
Al2ed chapter9
PPT
Al2ed chapter7
PPT
Al2ed chapter6
PPT
Al2ed chapter5
PPT
Al2ed chapter4
PPT
Al2ed chapter3
PPT
Al2ed chapter2
PPT
Al2ed chapter1
PPT
Al2ed chapter18
Al2ed chapter17
Al2ed chapter16
Al2ed chapter15
Al2ed chapter14
Al2ed chapter13
Al2ed chapter12
Al2ed chapter11
Al2ed chapter10
Al2ed chapter9
Al2ed chapter7
Al2ed chapter6
Al2ed chapter5
Al2ed chapter4
Al2ed chapter3
Al2ed chapter2
Al2ed chapter1
Al2ed chapter18

Recently uploaded (20)

PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
01-Introduction-to-Information-Management.pdf
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Pharma ospi slides which help in ospi learning
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Cell Structure & Organelles in detailed.
PDF
Basic Mud Logging Guide for educational purpose
PPTX
master seminar digital applications in india
O5-L3 Freight Transport Ops (International) V1.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPH.pptx obstetrics and gynecology in nursing
Microbial diseases, their pathogenesis and prophylaxis
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Abdominal Access Techniques with Prof. Dr. R K Mishra
01-Introduction-to-Information-Management.pdf
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Supply Chain Operations Speaking Notes -ICLT Program
Pharma ospi slides which help in ospi learning
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Cell Structure & Organelles in detailed.
Basic Mud Logging Guide for educational purpose
master seminar digital applications in india

Al2ed chapter8

  • 1. Selection and Iteration Chapter 8 S. Dandamudi
  • 2. Outline Unconditional jump Compare instruction Conditional jumps Single flags Unsigned comparisons Signed comparisons Loop instructions Implementing high-level language decision structures Selection structures Iteration structures Illustrative examples Indirect jumps Multiway conditional statements
  • 3. Unconditional Jump Unconditional jump transfers control to the instruction at the target address Format jmp target Specification of target Direct Target address is specified as a part of the instruction Indirect Target address is specified indirectly either through memory or a general-purpose register
  • 4. Unconditional Jump (cont’d) Example Two jump instructions Forward jump jmp ECX_init_done Backward jump jmp repeat1 Programmer specifies target by a label Assembler computes the offset using the symbol table . . . mov ECX,10 jmp ECX_init_done init_CX_20: mov ECX,20 CX_init_done: mov EAX,ECX repeat1: dec ECX . . . jmp repeat1 . . .
  • 5. Unconditional Jump (cont’d) Address specified in the jump instruction is not the absolute address Uses relative address Specifies relative byte displacement between the target instruction and the instruction following the jump instruction Displacement is w.r.t the instruction following jmp Reason: EIP is already pointing to this instruction Execution of jmp involves adding the displacement value to current EIP Displacement is a signed number Negative value for backward jumps Positive value for forward jumps
  • 6. Target Location Inter-segment jump Target is in another segment CS = target-segment (2 bytes) EIP = target-offset (4 bytes) Called far jumps (needs five bytes to encode jmp ) Intra-segment jumps Target is in the same segment EIP = EIP + relative-displacement Uses 1-byte displacement if target is within  128 to +127 Called short jumps (needs two bytes to encode jmp ) If target is outside this range, uses 2/4-byte displacement Called near jumps (needs 3 or 5 bytes to encode jmp )
  • 7. Target Location (cont’d) In most cases, the assembler can figure out the type of jump For backward jumps, assembler can decide whether to use the short jump form or not For forward jumps, it needs a hint from the programmer Use SHORT prefix to the target label If such a hint is not given Assembler reserves three bytes for jmp instruction If short jump can be used, leaves one byte of rogue data See the next example for details
  • 8. Example . . . 167 0…09 EB 14 jmp SHORT ECX_init_done 0…1F – 0…0B = 0…014 168 0…0B B9 78563412 mov ECX,12345678H 169 0…10 E9 0A000000 jmp ECX_init_done 0…1F – 0…15 = 0…00A 170 init_ECX: 171 0…15 B9 12EFCDAB mov ECX,0ABCDEF12H 172 0…1A E9 52060000 jmp near_jump 0…671 – 0…01F = 0…652 173 ECX_init_done: 174 0…1F 89 C8 mov EAX,ECX
  • 9. Example (cont’d) 175 repeat1: 176 0…21 49 dec ECX 177 0…22 EB FD jmp repeat1 0…21 – 0…24 = -3 = FD . . . 557 0…662 EB 05000000 jmp short_jump 0…66C – 0…667 = 5 558 0…667 B9 FFFF00FF mov ECX, 0FF00FFFFH 559 short_jump: 560 0…66C BA 32547698 mov EDX, 98765432H 561 near_jump: 562 0…671 E9 9FF9FFFF jmp init_ECX 0…015 – 0…676 = FFFFF99F
  • 10. Compare Instruction Compare instruction can be used to test the conditions Format cmp destination, source Updates the arithmetic flags by performing destination - source The flags can be tested by a subsequent conditional jump instruction
  • 11. Conditional Jumps Three types of conditional jumps Jumps based on the value of a single flag Arithmetic flags such as zero, carry can be tested using these instructions Jumps based on unsigned comparisons The operands of cmp instruction are treated as unsigned numbers Jumps based on signed comparisons The operands of cmp instruction are treated as signed numbers
  • 12. Jumps Based on Single Flags Testing for zero jz jump if zero jumps if ZF = 1 je jump if equal jumps if ZF = 1 jnz jump if not zero jumps if ZF = 0 jne jump if not equal jumps if ZF = 0 jcxz jump if CX = 0 jumps if CX = 0 (Flags are not tested)
  • 13. Jumps Based on Single Flags (cont’d) Testing for carry jc jump if carry jumps if CF = 1 jnc jump if no carry jumps if CF = 0 Testing for overflow jo jump if overflow jumps if OF = 1 jno jump if no overflow jumps if OF = 0 Testing for sign js jump if negative jumps if SF = 1 jns jump if not negative jumps if SF = 0
  • 14. Jumps Based on Single Flags (cont’d) Testing for parity jp jump if parity jumps if PF = 1 jpe jump if parity jumps if PF = 1 is even jnp jump if not parity jumps if PF = 0 jpo jump if parity jumps if PF = 0 is odd
  • 15. Jumps Based on Unsigned Comparisons Mnemonic Meaning Condition je jump if equal ZF = 1 jz jump if zero ZF = 1 jne jump if not equal ZF = 0 jnz jump if not zero ZF = 0 ja jump if above CF = ZF = 0 jnbe jump if not below CF = ZF = 0 or equal
  • 16. Jumps Based on Unsigned Comparisons Mnemonic Meaning Condition jae jump if above CF = 0 or equal jnb jump if not below CF = 0 jb jump if below CF = 1 jnae jump if not above CF = 1 or equal jbe jump if below CF=1 or ZF=1 or equal jna jump if not above CF=1 or ZF=1
  • 17. Jumps Based on Signed Comparisons Mnemonic Meaning Condition je jump if equal ZF = 1 jz jump if zero ZF = 1 jne jump if not equal ZF = 0 jnz jump if not zero ZF = 0 jg jump if greater ZF=0 & SF=OF jnle jump if not less ZF=0 & SF=OF or equal
  • 18. Jumps Based on Signed Comparisons (cont’d) Mnemonic Meaning Condition jge jump if greater SF = OF or equal jnl jump if not less SF = OF jl jump if less SF  OF jnge jump if not greater SF  OF or equal jle jump if less ZF=1 or SF  OF or equal jng jump if not greater ZF=1 or SF  OF
  • 19. A Note on Conditional Jumps target: . . . cmp AX,BX je target mov CX,10 . . . traget is out of range for a short jump Use this code to get around target: . . . cmp AX,BX jne skip1 jmp target skip1: mov CX,10 . . . All conditional jumps are encoded using 2 bytes Treated as short jumps What if the target is outside this range?
  • 20. Loop Instructions Loop instructions use CX/ECX to maintain the count value target should be within the range of a short jump as in conditional jump instructions Three loop instructions loop target Action: ECX = ECX  1 Jump to target if ECX  0
  • 21. Loop Instructions (cont’d) The following two loop instructions also test the zero flag status loope/loopz target Action: ECX = ECX  1 Jump to target if (ECX  0 and ZF = 1) loopne/loopnz target Action: ECX = ECX  1 Jump to target if (ECX  0 and ZF = 0)
  • 22. Instruction Execution Times Functionally, loop instruction can be replaced by dec ECX jnz target loop instruction is slower than dec/jnz version loop requires 5/6 clocks whereas dec/jnz takes only 2 clocks jcxz also takes 5/6 clocks Equivalent code (shown below) takes only 2 clocks cmp ECX,0 jz target
  • 23. Implementing HLL Decision Structures High-level language decision structures can be implemented in a straightforward way See Section 8.5 for examples that implement if-then-else if-then-else with a relational operator if-then-else with logical operators AND and OR while loop repeat-until loop for loop
  • 24. Illustrative Examples Two example programs Linear search LIN_SRCH.ASM Searches an array of non-negative numbers for a given input number Selection sort SEL_SORT.ASM Uses selection sort algorithm to sort an integer array in ascending order
  • 25. Indirect Jumps Jump target address is not specified directly as a part of the jump instruction With indirect jump, we can specify target via a general-purpose register or memory Example: Assuming ECX has the offset value jmp [ECX] Note: The offset value in indirect jump is the absolute value (not relative value as in the direct jumps) Program example IJUMP.ASM Uses a jump table to direct the jump
  • 26. Indirect Jumps (cont’d) Another example Implementing multiway jumps We use switch statement of C We can use a table with appropriate target pointers for the indirect jump Segment override is needed jump_table is in the code segment (not in the data segment) switch (ch) { case '0': count[0]++; break; case '1': count[1]++; break; case '2': count[2]++; break; case '3': count[3]++; break; default: count[4]++; }
  • 27. Indirect Jumps (cont’d) _main PROC NEAR . . . mov AL,ch cbw sub AX,48 ; 48 =‘0’ mov BX,AX cmp BX,3 ja default shl BX,1 ; BX= BX*2 jmp WORD PTR CS:jump_table[BX] case_0: inc WORD PTR [BP-10] jmp SHORT end_switch case_1: inc WORD PTR [BP-8] jmp SHORT end_switch case_2: inc WORD PTR [BP-6] jmp SHORT end_switch case_3: inc WORD PTR [BP-4] jmp SHORT end_switch default: inc WORD PTR [BP-2] end_switch: . . . _main ENDP ;end of main jump_table LABEL WORD dw case_0 dw case_1 dw case_2 dw case_3 . . . Last slide