|
|
@ -40,7 +40,7 @@ namespace molasses { |
|
|
|
std::vector<std::string>({ |
|
|
|
" popq %rax\n", |
|
|
|
" popq %rbx\n", |
|
|
|
" multl %ebx, %eax\n", |
|
|
|
" imull %ebx, %eax\n", |
|
|
|
" andl $0xFFFFFFFF, %eax\n", |
|
|
|
" pushq %rax\n" |
|
|
|
}) |
|
|
@ -67,25 +67,36 @@ namespace molasses { |
|
|
|
std::vector<std::string>({"i64"}), |
|
|
|
std::vector<std::string>({ |
|
|
|
" popq %rax\n", |
|
|
|
" movslq %rax\n", |
|
|
|
" movslq %eax, %rax\n", |
|
|
|
" pushq %rax\n" |
|
|
|
}) |
|
|
|
) |
|
|
|
); |
|
|
|
|
|
|
|
ctx.operations.emplace_back( |
|
|
|
std::make_shared<molasses::primitive_operation>( |
|
|
|
std::string{"syscall1"}, |
|
|
|
std::vector<std::string>({"i64", "i64"}), |
|
|
|
std::vector<std::string>({"i64"}), |
|
|
|
std::vector<std::string>({ |
|
|
|
" popq %rax\n", |
|
|
|
" popq %rdi\n", |
|
|
|
" syscall\n", |
|
|
|
" pushq %rax\n" |
|
|
|
}) |
|
|
|
) |
|
|
|
); |
|
|
|
ctx.operations.emplace_back( |
|
|
|
std::make_shared<molasses::primitive_operation>( |
|
|
|
std::string{"drop_i64"}, |
|
|
|
std::vector<std::string>({"i64"}), |
|
|
|
std::vector<std::string>({}), |
|
|
|
std::vector<std::string>({ |
|
|
|
" popq %rax\n" |
|
|
|
}) |
|
|
|
) |
|
|
|
); |
|
|
|
|
|
|
|
ctx.operations.emplace_back( |
|
|
|
std::make_shared<molasses::primitive_operation>( |
|
|
|
std::string{"syscall1"}, |
|
|
|
std::vector<std::string>({"i64", "i64"}), |
|
|
|
std::vector<std::string>({"i64"}), |
|
|
|
std::vector<std::string>({ |
|
|
|
" popq %rax\n", |
|
|
|
" popq %rdi\n", |
|
|
|
" syscall\n", |
|
|
|
" pushq %rax\n" |
|
|
|
}) |
|
|
|
) |
|
|
|
); |
|
|
|
ctx.operations.emplace_back( |
|
|
|
std::make_shared<molasses::primitive_operation>( |
|
|
|
std::string{"syscall2"}, |
|
|
|