direct probing memory
Posted: Tue May 20, 2003 1:51 pm
To get memory size I code a proc. Most times, it works fine. But sometimes couses my computer to crash. What may couse it to crash? (in pmode, a20 enabled)
And as a second thing. This code finds RAM size mostly even if a20 line is not enabled.Is it normal???proc TestMemory
push eax ebx ecx edx esi edi
mov esi, 100000h
xor ecx, ecx
MemCheckLoop:
mov ax,[esi]
mov dx, ax ;storing old value
not ax
mov [esi],ax
mov bx,[esi]
xor bx,ax
jnz MemCheckExit
inc ecx
add esi,1024
jc MemCheckExit
mov [esi], dx ;restoring old value
jmp MemCheckLoop
MemCheckExit:
pop edi esi edx ecx ebx eax
ret
endp TestMemory