pdp11: commit makefile and crt0 code
authorAlan Cox <alan@linux.intel.com>
Sun, 8 Apr 2018 19:52:03 +0000 (20:52 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 8 Apr 2018 19:52:03 +0000 (20:52 +0100)
Library/libs/crt0_pdp11.S [new file with mode: 0644]
Library/libs/crt0nostdio_pdp11.S [new file with mode: 0644]

diff --git a/Library/libs/crt0_pdp11.S b/Library/libs/crt0_pdp11.S
new file mode 100644 (file)
index 0000000..c104cbe
--- /dev/null
@@ -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 (file)
index 0000000..7f153a1
--- /dev/null
@@ -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