sal reg,variable

Discussions related to using the integrated assembler
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

sal reg,variable

Post by Ric »

does anyone know if it is possible to shift a register by a variable instead of an immediate value?
eg
sal dword [mem], eax
I can always make a loop to do it but it would be nice if i could do it in one line.
Regards Ric
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
RichardRussell

Re: sal reg,variable

Post by RichardRussell »

Ric wrote: Tue 29 Sep 2020, 21:01 does anyone know if it is possible to shift a register by a variable instead of an immediate value?
Yes. In IA-32:

Code: Select all

0FA31CF9 D3 25 F3 20 A3 0F              sal dword [mem], cl
or in x86-64:

Code: Select all

000000000D791D17 D3 25 F4 03 00 00               sal dword [rel mem], cl
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: sal reg,variable

Post by Ric »

Thanks for the swift reply Richard
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023