Code: Select all
Perftw:push rsp
mov r14,[ply]
shl r14,shiftvalue
mov [make.pointer + r14],0
mov rax,[count]
mov [make.oldcount + r14],rax
if UseHash eq 1
cmp [my.hashkey],0
je notrestorehash
mov r15,[my.hashkey]
mov rcx,r15
shr rcx,32
and r15,[hashkeymask]
shl r15,hashdivide
add r15,[HashBuffer]
cmp dword [r15 + hashtablekey],ecx
jne notrestorehash
mov cl,[my.depth]
cmp byte [r15 + hashtabledepth],cl
jne notrestorehash
;mov rcx,[my.position]
;cmp qword [r15 + hashtableposition],rcx
; je restorehash
;add [hashcollision],1
; jmp notrestorehash
restorehash:
xor rcx,rcx
mov cl,byte [r15 + hashtablenodes]
add [count],rcx
add [hashnodes],rcx
pop rsp
ret
notrestorehash:
end if
call CreateMovesList
mov rax,[make.numberofmoves + r14]
shr rax,3
cmp rax,0
jnz weeer01
mov [mateflag],1
pop rsp
ret
weeer01:
mov rcx,[depth]
add [my.depthnodes + (rcx * 8)],rax
cmp [depth],1
jne weeer
add [count],rax
pop rsp
ret
weeer:
mov r14,[ply]
shl r14,shiftvalue
mov rbx,[make.pointer + r14]
cmp rbx,[make.numberofmoves + r14]
je gomake
add [make.pointer + r14],8
call Make
if UseDraw eq 1
call SaveTopScreen
call DrawBoard
call PrintHash
mov [DelayThis],1000000000
pause1hggh:dec [DelayThis]
jnz pause1hggh
end if
call Perftw
cmp [mateflag],1
jne storehash
mov [mateflag],0
jmp skipmate
storehash:
if UseHash eq 1
mov r15,[my.hashkey]
mov rcx,r15
shr rcx,32
and r15,[hashkeymask]
shl r15,hashdivide
add r15,[HashBuffer]
mov dword [r15 + hashtablekey],ecx
mov cl,[my.depth]
mov byte [r15 + hashtabledepth],cl
;mov rcx,[my.position]
;mov qword [r15 + hashtableposition],rcx
mov rcx,[count]
sub rcx,[make.oldcount + r14]
mov byte [r15 + hashtablenodes],cl
end if
skipmate:
call UnMake
if UseDraw eq 1
call SaveTopScreen
call DrawBoard
call PrintHash
mov [DelayThis],1000000000
pause1hggjh:dec [DelayThis]
jnz pause1hggjh
end if
jmp weeer
gomake:
pop rsp
ret