summaryrefslogtreecommitdiff
path: root/main_sdcc.asm
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2019-10-18 00:31:54 +0200
committerXavier ASUS <xavi92psx@gmail.com>2019-10-18 00:31:54 +0200
commit268a53de823a6750d6256ee1fb1e7707b4b45740 (patch)
tree42c1799a9a82b2f7d9790ee9fe181d72a7274751 /main_sdcc.asm
downloadsdcc-gas-268a53de823a6750d6256ee1fb1e7707b4b45740.tar.gz
sdcc-3.9.0 fork implementing GNU assembler syntax
This fork aims to provide better support for stm8-binutils
Diffstat (limited to 'main_sdcc.asm')
-rw-r--r--main_sdcc.asm98
1 files changed, 98 insertions, 0 deletions
diff --git a/main_sdcc.asm b/main_sdcc.asm
new file mode 100644
index 0000000..b9bb3a7
--- /dev/null
+++ b/main_sdcc.asm
@@ -0,0 +1,98 @@
+;--------------------------------------------------------
+; File Created by SDCC : free open source ANSI-C Compiler
+; Version 3.9.3 #11345 (Linux)
+;--------------------------------------------------------
+ .module main_sdcc
+ .optsdcc -mstm8
+
+;--------------------------------------------------------
+; Public variables in this module
+;--------------------------------------------------------
+ .globl _main
+;--------------------------------------------------------
+; ram data
+;--------------------------------------------------------
+ .area DATA
+;--------------------------------------------------------
+; ram data
+;--------------------------------------------------------
+ .area INITIALIZED
+;--------------------------------------------------------
+; Stack segment in internal ram
+;--------------------------------------------------------
+ .area SSEG
+__start__stack:
+ .ds 1
+
+;--------------------------------------------------------
+; absolute external ram data
+;--------------------------------------------------------
+ .area DABS (ABS)
+
+; default segment ordering for linker
+ .area HOME
+ .area GSINIT
+ .area GSFINAL
+ .area CONST
+ .area INITIALIZER
+ .area CODE
+
+;--------------------------------------------------------
+; interrupt vector
+;--------------------------------------------------------
+ .area HOME
+__interrupt_vect:
+ int s_GSINIT ; reset
+;--------------------------------------------------------
+; global & static initialisations
+;--------------------------------------------------------
+ .area HOME
+ .area GSINIT
+ .area GSFINAL
+ .area GSINIT
+__sdcc_gs_init_startup:
+__sdcc_init_data:
+; stm8_genXINIT() start
+ ldw x, #l_DATA
+ jreq 00002$
+00001$:
+ clr (s_DATA - 1, x)
+ decw x
+ jrne 00001$
+00002$:
+ ldw x, #l_INITIALIZER
+ jreq 00004$
+00003$:
+ ld a, (s_INITIALIZER - 1, x)
+ ld (s_INITIALIZED - 1, x), a
+ decw x
+ jrne 00003$
+00004$:
+; stm8_genXINIT() end
+ .area GSFINAL
+ jp __sdcc_program_startup
+;--------------------------------------------------------
+; Home
+;--------------------------------------------------------
+ .area HOME
+ .area HOME
+__sdcc_program_startup:
+ jp _main
+; return from main will return to caller
+;--------------------------------------------------------
+; code
+;--------------------------------------------------------
+ .area CODE
+; /home/xavier/main_sdcc.c: 1: int main()
+; -----------------------------------------
+; function main
+; -----------------------------------------
+_main:
+; /home/xavier/main_sdcc.c: 3: return 0;
+ clrw x
+; /home/xavier/main_sdcc.c: 4: }
+ ret
+ .area CODE
+ .area CONST
+ .area INITIALIZER
+ .area CABS (ABS)