Skip to content

Commit

Permalink
added support for ror
Browse files Browse the repository at this point in the history
  • Loading branch information
dderjoel committed Sep 14, 2021
1 parent 363025d commit 30438fb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ typedef enum {
rcr,
rdtsc,
ret,
ror,
rorx,
sar,
sarx,
Expand Down
2 changes: 2 additions & 0 deletions src/instructions.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ const struct instr_table INSTR_TABLE[] = {
{{'\0'}, rcr, {NA, NA}, M, SHIFT, 1, NA, 2, 3, 0, {REX, 0xc1, REG}},
{"rdtsc", rdtsc, {n, n}, NA, OTHER, NA, NA, NA, 1, 0, {0x0f, 0x31}},
{"ret", ret, {n, n}, NA, CONTROL_FLOW, NA, NA, NA, 1, 0, {0xc3}},
{"ror", ror, {NA, ri}, M, SHIFT, NA, NA, 1, 3, 0, {REX, 0xd1, REG}},
{{'\0'}, ror, {NA, NA}, M, SHIFT, NA, NA, 1, 3, 0, {REX, 0xc1, REG}},
{"rorx", rorx, {rri, rmi}, RM, OTHER, NA, NA, NA, 5, 0, {0xc4, VEX, 0xfb, 0xf0, REG}},
{"sar", sar, {mi, ri}, M, SHIFT, 1, NA, 7, 3, 0, {REX, 0xd0, REG}},
{{'\0'}, sar, {NA, NA}, M, SHIFT, 1, NA, 7, 3, 0, {REX, 0xc0, REG}},
Expand Down
1 change: 1 addition & 0 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ TEST_ASM =\
nop.asm \
not.asm \
or.asm \
ror.asm \
rorx.asm \
prefetch.asm \
sarx.asm \
Expand Down
16 changes: 16 additions & 0 deletions test/ror.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SECTION .text
GLOBAL test
test:
ror r12, 0x3f
ror rcx, 0x1
ror r12, 0x4f
ror rsp, 0x7c
ror rsi, 0x7b
ror rax, 0x3f
ror rbp, 0x49
ror r11, 0x2f
ror r13, 0x7c
ror rdx, 0x7b
ror rax, 0x01
ror rcx, 0x10
ror rcx, 0x3f

0 comments on commit 30438fb

Please sign in to comment.