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
SUMMARY

The discussion highlights the consistent instruction offset differences between gdb on Linux and debug on DOS, specifically noting that Linux exhibits an offset of 5 while DOS maintains an offset of 3. The users confirm that the programs were compiled using different assemblers and linkers: MASM for DOS and NASM for Linux. This discrepancy is attributed to the different compilation and linking processes utilized by the respective environments.

PREREQUISITES
  • Understanding of assembly language programming
  • Familiarity with NASM and MASM assemblers
  • Knowledge of linking processes in Linux and DOS environments
  • Experience with GDB for debugging in Linux
NEXT STEPS
  • Research the differences in instruction set architecture between DOS and Linux
  • Learn about the compilation and linking options in NASM and MASM
  • Explore GDB debugging techniques specific to Linux
  • Investigate how different operating systems handle instruction offsets
USEFUL FOR

Software developers, system programmers, and anyone involved in cross-platform assembly language development and debugging.

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
 

Similar threads

Replies
4
Views
3K
  • · Replies 17 ·
Replies
17
Views
3K
Replies
2
Views
2K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 12 ·
Replies
12
Views
5K