SAL and SAR by 0 errors
- by Roy McAvoy
I have discovered a bug in some assembly code I have been working with but can't figure how to fix it. When shifting left by 0 the result ends up being 0 instead of jut the number. The same applies when shifting to the right. Any and all help is much appreciated.
function sal(n,k:integer):integer;
begin
asm
cld
mov cx, k
@1:
sal n, 1
…