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
direct probing memory
direct probing memory
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)
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:direct probing memory
1. you migt have some memory-mapped devices that will go bad once you write arbitrary ~X in it ...
2. maybe the BIOS did enable the A20 gate at boot up ... some do, others don't.
2. maybe the BIOS did enable the A20 gate at boot up ... some do, others don't.