-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
Uplifting 8051 architecture to new IL #2999
Conversation
Please add also yourself in SPDX copyright section of that file and @Basstorm as well. |
e485b0a
to
6e22f31
Compare
6e22f31
to
defdb34
Compare
61d0f5a
to
ac55c0d
Compare
The format error seems to be because the clang-format version in my system is 15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very nice already!
a21efd6
to
52bf8d0
Compare
52bf8d0
to
ce35ba7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, apart from a couple of comments. The remaining part would be the tracetest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty neat to me. Great work!
return STOREW(U16(a->d.addr), BOOL_TO_BV(v, 1)); | ||
} | ||
case I8051_ADDRESSING_DIRECT: | ||
return STORE(U16(a->d.addr), v); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of duplicating the address calculation logic, just use return STOREW(get_any(a), v)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it should not be equivalent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could only skim over it briefly. But LGTM. Good job!
librz/analysis/arch/8051/8051_op.h
Outdated
* 0x05 iram addr | ||
* 0x06-0x07 @(R0-R1) | ||
* 0x08-0x0f, R0-R7 | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the meaning here common knowledge for people who know 8051? Otherwise I would suggest to add more context (this is the offset into the buffer?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for comments below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@imbillow many tests are broken on big endian platform:
[XX] db/asm/8051 <asm> djnz 0x40, 0x118b
-- <asm> djnz 0x40, 0x118b <--> d54088 ---> <IL>
-- assembly
-- IL
--- expected
+++ actual
@@ -1,1 +1,1 @@
-(seq (set res (- (load 0 (bv 16 0x40)) (bv 8 0x1))) (store 0 (bv 16 0x40) (var res)) (branch (! (is_zero (var res))) (jmp (bv 16 0x1288)) nop))
+(seq (set res (- (load 0 (bv 16 0x0)) (bv 8 0x1))) (store 0 (bv 16 0x0) (var res)) (branch (! (is_zero (var res))) (jmp (bv 16 0x1288)) nop))
[XX] db/asm/8051 <asm> dec 0x35
-- <asm> dec 0x35 <--> 1535 ---> <IL>
-- assembly
-- IL
--- expected
+++ actual
@@ -1,1 +1,1 @@
-(seq (set arg0 (load 0 (bv 16 0x35))) (store 0 (bv 16 0x35) (- (var arg0) (bv 8 0x1))))
+(seq (set arg0 (load 0 (bv 16 0x0))) (store 0 (bv 16 0x0) (- (var arg0) (bv 8 0x1))))
See all at https://app.travis-ci.com/github/rizinorg/rizin/jobs/590853977
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
SQUASH ME
Your checklist for this pull request
Detailed description
continue #1609
Instrunction set: https://www.win.tue.nl/~aeb/comp/8051/set8051.html
...
Test plan
...
Closing issues
...