Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix python code in SIGNEXTEND opcode #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gitglorythegreat
Copy link
Contributor

@gitglorythegreat gitglorythegreat commented Jun 25, 2024

  1. b == 31时,b 为最高字节位,不需要扩展。
  2. b0时,8 * b - 1-1,明显可以看出原来的代码有错。操作数都是 256 bit,字节位是从 0 到 31,所以应该是8 * (b + 1) - 1
  3. 置1后,需要取余将结果变回 256 bit 非负数。

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.

1 participant