Signed right shift for 64-bit using CL:

` cmp cl,63`

ja SIGN

cmp cl,31

ja I63

shrd eax,edx,cl

sar edx,cl

ret

I63:

mov eax,edx

sar edx,31

and cl,31

sar eax,cl

ret

SIGN:

sar edx,31

mov eax,edx

ret

Signed right shift for 32-bit should then be:

` cmp cl,31`

ja SIGN

cmp cl,15

ja I31

shrd ax,dx,cl

sar dx,cl

ret

I31:

mov ax,dx

sar dx,15

and cl,15

sar ax,cl

ret

SIGN:

sar dx,15

mov ax,dx

ret