From 8f94834e451cf7ae7cccb5522562b3dea3754039 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Sun, 5 Oct 2025 14:36:54 -0700 Subject: yay the earliest examples are in a solid state Force-Push: yes Change-Id: I7111b9a9ed3cb5c5cf162af336b2278cf5850b76 --- exit-code.S | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 exit-code.S (limited to 'exit-code.S') diff --git a/exit-code.S b/exit-code.S new file mode 100644 index 0000000..4c723e8 --- /dev/null +++ b/exit-code.S @@ -0,0 +1,27 @@ +/* + * This file was a very early example, written by consulting [1]. It was + * useful primarily to see how the GNU assembler handles these opcodes, to + * better understand the encoding. + * + * [1] https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html + * + * + * gcc -o quine -nostartfiles -nostdlib quine.S && ./quine ; echo $? + * + * or + * + * as -o quine.o quine.S && ld -s -o quine quine.o && ./quine; echo $? + * + * Can't use nasm, nasm is 32-bit only. + */ +.text + +.global _start + +_start: + //mov $60, %rax + //mov $42, %rdi + mov $60, %eax + mov $42, %edi + syscall + -- cgit 1.4.1