# linux2021: ChunYoLin ## 測驗 α − 2 因為shift amount是參數, 先load to register, 再放到CL register, 就可以直接使用ror or rol instruction來implement. 例如: ROR r/m8, CL ## 測驗 β - 1 (aligment & (alignment - 1)) == 0表示 alignment為power of 2, 當aligment 為power of 2時, aligment - 1 會形成一個右邊均唯一的mask, 將其invert即可得到一個左邊均為1的mask, 再將sz&這個mask即可得到align過後的sz, 為了得到大於aligment的sz, 所以將sz先加上mask, 因此最後答案為(sz+mask) & (~mask)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up