blob: 4c723e8fdf7d39f008b627e22cf4f7310bee28ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
|