summaryrefslogtreecommitdiffhomepage
path: root/tests/test-asm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-asm.cpp')
-rw-r--r--tests/test-asm.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test-asm.cpp b/tests/test-asm.cpp
index 6c03f48..fd0446f 100644
--- a/tests/test-asm.cpp
+++ b/tests/test-asm.cpp
@@ -192,6 +192,15 @@ TEST_F(AsmParseTest, parse_empty) {
ASSERT_EQ(chunks2.size(), 0u);
}
+TEST_F(AsmParseTest, parse_mov_0) {
+ Segment segment;
+
+ segment.append(parseAsm("mov ax, bx"));
+
+ ASSERT_EQ(segment.size(), 1u);
+ ASSERT_EQ(segment.getCode(), std::vector<uint8_t>({ 0x66, 0x89, 0xD8}));
+}
+
TEST_F(AsmParseTest, parse_op_0) {
std::vector<std::shared_ptr<Chunk>> chunks0{parseAsm("nop")};
ASSERT_EQ(chunks0.size(), 1u);