MASM/LINK or LIB memory errors

Viewed 39

I have an application that was originally developed using NASM under a Linux operating system. I ported that (still Using NASM) to a Windows operating system. Because the system was difficult to debug, I am 9/10 thru converting the code to MASM syntax and using VisualStudio for debugging. All has gone well up until now.

I have come across a problem where memory address's appear to be overlapping and am not able to explain why. I have the following coded:-

COMMON.obj
.DATA?  
savedRegisters  dq 384 dup(?)

Common.obj is held in a statically linked library NAME.LIB

V2.10.obj  + NAME.LIB to create executable
.DATA?
 ALIGN 8
 RandomNos  dq 1000000

Addrdess during debugging

RandomNos       0x000000013FE106A0
savedRegisters  0x000000013FE106C0

RandomNos is only 32 bytes from savedRegisters, hence savedRegisters is overwritten when populating RandomNos

Can anyone suggest a reason for this and hence a solution ?

0 Answers
Related