Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I thought the scale factor is either 1,2,4 or 8?


You can combine them. For example, [rax+rax*8+1] (base register, register shifted by 8, constant).


Isn't the scale factor encoded in just two bits? (i.e. 00=1, 01=2, 10=4, 11=8)


Just edited with an example; I’m on my iPhone so assembling via nasm takes an extra minute ;)


Thanks for the example. I was assuming that a and b are variables in OPs posting.


True that. In my case it was 12+x*9, which is log2 of the page sizes on x86 (4K, 2M, 1G).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: