Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit78e9812

Browse files
committed
Add comment about dividing by 4
The comment clarifies that because we track label addresses in32bit words, but that immediate values are in bytes, the codeneeds to divide immediate values by 4, while leaving symbols(label) addresses as-is.
1 parentb3ae442 commit78e9812

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎esp32_ulp/opcodes.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ def i_jump(target, condition='--'):
619619
raiseValueError("invalid flags condition")
620620
iftarget.type==IMMortarget.type==SYM:
621621
_bx.dreg=0
622+
# we track label addresses in 32bit words, but immediate values are in bytes and need to get divided by 4.
622623
_bx.addr=get_abs(target)iftarget.type==SYMelseget_abs(target)>>2# bitwise version of "// 4"
623624
_bx.unused=0
624625
_bx.reg=0

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp