Function:
INVD tells the processor that all data in both the internal as well as the
external caches is invalid. Data held in external write-back caches is
discarded.
If on some 486's a cache line fill is in progress while the INVD instruction
is being executed, that line is NOT invalidated and the buffer contents
is moved into the cache. Valid cache lines are ALWAYS used to satisfy
read requests on all 486's, regardless whether the cache is enabled or not.
Workaround is to disable the cache prior to flushing it like this:
MOV EAX,CR0
OR EAX,60000000h ; cache disable bits
PUSHFD
CLI
MOV BL,CS:here
OUT dummyport,dummydata
MOV CR0,EAX