
Why does this give illegal instruction?
Quote:
>Here is a little routine I have that clears a segment. the 'mov'
>gives illegal instruction on the second pass through the loop ???
>;
>; clrseg - Clear any segment.
>; FS = Segment base, ECX = Size in Paragraphs.
>;
> sub edi,edi ;clear index
> shl ecx,2 ;mult by 4 = n'dwords/para
> sub eax,eax ;clear this
> add edi,4 ;next...
Surely it should be
add edi,4
With FS set up correctly, it shouldn't go bang. I think you'll need
to post the code where you set it up.
It could happily write to FS:0, but not FS:4, if the value at FS:0 is
0, and the value as FS:4 isn't.
Jim