0

I was wondering what the machine code 00 means? Also, I sometimes see machine code 08 appear in a procedure. What does 08 mean?

    08048413 <main>:
    8048413:    55                      push   %ebp   #save frame pointer 
    8048414:    89 e5                   mov    %esp,%ebp    #create new frame pointer
    8048416:    83 e4 f0                and    $0xfffffff0,%esp
    8048419:    83 ec 10                sub    $0x10,%esp   # pnter = pointer - 16
    804841c:    c7 44 24 04 03 00 00    movl   $0x3,0x4(%esp)  #store 3  as argument 2
    8048423:    00 
    8048424:    c7 04 24 01 00 00 00    movl   $0x1,(%esp)
    804842b:    e8 bd ff ff ff          call   80483ed <sum>      
    8048430:    c9                      leave  
    8048431:    c3                      ret    
Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
delgeezee
  • 103
  • 1
  • 7
  • 5
    Are you refering to addr 8048423? It belongs to previous line, I think. Compere the two instructions and you will see it is the constant - `03 00 00 00` (second line `01 00 00 00`). The first is one byte longer because you use offset (`0x4(%esp)`) the second is direct (`(%esp)`). – firda Sep 29 '14 at 07:25
  • For the record, `00 00` is `add %al, (%rax)` (memory destination add), if you do have it at the start of an instruction. (This question comes up as the top hit when trying to search for a Q&A about decoding zero bytes.) [What would happen if a system executes a part of the file that is zero-padded?](https://stackoverflow.com/q/50150909) can work as a canonical duplicate about that. – Peter Cordes Jun 10 '23 at 20:34

2 Answers2

3

The 00 is not a machine code. It is just the address(0x00000003). In a 64bits machine, a address consists of 4 bytes, and the disassembly don't show a too long line, it wrap. That is.

  • It *is* part of the machine code for the previous instruction; I think you mean it's not an *opcode* or prefix, i.e. not the start of a new instruction. It's not an address either, it's part of the *immediate* source operand to `mov`, which comes after the `modrm + SIB + disp8` (`44 24 04`) bytes of the `4(%esp)` addressing mode. – Peter Cordes Oct 26 '21 at 03:45
  • And you can disable line-wrapping with `objdump -w`. I normally use `objdump -drwC -Mintel` – Peter Cordes Oct 26 '21 at 03:46
-3

You need to read the documentation and see what each opcode mean

oops my mistake , NOP is not 0x00 (its 0x00 on 8051)...

see this table http://sparksandflames.com/files/x86InstructionChart.html

Gil.I
  • 895
  • 12
  • 23