mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-24 09:09:42 +02:00
netbsd: startup code, first working version for arm
git-svn-id: trunk@38591 -
This commit is contained in:
parent
626dc172ee
commit
b06105c893
@ -14,28 +14,38 @@
|
|||||||
#
|
#
|
||||||
# NetBSD standard (shared) ELF/arm startup code for Free Pascal
|
# NetBSD standard (shared) ELF/arm startup code for Free Pascal
|
||||||
|
|
||||||
|
# r12/ip = ps_strings on entry
|
||||||
|
|
||||||
.section .text
|
.section .text
|
||||||
.globl _start
|
.globl _start
|
||||||
_start:
|
_start:
|
||||||
# move.l %a2,-(%sp) | ps_strings
|
mov ip, r0
|
||||||
# move.l %a0,-(%sp) | obj
|
mov r0, r2
|
||||||
# move.l %a1,-(%sp) | cleanup
|
mov r2, ip
|
||||||
|
|
||||||
# move.l 0(%a2),operatingsystem_parameter_argv
|
ldr r3, [r2, #0]
|
||||||
# move.l 4(%a2),operatingsystem_parameter_argc
|
ldr r4, =operatingsystem_parameter_argv
|
||||||
# move.l 8(%a2),operatingsystem_parameter_envp
|
str r3, [r4]
|
||||||
# move.l 8(%a2),environ
|
ldr r3, [r2, #4]
|
||||||
|
ldr r4, =operatingsystem_parameter_argc
|
||||||
|
str r3, [r4]
|
||||||
|
ldr r3, [r2, #8]
|
||||||
|
ldr r4, =operatingsystem_parameter_envp
|
||||||
|
str r3, [r4]
|
||||||
|
ldr r4, =environ
|
||||||
|
str r3, [r4]
|
||||||
|
|
||||||
# jsr PASCALMAIN
|
# cache align, just in case
|
||||||
# jmp _haltproc
|
bic sp, sp, #7
|
||||||
|
|
||||||
|
bl PASCALMAIN
|
||||||
|
bl _haltproc
|
||||||
|
|
||||||
.globl _haltproc
|
.globl _haltproc
|
||||||
_haltproc:
|
_haltproc:
|
||||||
# move.l operatingsystem_result,-(%sp)
|
ldr r0,=operatingsystem_result
|
||||||
# move.l #0,-(%sp)
|
ldr r0,[r0]
|
||||||
# moveq.l #1,%d0
|
svc 0xa00001
|
||||||
# trap #0
|
|
||||||
# rts
|
|
||||||
|
|
||||||
|
|
||||||
.section .data
|
.section .data
|
||||||
|
Loading…
Reference in New Issue
Block a user