From 2f341d60e7fa0d1434e9299eb20d0323edf91d34 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 8 Apr 2018 20:52:03 +0100 Subject: [PATCH] pdp11: commit makefile and crt0 code --- Library/libs/crt0_pdp11.S | 35 ++++++++++++++++++++++++++++++++ Library/libs/crt0nostdio_pdp11.S | 33 ++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 Library/libs/crt0_pdp11.S create mode 100644 Library/libs/crt0nostdio_pdp11.S diff --git a/Library/libs/crt0_pdp11.S b/Library/libs/crt0_pdp11.S new file mode 100644 index 00000000..c104cbef --- /dev/null +++ b/Library/libs/crt0_pdp11.S @@ -0,0 +1,35 @@ + .text + .even + + .globl ___stdio_init_vars + .globl _main + .globl _exit + .globl _environ + .globl ___argv + .globl _start + + +_start: br _start2 + .byte 'F' + .byte 'Z' + .byte 'X' + .byte '1' + /* FIXME make the linker do these */ + .byte 0 /* Patched to load addr page */ + .word 0 + .word _etext /* Patched to code size */ + .word _edata /* Patched to data size */ + .word _ebss /* Patched to BSS size */ +_start2: + jsr pc,___stdio_init_vars + mov sp,r0 + mov r0,___argv + inc r0 + inc r0 + mov r0,_environ + jsr pc,_main + move r0,-(sp) + jsr pc,_exit + + .data +_environ: .word 0 diff --git a/Library/libs/crt0nostdio_pdp11.S b/Library/libs/crt0nostdio_pdp11.S new file mode 100644 index 00000000..7f153a13 --- /dev/null +++ b/Library/libs/crt0nostdio_pdp11.S @@ -0,0 +1,33 @@ + .text + .even + + .globl _main + .globl _exit + .globl _environ + .globl ___argv + .globl _start + + +_start: br _start2 + .byte 'F' + .byte 'Z' + .byte 'X' + .byte '1' + /* FIXME make the linker do these */ + .byte 0 /* Patched to load addr page */ + .word 0 + .word _etext /* Patched to code size */ + .word _edata /* Patched to data size */ + .word _ebss /* Patched to BSS size */ +_start2: + mov sp,r0 + mov r0,___argv + inc r0 + inc r0 + mov r0,_environ + jsr pc,_main + mov r0,-(sp) + jsr pc,_exit + + .data +_environ: .word 0 -- 2.34.1