-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5390974
commit 8dfee8d
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#this constant has to be set to a kernel-specific value | ||
.equ TERMINATESYS, 18 | ||
|
||
|
||
# remember that $sp has to be set by kernel too | ||
|
||
# useful constants | ||
|
||
# This is the standard __start function for generic program | ||
# activation: it loads r15 with starting address and | ||
# at main() function return calls kernel TERMINATE service | ||
# (a SYSCALL with r0 == TERMINATE) | ||
|
||
.text | ||
.global __start | ||
.extern main | ||
|
||
__start: | ||
# $sp has to be set to correct value by kernel | ||
|
||
SUB sp, sp, #16 | ||
STR fp, [sp], #12 | ||
MOV fp, sp | ||
|
||
B main | ||
|
||
MOV sp, fp | ||
LDR fp, [sp], #12 | ||
ADD sp, sp, #16 | ||
|
||
# calls kernel TERMINATE service | ||
|
||
MOV r0, #TERMINATESYS | ||
|
||
SWI 8 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters