summaryrefslogtreecommitdiffhomepage
path: root/asm/intel64/trivials.cpp
blob: 094d27f63affacb3770c115b380413c402737fdf (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", [](Asm::Args& args) -> std::shared_ptr<Op>{
                            return std::make_shared<Op_nop>();
                           }) &&
 registerOp("ret", [](Asm::Args& args) -> std::shared_ptr<Op>{
                            return std::make_shared<Op_ret>();
                           }) &&
 registerOp("syscall", [](Asm::Args& args) -> std::shared_ptr<Op>{
                            return std::make_shared<Op_syscall>();
                           })
};

}