编译后的代码如下所示。
ConditionStr2:
00008188E1A01000MOVr1,r0
>>>SWITCH\#26if((unsigned)condition>=15)return0;
0000818CE351000FCMPr1,#0xf
000081903A000001BCC0x819c<SWITCH\#27>
>>>SWITCH\#26if((unsigned)condition>=15)return0;
00008194E3A00000MOVr0,#0
>>>SWITCH\#30}
00008198E12FFF1EBXr14
>>>SWITCH\#26if((unsigned)condition>=15)return0;
>>>SWITCH\#27return
0000819CE28F005CADRr0,{pc}+0x64;#0x8200
000081A0E3A02003MOVr2,#3
000081A4E0200291MLAr0,r1,r2,r0
000081A8EAFFFFFAB0x8198<SWITCH\#30>
>>>SWITCH\#33{
从两段汇编代码的分析可以看出,使用跳转表需要240bytes,而第二种做法只用了72bytes。