Hi Guys,
 
Can someone explain why the disassembly of crt0.o shown below doesn't
match the cpp code in crt0.s?  In particular, the subw isn't shown in
the disassembly, the data32 turns into data16, and so on.
 
Have I got a bad version of assembler?
 
gcc -v
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 
Is there a better way to disassemble code?  Is there a way to
disassemble the linuxbios.strip file?
 
Thanks,
- Jan
 
.................................................
cat crt0.s
 
 _start  :
 cli
 xorl %eax, %eax
 movl %eax, %cr3    
 invd
 movw %cs, %ax
 shlw $4, %ax
 movw $ gdtptr16_offset  , %bx
 subw %ax, %bx                    <--------
 data32  lgdt %cs:(%bx)
 movl %cr0, %eax
 andl $0x7FFAFFD1, %eax 
 orl $0x60000001, %eax 
 movl %eax, %cr0
 data32 ljmp $0x10, $__protected_start
..................................................
objdump -d crt0.o
 
crt0.o:     file format elf32-i386
 
Disassembly of section .text:
 
   0:   fa                      cli
   1:   66 31 c0                xor    %ax,%ax
   4:   0f 22 d8                mov    %eax,%cr3
   7:   0f 08                   invd
   9:   8c c8                   mov    %cs,%eax
   b:   c1 e0 04                shl    $0x4,%eax
   e:   bb 00 00 29 c3          mov    $0xc3290000,%ebx
                                          <----------- ?
  13:   66                      data16
  14:   2e 0f 01 17             lgdt   %cs:(%edi)
  18:   0f 20 c0                mov    %cr0,%eax
  1b:   66 25 d1 ff             and    $0xffd1,%ax
  1f:   fa                      cli
  20:   7f 66                   jg     88 <__protected_start+0x15>
..................................................
od -Ax -tx1 linuxbios.strip
000000 fa 66 31 c0 0f 22 d8 0f 08 8c c8 c1 e0 04 bb 34
000010 00 29 c3 66 2e 0f 01 17 0f 20 c0 66 25 d1 ff fa
000020 7f 66 0d 01 00 00 60 0f 22 c0 66 ea 73 00 0f 00

Reply via email to