aboutsummaryrefslogtreecommitdiff
path: root/libgloss/m68k/atari/atari-crtn.S
diff options
context:
space:
mode:
Diffstat (limited to 'libgloss/m68k/atari/atari-crtn.S')
-rw-r--r--libgloss/m68k/atari/atari-crtn.S24
1 files changed, 24 insertions, 0 deletions
diff --git a/libgloss/m68k/atari/atari-crtn.S b/libgloss/m68k/atari/atari-crtn.S
new file mode 100644
index 0000000..6482a9c
--- /dev/null
+++ b/libgloss/m68k/atari/atari-crtn.S
@@ -0,0 +1,24 @@
+/*
+ Copyright (C) 2025 Mikael Hildenborg
+ SPDX-License-Identifier: BSD-2-Clause
+*/
+
+ .global _program_return_code
+
+ .section ".init"
+ /*
+ Empty.
+ */
+
+
+ .section ".fini"
+ .global _fini
+ .type _fini,#function
+_fini:
+ | this occurs after crtend.o have done all global destructors etc.
+ move.w _program_return_code,-(a7)
+ move.w #0x4c,-(a7)
+ trap #1
+
+ .bss
+ .lcomm _program_return_code, 2