summaryrefslogtreecommitdiffhomepage
path: root/asm/intel64/trivials.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-11-13 11:27:39 +0100
committerRoland Reichwein <mail@reichwein.it>2020-11-13 11:27:39 +0100
commit97b8d5bb3c9fd96251e89539d122d2331a2a7925 (patch)
treed72aca2bb0a2ea3b7d5933c1c68097ed0840002a /asm/intel64/trivials.h
parent387af55e498970975d77291374e2f5be12a040bd (diff)
Add system tests, implement syscall
Diffstat (limited to 'asm/intel64/trivials.h')
-rw-r--r--asm/intel64/trivials.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/asm/intel64/trivials.h b/asm/intel64/trivials.h
new file mode 100644
index 0000000..72ea3f8
--- /dev/null
+++ b/asm/intel64/trivials.h
@@ -0,0 +1,24 @@
+// Trivial Operations, without arguments
+
+#pragma once
+
+#include <asm/chunk.h>
+
+// No Operation
+class Op_nop: public OpSimple
+{
+public: Op_nop() : OpSimple({ 0x90 }) {}
+};
+
+// Return from procedure
+class Op_ret: public OpSimple
+{
+public: Op_ret() : OpSimple({ 0xC3 }) {} // near return; TODO: far return is 0xCB
+};
+
+// Syscall
+class Op_syscall: public OpSimple
+{
+public: Op_syscall() : OpSimple({ 0x0F, 0x05 }) {}
+};
+