Skip to content

Modified Question D and updating of mask#3

Open
evanchime wants to merge 1 commit intoDesmondoRay:masterfrom
evanchime:fix-Homeworks-3.60-bug
Open

Modified Question D and updating of mask#3
evanchime wants to merge 1 commit intoDesmondoRay:masterfrom
evanchime:fix-Homeworks-3.60-bug

Conversation

@evanchime
Copy link
Copy Markdown
Contributor

On my textbook, line 10 of the assembly code says "salq %cl, %rdx" and hence the reason for my pull request

@SneedusSnake
Copy link
Copy Markdown

Shouldn't the mask be 0x3F? As stated in the book, shift instructions only use first m bits of the register %cl, where m depends on the word size specified for the instruction, with the formula 2^m = w. So for salq, w = 64, which gives us m = 6, hence we only take first 6 bits of the n argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants