summaryrefslogtreecommitdiffhomepage
path: root/asm/intel64/trivials.cpp
blob: eb1bbb8c1b30c1432bf96a4dc395cb7298898a73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "trivials.h"

#include <asm/assembler.h>

Op_nop::Op_nop(): OpSimple({ 0x90 }) {}
Op_ret::Op_ret(): OpSimple({ 0xC3 }) {} // near return; TODO: far return is 0xCB
Op_syscall::Op_syscall(): OpSimple({ 0x0F, 0x05 }) {}

namespace {

bool registered {
 registerOp("nop", [](const Asm::Args& args) -> std::shared_ptr<Op>{
                            return std::make_shared<Op_nop>();
                           }) &&
 registerOp("ret", [](const Asm::Args& args) -> std::shared_ptr<Op>{
                            return std::make_shared<Op_ret>();
                           }) &&
 registerOp("syscall", [](const Asm::Args& args) -> std::shared_ptr<Op>{
                            return std::make_shared<Op_syscall>();
                           })
};

}