summaryrefslogtreecommitdiff
path: root/x86_64/reg_size.s
diff options
context:
space:
mode:
authorCarlos Maiolino <[email protected]>2025-07-10 22:20:01 +0200
committerCarlos Maiolino <[email protected]>2025-07-10 22:20:01 +0200
commit20834dcc57537cd95260a4a22f5d91a027adfd35 (patch)
tree60f21143382380c3cd54110b4134f6fa98000a9b /x86_64/reg_size.s
parent8c6fc0c15415b32080a848bbde640e104098cf13 (diff)
Add x86_64 asm
Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'x86_64/reg_size.s')
-rw-r--r--x86_64/reg_size.s17
1 files changed, 17 insertions, 0 deletions
diff --git a/x86_64/reg_size.s b/x86_64/reg_size.s
new file mode 100644
index 0000000..e374922
--- /dev/null
+++ b/x86_64/reg_size.s
@@ -0,0 +1,17 @@
+# Program to play around with different register sizes
+
+.set exit_num, 60
+
+.section .text
+.globl _start
+
+_start:
+ movw $0b0000101000000101, %bx #10d and 5d into high and low registers
+ addb %bh, %bl
+ movb $0, %bh
+
+ # %bh now contains 10+5, use it as an argument to exit()
+
+ movq %rbx, %rdi
+ movq $exit_num, %rax
+ syscall