aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/qemu-src/test.s
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-02-05 18:35:26 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-02-05 18:35:26 +0100
commit724d077860e103631605f09a7de35e3ad8796f56 (patch)
treef7d94c536d3c70f62fb548c95f1835091801a9ff /src/tools/qemu-src/test.s
parent728d263753b998b8944a66eec1be0e743961fa1c (diff)
downloadnotes-724d077860e103631605f09a7de35e3ad8796f56.tar.gz
notes-724d077860e103631605f09a7de35e3ad8796f56.zip
qemu: cheap insn trace example
Diffstat (limited to 'src/tools/qemu-src/test.s')
-rw-r--r--src/tools/qemu-src/test.s16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/qemu-src/test.s b/src/tools/qemu-src/test.s
new file mode 100644
index 0000000..562b2ec
--- /dev/null
+++ b/src/tools/qemu-src/test.s
@@ -0,0 +1,16 @@
+.section .text, "ax"
+
+.global _start
+_start:
+ xor %rax, %rax
+ mov $0x8, %rax
+1:
+ cmp $0, %rax
+ je 2f
+ dec %rax
+ jmp 1b
+2:
+ # x86-64 exit(2) syscall
+ mov $0, %rdi
+ mov $60, %rax
+ syscall