1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
.L2:
movl $12, %edx ; Longueur chaîne = 12
movl $.LC0, %esi ; "\n x debut = "
movl $_ZSt4cout, %edi ; cout
call _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
movq %rbx, %rsi ; (RBX = x)
movl $_ZSt4cout, %edi ; cout
call _ZNSo9_M_insertImEERSoT_
movl $7, %edx ; Longueur chaîne = 7
movl $.LC1, %esi ; "\n b1 = "
movl $_ZSt4cout, %edi ; cout
call _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
movl $1, %esi ; (int)1
movl $_ZSt4cout, %edi ; cout
call _ZNSo9_M_insertIbEERSoT_
bsrq %rbx, %rbp ; Instruction BSR, pour __builtin_clzll(). n = rang du premier bit à 1
--
movl $7, %edx ; Longueur chaîne = 7
movl $.LC2, %esi ; "\n b2 = "
movl $_ZSt4cout, %edi ; cout
--
xorq $63, %rbp ; XOR 63 sur 7 bits => « -n-1 » => Nombre de bits à zéro à gauche
--
call _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
xorl %esi, %esi ; (int)0
movl $_ZSt4cout, %edi ; cout
call _ZNSo9_M_insertIbEERSoT_
movl %ebp, %ecx
--
movl $8, %edx ; Longueur chaîne = 8
movl $.LC3, %esi ; "\n x fin "
--
salq %cl, %rbx ; x <<= j
--
movl $_ZSt4cout, %edi ; cout
call _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
addq %rbx, %rbx ; x = x + x => x *=2 => x <<= 1
movl $_ZSt4cout, %edi ; cout
movq %rbx, %rsi ; (RBX = x)
call _ZNSo9_M_insertImEERSoT_
movl $8, %edx ; Longueur chaîne = 8
movl $.LC4, %esi ; "\n ------"
movq %rax, %rdi
call _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
jmp .L2 |
Partager