evocation/exit-code.gnu.asm
Irene Knapp e604858411
write better comments in exit-code.gnu.asm
as part of the process of not having to think about it anymore now that it has served its purpose

Force-Push: yes
Change-Id: I8f39548fcd3aa08e6415a82b8b7452620ba9c0e5
2025-10-11 18:50:36 -07:00

29 lines
694 B
NASM

/*
* 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 exit-code -nostartfiles -nostdlib exit-code.gnu.asm && ./exit-code ; echo $?
*
* or
*
* as -o exit-code.o exit-code.gnu.asm && ld -s -o exit-code exit-code.o && ./exit-code; echo $?
*
* Can't use nasm, nasm is 32-bit only.
*
* Since you get a nice clean file, you can then do:
*
* objdump --disassemble exit-code
*/
.text
.global _start
_start:
mov $60, %eax
mov $42, %edi
syscall