はじめてのひき - FizzBuzzAsm_blackfin Diff
- Added parts are displayed like this.
- Deleted parts are displayed
like this.
! Version
% bfin-elf-gcc -v
Using built-in specs.
Target: bfin-elf
コンフィグオプション: /usr/src/packages/BUILD/blackfin-toolchain-08r1.5/../gcc-4.1/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=bfin-elf --prefix=/opt/uClinux/bfin-elf --with-newlib --disable-libstdcxx-pch --enable-languages=c,c++ --disable-symvers --disable-libssp --disable-libffi --enable-clocale=generic --enable-version-specific-runtime-libs --enable-__cxa_atexit
スレッドモデル: single
gcc バージョン 4.1.2 (ADI svn)
! Optimized
fizzbuzz.o: ファイル形式 elf32-bfin
セクション .text の逆アセンブル:
00000000 <_main>:
0: 68 05 [--SP] = (R7:5);
2: 00 e8 03 00 LINK 0xc; /* (12) */
6: 0f 60 R7 = 0x1 (X); /* R7=0x1( 1) */
8: 46 e1 66 66 R6.H = 0x6666; /* (26214) R6=0x66660000(1717960704) */
c: 06 e1 67 66 R6.L = 0x6667; /* (26215) R6=0x66666667(1717986919) */
10: 45 e1 55 55 R5.H = 0x5555; /* (21845) R5=0x55550000(1431633920) */
14: 05 e1 56 55 R5.L = 0x5556; /* (21846) R5=0x55555556(1431655766) */
18: 07 30 R0 = R7;
1a: 79 60 R1 = 0xf (X); /* R1=0xf( 15) */
1c: ff e3 f2 ff CALL 0x0 <_main>;
1e: R_pcrel24 ___modsi3
20: 00 0c CC = R0 == 0x0;
22: 08 14 IF !CC JUMP 0x32 <_main+0x32> (BP);
24: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x0 <_main>( 0) */
26: R_huimm16 .rodata.str1.4
28: 00 e1 00 00 R0.L = 0x0; /* ( 0) R0=0x0 <_main>( 0) */
2a: R_luimm16 .rodata.str1.4
2c: ff e3 ea ff CALL 0x0 <_main>;
2e: R_pcrel24 _puts
30: 3f 20 JUMP.S 0xae <_main+0xae>;
32: 80 c0 3e 18 A1 = R7.L * R6.L (FU);
36: 83 c6 80 51 A1 = A1 >> 0x10;
3a: 11 c1 3e 86 A1 += R7.H * R6.L (M), A0 = R7.H * R6.H (IS);
3e: 11 c1 37 98 A1 += R6.H * R7.L (M, IS);
42: 83 c6 80 11 A1 = A1 >>> 0x10;
46: 0b c4 00 00 R0 = (A0 += A1);
4a: 08 4d R0 >>>= 0x1;
4c: 82 c6 0f 03 R1 = R7 >>> 0x1f;
50: 08 52 R0 = R0 - R1;
52: 10 32 P2 = R0;
54: 92 5e P2 = P2 + (P2 << 0x2);
56: 42 30 R0 = P2;
58: 07 08 CC = R7 == R0;
5a: 08 14 IF !CC JUMP 0x6a <_main+0x6a> (BP);
5c: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x0 <_main>( 0) */
5e: R_huimm16 .rodata.str1.4+0xc
60: 00 e1 0c 00 R0.L = 0xc; /* ( 12) R0=0xc( 12) */
62: R_luimm16 .rodata.str1.4+0xc
64: ff e3 ce ff CALL 0x0 <_main>;
66: R_pcrel24 _puts
68: 23 20 JUMP.S 0xae <_main+0xae>;
6a: 80 c0 3d 18 A1 = R7.L * R5.L (FU);
6e: 83 c6 80 51 A1 = A1 >> 0x10;
72: 11 c1 3d 86 A1 += R7.H * R5.L (M), A0 = R7.H * R5.H (IS);
76: 11 c1 2f 98 A1 += R5.H * R7.L (M, IS);
7a: 83 c6 80 11 A1 = A1 >>> 0x10;
7e: 0b c4 00 02 R1 = (A0 += A1);
82: 82 c6 0f 01 R0 = R7 >>> 0x1f;
86: 41 52 R1 = R1 - R0;
88: 11 32 P2 = R1;
8a: 92 5c P2 = P2 + (P2 << 0x1);
8c: 42 30 R0 = P2;
8e: 07 08 CC = R7 == R0;
90: 08 14 IF !CC JUMP 0xa0 <_main+0xa0> (BP);
92: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0xc( 12) */
94: R_huimm16 .rodata.str1.4+0x14
96: 00 e1 14 00 R0.L = 0x14; /* ( 20) R0=0x14( 20) */
98: R_luimm16 .rodata.str1.4+0x14
9a: ff e3 b3 ff CALL 0x0 <_main>;
9c: R_pcrel24 _puts
9e: 08 20 JUMP.S 0xae <_main+0xae>;
a0: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x14( 20) */
a2: R_huimm16 .rodata.str1.4+0x1c
a4: 00 e1 1c 00 R0.L = 0x1c; /* ( 28) R0=0x1c( 28) */
a6: R_luimm16 .rodata.str1.4+0x1c
a8: 0f 30 R1 = R7;
aa: ff e3 ab ff CALL 0x0 <_main>;
ac: R_pcrel24 _printf
ae: 0f 64 R7 += 0x1; /* ( 1) */
b0: 20 e1 65 00 R0 = 0x65 (X); /* R0=0x65(101) */
b4: 07 08 CC = R7 == R0;
b6: b1 17 IF !CC JUMP 0x18 <_main+0x18> (BP);
b8: 01 e8 00 00 UNLINK;
bc: 28 05 (R7:5) = [SP++];
be: 10 00 RTS;
! Normal
fizzbuzz.o: ファイル形式 elf32-bfin
セクション .text の逆アセンブル:
00000000 <_main>:
0: 00 e8 06 00 LINK 0x18; /* (24) */
4: 08 60 R0 = 0x1 (X); /* R0=0x1( 1) */
6: f0 bb [FP -0x4] = R0;
8: 64 20 JUMP.S 0xd0 <_main+0xd0>;
a: f0 b9 R0 = [FP -0x4];
c: 79 60 R1 = 0xf (X); /* R1=0xf( 15) */
e: ff e3 f9 ff CALL 0x0 <_main>;
10: R_pcrel24 ___modsi3
12: 00 0c CC = R0 == 0x0;
14: 08 10 IF !CC JUMP 0x24 <_main+0x24>;
16: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x1( 1) */
18: R_huimm16 .rodata
1a: 00 e1 00 00 R0.L = 0x0; /* ( 0) R0=0x0 <_main>( 0) */
1c: R_luimm16 .rodata
1e: ff e3 f1 ff CALL 0x0 <_main>;
20: R_pcrel24 _puts
22: 54 20 JUMP.S 0xca <_main+0xca>;
24: f1 b9 R1 = [FP -0x4];
26: 40 e1 66 66 R0.H = 0x6666; /* (26214) R0=0x66660000(1717960704) */
2a: 00 e1 67 66 R0.L = 0x6667; /* (26215) R0=0x66666667(1717986919) */
2e: 80 c0 08 18 A1 = R1.L * R0.L (FU);
32: 83 c6 80 51 A1 = A1 >> 0x10;
36: 11 c1 08 86 A1 += R1.H * R0.L (M), A0 = R1.H * R0.H (IS);
3a: 11 c1 01 98 A1 += R0.H * R1.L (M, IS);
3e: 83 c6 80 11 A1 = A1 >>> 0x10;
42: 0b c4 00 00 R0 = (A0 += A1);
46: 82 c6 f8 05 R2 = R0 >>> 0x1;
4a: 82 c6 09 01 R0 = R1 >>> 0x1f;
4e: 82 52 R2 = R2 - R0;
50: d2 bb [FP -0xc] = R2;
52: d0 b9 R0 = [FP -0xc];
54: 10 4f R0 <<= 0x2;
56: d2 b9 R2 = [FP -0xc];
58: 10 50 R0 = R0 + R2;
5a: 41 52 R1 = R1 - R0;
5c: d1 bb [FP -0xc] = R1;
5e: d0 b9 R0 = [FP -0xc];
60: 00 0c CC = R0 == 0x0;
62: 08 10 IF !CC JUMP 0x72 <_main+0x72>;
64: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x6667(26215) */
66: R_huimm16 .rodata+0xc
68: 00 e1 0c 00 R0.L = 0xc; /* ( 12) R0=0xc( 12) */
6a: R_luimm16 .rodata+0xc
6c: ff e3 ca ff CALL 0x0 <_main>;
6e: R_pcrel24 _puts
70: 2d 20 JUMP.S 0xca <_main+0xca>;
72: f1 b9 R1 = [FP -0x4];
74: 40 e1 55 55 R0.H = 0x5555; /* (21845) R0=0x5555000c(1431633932) */
78: 00 e1 56 55 R0.L = 0x5556; /* (21846) R0=0x55555556(1431655766) */
7c: 80 c0 08 18 A1 = R1.L * R0.L (FU);
80: 83 c6 80 51 A1 = A1 >> 0x10;
84: 11 c1 08 86 A1 += R1.H * R0.L (M), A0 = R1.H * R0.H (IS);
88: 11 c1 01 98 A1 += R0.H * R1.L (M, IS);
8c: 83 c6 80 11 A1 = A1 >>> 0x10;
90: 0b c4 00 04 R2 = (A0 += A1);
94: 82 c6 09 01 R0 = R1 >>> 0x1f;
98: 82 52 R2 = R2 - R0;
9a: e2 bb [FP -0x8] = R2;
9c: e0 b9 R0 = [FP -0x8];
9e: 08 4f R0 <<= 0x1;
a0: e2 b9 R2 = [FP -0x8];
a2: 10 50 R0 = R0 + R2;
a4: 41 52 R1 = R1 - R0;
a6: e1 bb [FP -0x8] = R1;
a8: e0 b9 R0 = [FP -0x8];
aa: 00 0c CC = R0 == 0x0;
ac: 08 10 IF !CC JUMP 0xbc <_main+0xbc>;
ae: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x5556(21846) */
b0: R_huimm16 .rodata+0x14
b2: 00 e1 14 00 R0.L = 0x14; /* ( 20) R0=0x14( 20) */
b4: R_luimm16 .rodata+0x14
b6: ff e3 a5 ff CALL 0x0 <_main>;
b8: R_pcrel24 _puts
ba: 08 20 JUMP.S 0xca <_main+0xca>;
bc: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x14( 20) */
be: R_huimm16 .rodata+0x1c
c0: 00 e1 1c 00 R0.L = 0x1c; /* ( 28) R0=0x1c( 28) */
c2: R_luimm16 .rodata+0x1c
c4: f1 b9 R1 = [FP -0x4];
c6: ff e3 9d ff CALL 0x0 <_main>;
c8: R_pcrel24 _printf
ca: f0 b9 R0 = [FP -0x4];
cc: 08 64 R0 += 0x1; /* ( 1) */
ce: f0 bb [FP -0x4] = R0;
d0: f0 b9 R0 = [FP -0x4];
d2: 21 e1 64 00 R1 = 0x64 (X); /* R1=0x64(100) */
d6: 08 09 CC = R0 <= R1;
d8: 99 1b IF CC JUMP 0xa <_main+0xa>;
da: 01 e8 00 00 UNLINK;
de: 10 00 RTS;
% bfin-elf-gcc -v
Using built-in specs.
Target: bfin-elf
コンフィグオプション: /usr/src/packages/BUILD/blackfin-toolchain-08r1.5/../gcc-4.1/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=bfin-elf --prefix=/opt/uClinux/bfin-elf --with-newlib --disable-libstdcxx-pch --enable-languages=c,c++ --disable-symvers --disable-libssp --disable-libffi --enable-clocale=generic --enable-version-specific-runtime-libs --enable-__cxa_atexit
スレッドモデル: single
gcc バージョン 4.1.2 (ADI svn)
! Optimized
fizzbuzz.o: ファイル形式 elf32-bfin
セクション .text の逆アセンブル:
00000000 <_main>:
0: 68 05 [--SP] = (R7:5);
2: 00 e8 03 00 LINK 0xc; /* (12) */
6: 0f 60 R7 = 0x1 (X); /* R7=0x1( 1) */
8: 46 e1 66 66 R6.H = 0x6666; /* (26214) R6=0x66660000(1717960704) */
c: 06 e1 67 66 R6.L = 0x6667; /* (26215) R6=0x66666667(1717986919) */
10: 45 e1 55 55 R5.H = 0x5555; /* (21845) R5=0x55550000(1431633920) */
14: 05 e1 56 55 R5.L = 0x5556; /* (21846) R5=0x55555556(1431655766) */
18: 07 30 R0 = R7;
1a: 79 60 R1 = 0xf (X); /* R1=0xf( 15) */
1c: ff e3 f2 ff CALL 0x0 <_main>;
1e: R_pcrel24 ___modsi3
20: 00 0c CC = R0 == 0x0;
22: 08 14 IF !CC JUMP 0x32 <_main+0x32> (BP);
24: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x0 <_main>( 0) */
26: R_huimm16 .rodata.str1.4
28: 00 e1 00 00 R0.L = 0x0; /* ( 0) R0=0x0 <_main>( 0) */
2a: R_luimm16 .rodata.str1.4
2c: ff e3 ea ff CALL 0x0 <_main>;
2e: R_pcrel24 _puts
30: 3f 20 JUMP.S 0xae <_main+0xae>;
32: 80 c0 3e 18 A1 = R7.L * R6.L (FU);
36: 83 c6 80 51 A1 = A1 >> 0x10;
3a: 11 c1 3e 86 A1 += R7.H * R6.L (M), A0 = R7.H * R6.H (IS);
3e: 11 c1 37 98 A1 += R6.H * R7.L (M, IS);
42: 83 c6 80 11 A1 = A1 >>> 0x10;
46: 0b c4 00 00 R0 = (A0 += A1);
4a: 08 4d R0 >>>= 0x1;
4c: 82 c6 0f 03 R1 = R7 >>> 0x1f;
50: 08 52 R0 = R0 - R1;
52: 10 32 P2 = R0;
54: 92 5e P2 = P2 + (P2 << 0x2);
56: 42 30 R0 = P2;
58: 07 08 CC = R7 == R0;
5a: 08 14 IF !CC JUMP 0x6a <_main+0x6a> (BP);
5c: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x0 <_main>( 0) */
5e: R_huimm16 .rodata.str1.4+0xc
60: 00 e1 0c 00 R0.L = 0xc; /* ( 12) R0=0xc( 12) */
62: R_luimm16 .rodata.str1.4+0xc
64: ff e3 ce ff CALL 0x0 <_main>;
66: R_pcrel24 _puts
68: 23 20 JUMP.S 0xae <_main+0xae>;
6a: 80 c0 3d 18 A1 = R7.L * R5.L (FU);
6e: 83 c6 80 51 A1 = A1 >> 0x10;
72: 11 c1 3d 86 A1 += R7.H * R5.L (M), A0 = R7.H * R5.H (IS);
76: 11 c1 2f 98 A1 += R5.H * R7.L (M, IS);
7a: 83 c6 80 11 A1 = A1 >>> 0x10;
7e: 0b c4 00 02 R1 = (A0 += A1);
82: 82 c6 0f 01 R0 = R7 >>> 0x1f;
86: 41 52 R1 = R1 - R0;
88: 11 32 P2 = R1;
8a: 92 5c P2 = P2 + (P2 << 0x1);
8c: 42 30 R0 = P2;
8e: 07 08 CC = R7 == R0;
90: 08 14 IF !CC JUMP 0xa0 <_main+0xa0> (BP);
92: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0xc( 12) */
94: R_huimm16 .rodata.str1.4+0x14
96: 00 e1 14 00 R0.L = 0x14; /* ( 20) R0=0x14( 20) */
98: R_luimm16 .rodata.str1.4+0x14
9a: ff e3 b3 ff CALL 0x0 <_main>;
9c: R_pcrel24 _puts
9e: 08 20 JUMP.S 0xae <_main+0xae>;
a0: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x14( 20) */
a2: R_huimm16 .rodata.str1.4+0x1c
a4: 00 e1 1c 00 R0.L = 0x1c; /* ( 28) R0=0x1c( 28) */
a6: R_luimm16 .rodata.str1.4+0x1c
a8: 0f 30 R1 = R7;
aa: ff e3 ab ff CALL 0x0 <_main>;
ac: R_pcrel24 _printf
ae: 0f 64 R7 += 0x1; /* ( 1) */
b0: 20 e1 65 00 R0 = 0x65 (X); /* R0=0x65(101) */
b4: 07 08 CC = R7 == R0;
b6: b1 17 IF !CC JUMP 0x18 <_main+0x18> (BP);
b8: 01 e8 00 00 UNLINK;
bc: 28 05 (R7:5) = [SP++];
be: 10 00 RTS;
! Normal
fizzbuzz.o: ファイル形式 elf32-bfin
セクション .text の逆アセンブル:
00000000 <_main>:
0: 00 e8 06 00 LINK 0x18; /* (24) */
4: 08 60 R0 = 0x1 (X); /* R0=0x1( 1) */
6: f0 bb [FP -0x4] = R0;
8: 64 20 JUMP.S 0xd0 <_main+0xd0>;
a: f0 b9 R0 = [FP -0x4];
c: 79 60 R1 = 0xf (X); /* R1=0xf( 15) */
e: ff e3 f9 ff CALL 0x0 <_main>;
10: R_pcrel24 ___modsi3
12: 00 0c CC = R0 == 0x0;
14: 08 10 IF !CC JUMP 0x24 <_main+0x24>;
16: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x1( 1) */
18: R_huimm16 .rodata
1a: 00 e1 00 00 R0.L = 0x0; /* ( 0) R0=0x0 <_main>( 0) */
1c: R_luimm16 .rodata
1e: ff e3 f1 ff CALL 0x0 <_main>;
20: R_pcrel24 _puts
22: 54 20 JUMP.S 0xca <_main+0xca>;
24: f1 b9 R1 = [FP -0x4];
26: 40 e1 66 66 R0.H = 0x6666; /* (26214) R0=0x66660000(1717960704) */
2a: 00 e1 67 66 R0.L = 0x6667; /* (26215) R0=0x66666667(1717986919) */
2e: 80 c0 08 18 A1 = R1.L * R0.L (FU);
32: 83 c6 80 51 A1 = A1 >> 0x10;
36: 11 c1 08 86 A1 += R1.H * R0.L (M), A0 = R1.H * R0.H (IS);
3a: 11 c1 01 98 A1 += R0.H * R1.L (M, IS);
3e: 83 c6 80 11 A1 = A1 >>> 0x10;
42: 0b c4 00 00 R0 = (A0 += A1);
46: 82 c6 f8 05 R2 = R0 >>> 0x1;
4a: 82 c6 09 01 R0 = R1 >>> 0x1f;
4e: 82 52 R2 = R2 - R0;
50: d2 bb [FP -0xc] = R2;
52: d0 b9 R0 = [FP -0xc];
54: 10 4f R0 <<= 0x2;
56: d2 b9 R2 = [FP -0xc];
58: 10 50 R0 = R0 + R2;
5a: 41 52 R1 = R1 - R0;
5c: d1 bb [FP -0xc] = R1;
5e: d0 b9 R0 = [FP -0xc];
60: 00 0c CC = R0 == 0x0;
62: 08 10 IF !CC JUMP 0x72 <_main+0x72>;
64: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x6667(26215) */
66: R_huimm16 .rodata+0xc
68: 00 e1 0c 00 R0.L = 0xc; /* ( 12) R0=0xc( 12) */
6a: R_luimm16 .rodata+0xc
6c: ff e3 ca ff CALL 0x0 <_main>;
6e: R_pcrel24 _puts
70: 2d 20 JUMP.S 0xca <_main+0xca>;
72: f1 b9 R1 = [FP -0x4];
74: 40 e1 55 55 R0.H = 0x5555; /* (21845) R0=0x5555000c(1431633932) */
78: 00 e1 56 55 R0.L = 0x5556; /* (21846) R0=0x55555556(1431655766) */
7c: 80 c0 08 18 A1 = R1.L * R0.L (FU);
80: 83 c6 80 51 A1 = A1 >> 0x10;
84: 11 c1 08 86 A1 += R1.H * R0.L (M), A0 = R1.H * R0.H (IS);
88: 11 c1 01 98 A1 += R0.H * R1.L (M, IS);
8c: 83 c6 80 11 A1 = A1 >>> 0x10;
90: 0b c4 00 04 R2 = (A0 += A1);
94: 82 c6 09 01 R0 = R1 >>> 0x1f;
98: 82 52 R2 = R2 - R0;
9a: e2 bb [FP -0x8] = R2;
9c: e0 b9 R0 = [FP -0x8];
9e: 08 4f R0 <<= 0x1;
a0: e2 b9 R2 = [FP -0x8];
a2: 10 50 R0 = R0 + R2;
a4: 41 52 R1 = R1 - R0;
a6: e1 bb [FP -0x8] = R1;
a8: e0 b9 R0 = [FP -0x8];
aa: 00 0c CC = R0 == 0x0;
ac: 08 10 IF !CC JUMP 0xbc <_main+0xbc>;
ae: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x5556(21846) */
b0: R_huimm16 .rodata+0x14
b2: 00 e1 14 00 R0.L = 0x14; /* ( 20) R0=0x14( 20) */
b4: R_luimm16 .rodata+0x14
b6: ff e3 a5 ff CALL 0x0 <_main>;
b8: R_pcrel24 _puts
ba: 08 20 JUMP.S 0xca <_main+0xca>;
bc: 40 e1 00 00 R0.H = 0x0; /* ( 0) R0=0x14( 20) */
be: R_huimm16 .rodata+0x1c
c0: 00 e1 1c 00 R0.L = 0x1c; /* ( 28) R0=0x1c( 28) */
c2: R_luimm16 .rodata+0x1c
c4: f1 b9 R1 = [FP -0x4];
c6: ff e3 9d ff CALL 0x0 <_main>;
c8: R_pcrel24 _printf
ca: f0 b9 R0 = [FP -0x4];
cc: 08 64 R0 += 0x1; /* ( 1) */
ce: f0 bb [FP -0x4] = R0;
d0: f0 b9 R0 = [FP -0x4];
d2: 21 e1 64 00 R1 = 0x64 (X); /* R1=0x64(100) */
d6: 08 09 CC = R0 <= R1;
d8: 99 1b IF CC JUMP 0xa <_main+0xa>;
da: 01 e8 00 00 UNLINK;
de: 10 00 RTS;