From 20834dcc57537cd95260a4a22f5d91a027adfd35 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Thu, 10 Jul 2025 22:20:01 +0200 Subject: Add x86_64 asm Signed-off-by: Carlos Maiolino --- x86_64/reg_size.s | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 x86_64/reg_size.s (limited to 'x86_64/reg_size.s') 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 -- cgit v1.2.3