Generics.lpr:33 if a = 3 then writeln('3');
; the following two (2) statements are the "formula" for 1- condition if statement
00401422 83fb03 cmp $0x3,%ebx
00401425 7526 jne 0x40144d <CODE+45>
; a is 3
00401427 e8b4540000 call 0x4068e0 <fpc_get_output>
0040142C 89c6 mov %eax,%esi
0040142E 89f2 mov %esi,%edx
00401430 b133 mov $0x33,%cl
00401432 b800000000 mov $0x0,%eax
00401437 e884570000 call 0x406bc0 <fpc_write_text_char>
0040143C e84f290000 call 0x403d90 <fpc_iocheck>
00401441 89f0 mov %esi,%eax
00401443 e8c8550000 call 0x406a10 <fpc_writeln_end>
00401448 e843290000 call 0x403d90 <fpc_iocheck>
Generics.lpr:35 case a of
; the following five (5) statements are the "formula" for a general multi branch statement which
; does not use a jump table
0040144D 89d8 mov %ebx,%eax
0040144F 83f803 cmp $0x3,%eax
00401452 7c2b jl 0x40147f <CODE+95>
00401454 83e803 sub $0x3,%eax
00401457 7526 jne 0x40147f <CODE+95>
; a is 3
Generics.lpr:36 3 : writeln('3');
00401459 e882540000 call 0x4068e0 <fpc_get_output>
0040145E 89c6 mov %eax,%esi
00401460 89f2 mov %esi,%edx
00401462 b133 mov $0x33,%cl
00401464 b800000000 mov $0x0,%eax
00401469 e852570000 call 0x406bc0 <fpc_write_text_char>
0040146E e81d290000 call 0x403d90 <fpc_iocheck>
00401473 89f0 mov %esi,%eax
00401475 e896550000 call 0x406a10 <fpc_writeln_end>
0040147A e811290000 call 0x403d90 <fpc_iocheck>
; ------------------------- binary choice using "if" and using "case"
Generics.lpr:39 if a = 3 then writeln('3') else writeln('not 3');
; the following two (2) statements are the "formula" for the if/else statement
0040147F 83fb03 cmp $0x3,%ebx
00401482 7528 jne 0x4014ac <CODE+140>
; a is 3
00401484 e857540000 call 0x4068e0 <fpc_get_output>
00401489 89c6 mov %eax,%esi
0040148B 89f2 mov %esi,%edx
0040148D b133 mov $0x33,%cl
0040148F b800000000 mov $0x0,%eax
00401494 e827570000 call 0x406bc0 <fpc_write_text_char>
00401499 e8f2280000 call 0x403d90 <fpc_iocheck>
0040149E 89f0 mov %esi,%eax
004014A0 e86b550000 call 0x406a10 <fpc_writeln_end>
004014A5 e8e6280000 call 0x403d90 <fpc_iocheck>
004014AA eb29 jmp 0x4014d5 <CODE+181>
; a is _not_ 3
004014AC e82f540000 call 0x4068e0 <fpc_get_output>
004014B1 89c6 mov %eax,%esi
004014B3 b900b04000 mov $0x40b000,%ecx
004014B8 89f2 mov %esi,%edx
004014BA b800000000 mov $0x0,%eax
004014BF e8ec550000 call 0x406ab0 <fpc_write_text_shortstr>
004014C4 e8c7280000 call 0x403d90 <fpc_iocheck>
004014C9 89f0 mov %esi,%eax
004014CB e840550000 call 0x406a10 <fpc_writeln_end>
004014D0 e8bb280000 call 0x403d90 <fpc_iocheck>
; binary choice using "case" statement
Generics.lpr:41 case a of
; the following five (5) statements are the "formula" for a general multi branch statement which
; does not use a jump table
; note the similarity (basically identical) with the single condition case
004014D5 89d8 mov %ebx,%eax
004014D7 83f803 cmp $0x3,%eax
004014DA 7c2d jl 0x401509 <CODE+233>
004014DC 83e803 sub $0x3,%eax
004014DF 7528 jne 0x401509 <CODE+233>
; a is 3
Generics.lpr:42 3 : writeln('3');
004014E1 e8fa530000 call 0x4068e0 <fpc_get_output>
004014E6 89c3 mov %eax,%ebx
004014E8 89da mov %ebx,%edx
004014EA b133 mov $0x33,%cl
004014EC b800000000 mov $0x0,%eax
004014F1 e8ca560000 call 0x406bc0 <fpc_write_text_char>
004014F6 e895280000 call 0x403d90 <fpc_iocheck>
004014FB 89d8 mov %ebx,%eax
004014FD e80e550000 call 0x406a10 <fpc_writeln_end>
00401502 e889280000 call 0x403d90 <fpc_iocheck>
00401507 eb29 jmp 0x401532 <CODE+274>
; a is not 3
Generics.lpr:44 writeln('not 3');
00401509 e8d2530000 call 0x4068e0 <fpc_get_output>
0040150E 89c3 mov %eax,%ebx
00401510 b900b04000 mov $0x40b000,%ecx
00401515 89da mov %ebx,%edx
00401517 b800000000 mov $0x0,%eax
0040151C e88f550000 call 0x406ab0 <fpc_write_text_shortstr>
00401521 e86a280000 call 0x403d90 <fpc_iocheck>
00401526 89d8 mov %ebx,%eax
00401528 e8e3540000 call 0x406a10 <fpc_writeln_end>
0040152D e85e280000 call 0x403d90 <fpc_iocheck>