Skip to content

fix python code in SIGNEXTEND opcode#18

Open
gitglorythegreat wants to merge 1 commit intoWTFAcademy:mainfrom
gitglorythegreat:main
Open

fix python code in SIGNEXTEND opcode#18
gitglorythegreat wants to merge 1 commit intoWTFAcademy:mainfrom
gitglorythegreat:main

Conversation

@gitglorythegreat
Copy link
Copy Markdown
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