I'll translate but some of it does not make sense.
Code:
WORD lookKbits(BYTE k)
{
_asm {
mov dl, k //place k into low byte of DX
mov cl, 16 //put 16 into low byte of CX
sub cl, dl //subtract dl from cl
mov eax, [wordval] //place something in eax - perhaps a value at address wordval
shr eax, cl //Shift value in eax right cl times (divide by 2^cl)
}
}
WORD WORD_hi_lo(BYTE byte_high,BYTE byte_low)
{
_asm {
mov ah,byte_high //place byte_high into high byte of AX
mov al,byte_low //place byte_low into low byte of AX
}
}
//SWORD??? Not sure what this is BYTE, WORD, DWORD, QWORD - never seen SWORD
SWORD get_svalue(BYTE k)
{
_asm {
xor ecx, ecx //zero out ecx
mov cl,k //place k into low byte of CX
mov eax,[wordval] //place something into eax - perhaps a value at address wordval
shl eax,cl //shift eax left cl times (multiply by 2^cl)
shr eax, 16 //shift eax right 16 (divide by 2^16)
dec cl //decrement cl
bt eax,ecx //???????????? bt ???????????????? Dunno.
jc end_macro //conditonal jump (forget what jc is) to label end_macro
signed_value: //label
inc cl //increment cl
mov ebx,[start_neg_pow2] //place whatever is at address start_neg_pow2 into ebx
add ax,word ptr [ebx+ecx*2] //add value at address [ebx+(ecx*2)] to ax
end_macro:
}