Re: DRL updated!

"Arkady V.Belousov" <[email protected]>
Newsgroups gmane.os.freedos.devel,gmane.spam.detected
Message-ID <[email protected]>
X-Comment-To: Bart Oldeman

Hi!

23-Окт-2002 12:27 [email protected] (Bart Oldeman) wrote to
[email protected]:

BO> There is however one problem with SMC that wasn't mentioned:
BO> in the following self-modifying code:
BO>     mov word [cs:label+1], 1
BO> label:  mov bx, 0
BO> you might get 1 in bx on some CPU's (386, 486) and 0 in bx on others,

     1 should be returned only on Pentium and above, but not on earlier
CPUs. BTW, one trick to detect CPU is to determine prefetch queue size. For
this with help of REP STOSB modified a lot of following NOP with DEC
instructions.

BO> because "mov bx, 0" is already in the prefetch queue. You'd have to avoid
BO> that by doing a jump or call, like this.
BO>     mov word [cs:label+1], 1
BO>     jmp short label
BO> label:  mov bx, 0
BO> Earlier CPUs don't have that problem, and later ones (Pentium xxx)

     You mean "newer" (not earlier)?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.