What causes the different instruction offset between gdb/linux and debug/dos?

  • Thread starter Thread starter dduardo
  • Start date Start date
  • Tags Tags
    Instruction
Click For Summary
In the discussion, a notable difference in instruction offsets between DOS and Linux is observed, with DOS consistently showing an offset of 3 and Linux an offset of 5. This discrepancy raises questions about the underlying compilation and linking processes used in each environment. The programs are compiled and linked using different tools: DOS utilizes MASM and ML with DEBUG, while Linux employs NASM and LD with GDB. The variations in instruction offsets may stem from differences in how these assemblers and linkers handle instruction encoding and memory alignment.
dduardo
Staff Emeritus
Science Advisor
Insights Author
Messages
1,902
Reaction score
3
I notice with gdb/linux each instruction is offset by 5 while debug/dos each instruction is offset by 3. What is linux doing that dos isn't?
 
Computer science news on Phys.org
Is it consistently 3 or 5? Do you know how the programs were compiled? Are they on the same machine?
 
Yes, under dos it is always 3 and under linux it is always 5. I'm running the same two programs on different computers and assembling and linking them with different programs

dos/masm/ml/debug
linux/nasm/ld/gdb
 
I’ve spent nearly my entire life online, and witnessed AI become integrated into our lives. It’s clear that AI is apart of us now whether we like it or not, unless your a anti tech cabin lover. AI has some form of control over your life. But what I’ve seen very recently is that people are loosing their ingenuity and deciding to use AI. I feel as if it’ll bleed into STEM which is kinda has already and, every idea or thought could become fully reliant on AI. Yeah AI makes life easier but at a...

Similar threads

Replies
4
Views
2K
  • · Replies 14 ·
Replies
14
Views
1K
Replies
2
Views
2K
  • · Replies 18 ·
Replies
18
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 12 ·
Replies
12
Views
4K