简体   繁体   中英

Assembly instruction address

Why every time when I disassembly the same .exe file the same instruction is in the same address? And what address is that(RAM? HDD? Virtual?)?

The basic idea is that, to allow portability of programs and to allow different programs to run on the same system without clashing, what you are seeing basically amounts to relative addresses which the OS translates to real addresses when the program is run.

The reason you need to have addresses at all is for instructions that reference addresses of other instructions such as jumps.

There is no reason. It's just how the executable/linking format on that O/S decided to work. Every architecture is different, for instance, even on x86 and x64, executables can be loaded at a randomized virtual address, or at the same one every time. The disassembler will either give the offset in the file, or a virtual address, which is just the base address decided at runtime + the file offset, and possibly a section offset. This is highly architecture dependent, so I can't really give a concrete answer...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM