2 ms·
I thought the scale factor is either 1,2,4 or 8?
by tralarpa 6y ago
I thought the scale factor is either 1,2,4 or 8?
- saagarjha 6y agoYou can combine them. For example, [rax+rax*8+1] (base register, register shifted by 8, constant).
- tralarpa 6y agoIsn't the scale factor encoded in just two bits? (i.e. 00=1, 01=2, 10=4, 11=8)
- saagarjha 6y agoJust edited with an example; I’m on my iPhone so assembling via nasm takes an extra minute ;)
- tralarpa 6y agoThanks for the example. I was assuming that a and b are variables in OPs posting.
- bonzini 6y agoTrue that. In my case it was 12+x*9, which is log2 of the page sizes on x86 (4K, 2M, 1G).