diff options
author | Irene Knapp <ireneista@irenes.space> | 2025-10-05 22:07:40 -0700 |
---|---|---|
committer | Irene Knapp <ireneista@irenes.space> | 2025-10-05 22:07:40 -0700 |
commit | 14d71a07dafa023ba83c2bdc6837d4ecc9de12ba (patch) | |
tree | b4bb3a997ed1149ae63670c3f62ea218291e2776 /exit-code.gnu.asm | |
parent | 8f94834e451cf7ae7cccb5522562b3dea3754039 (diff) |
hello works! yay
Force-Push: yes Change-Id: I6c70991d16bd27da2b75ee0666203f043714a685
Diffstat (limited to 'exit-code.gnu.asm')
-rw-r--r-- | exit-code.gnu.asm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/exit-code.gnu.asm b/exit-code.gnu.asm new file mode 100644 index 0000000..4c723e8 --- /dev/null +++ b/exit-code.gnu.asm @@ -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 + |