Mail Archives: djgpp/2000/01/20/07:49:46
Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote:
: On Wed, 19 Jan 2000, Nigel Pattinson wrote:
: > /* Set up %esi, %edi to copy data to the PM stack. */
: > subl %ecx, %esp
: > movl %esp, %edi
: > movl ARG3, %esi
: >
: > /* Copy the data. */
: > cld
: > rep
: > movsw
: >
: > Since the size of the parameters (in ecx) is in 16-bit words, it looks
: > to me like the line
: >
: > subl %ecx, %esp
: >
: > only reserves half the required amount of stack space.
: But the copy of the data to the stack (see above) *also* uses words:
: it copies with "rep movsw". So it moves ECX words to the stack, and
: that's exactly the amount of storage reserved there by subl.
: So where exactly is the problem here?
Say ecx is 2, then "subl %ecx, %esp" will decrease esp with 2,
right? Then "movsw" will copiy 4 bytes, right? That's double than what
was reserved.
Right,
MartinS
- Raw text -