You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
331 B
17 lines
331 B
package monkey |
|
|
|
// Assembles a jump to a function value |
|
func jmpToFunctionValue(to uintptr) []byte { |
|
return []byte{ |
|
0x48, 0xBA, |
|
byte(to), |
|
byte(to >> 8), |
|
byte(to >> 16), |
|
byte(to >> 24), |
|
byte(to >> 32), |
|
byte(to >> 40), |
|
byte(to >> 48), |
|
byte(to >> 56), // movabs rdx,to |
|
0xFF, 0x22, // jmp QWORD PTR [rdx] |
|
} |
|
}
|
|
|