~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/rtl/nds/prt07.as

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@---------------------------------------------------------------------------------
 
2
        .section ".init"
 
3
        .global _start
 
4
@---------------------------------------------------------------------------------
 
5
        .align  4
 
6
        .arm
 
7
@---------------------------------------------------------------------------------
 
8
_start:
 
9
@---------------------------------------------------------------------------------
 
10
        mov     r0, #0x04000000         @ IME = 0;
 
11
        str     r0, [r0, #0x208]
 
12
 
 
13
        mov     r0, #0x12               @ Switch to IRQ Mode
 
14
        msr     cpsr, r0
 
15
        ldr     sp, =__sp_irq           @ Set IRQ stack
 
16
 
 
17
        mov     r0, #0x13               @ Switch to SVC Mode
 
18
        msr     cpsr, r0
 
19
        ldr     sp, =__sp_svc           @ Set SVC stack
 
20
 
 
21
        mov     r0, #0x1F               @ Switch to System Mode
 
22
        msr     cpsr, r0
 
23
        ldr     sp, =__sp_usr           @ Set user stack
 
24
 
 
25
        ldr     r0, =__bss_start        @ Clear BSS section to 0x00
 
26
        ldr     r1, =__bss_end
 
27
        sub     r1, r1, r0
 
28
        bl      ClearMem
 
29
 
 
30
        mov     r0, #0                  @ int argc
 
31
        mov     r1, #0                  @ char *argv[]
 
32
        ldr     r3, =main
 
33
  bx    r3
 
34
  nop
 
35
                
 
36
        @ If the user ever returns, return to flash cartridge
 
37
        mov     r0, #0x08000000
 
38
        bx      r0
 
39
 
 
40
@---------------------------------------------------------------------------------
 
41
@ Clear memory to 0x00 if length != 0
 
42
@  r0 = Start Address
 
43
@  r1 = Length
 
44
@---------------------------------------------------------------------------------
 
45
ClearMem:
 
46
@---------------------------------------------------------------------------------
 
47
        mov     r2, #3                  @ Round down to nearest word boundary
 
48
        add     r1, r1, r2              @ Shouldn't be needed
 
49
        bics    r1, r1, r2              @ Clear 2 LSB (and set Z)
 
50
        bxeq    lr                      @ Quit if copy size is 0
 
51
 
 
52
        mov     r2, #0
 
53
ClrLoop:
 
54
        stmia   r0!, {r2}
 
55
        subs    r1, r1, #4
 
56
        bne     ClrLoop
 
57
        bx      lr
 
58
 
 
59
@---------------------------------------------------------------------------------
 
60
@ Copy memory if length != 0
 
61
@  r1 = Source Address
 
62
@  r2 = Dest Address
 
63
@  r4 = Dest Address + Length
 
64
@---------------------------------------------------------------------------------
 
65
CopyMemCheck:
 
66
@---------------------------------------------------------------------------------
 
67
        sub     r3, r4, r2              @ Is there any data to copy?
 
68
@---------------------------------------------------------------------------------
 
69
@ Copy memory
 
70
@  r1 = Source Address
 
71
@  r2 = Dest Address
 
72
@  r3 = Length
 
73
@---------------------------------------------------------------------------------
 
74
CopyMem:
 
75
@---------------------------------------------------------------------------------
 
76
        mov     r0, #3                  @ These commands are used in cases where
 
77
        add     r3, r3, r0              @ the length is not a multiple of 4,
 
78
        bics    r3, r3, r0              @ even though it should be.
 
79
        bxeq    lr                      @ Length is zero, so exit
 
80
CIDLoop:
 
81
        ldmia   r1!, {r0}
 
82
        stmia   r2!, {r0}
 
83
        subs    r3, r3, #4
 
84
        bne     CIDLoop
 
85
        bx      lr
 
86
 
 
87
@---------------------------------------------------------------------------------
 
88
        .align
 
89
        .pool
 
90
        .end
 
91
@---------------------------------------------------------------------------------