Initial import of xdadeveloper linexec sources
[linexec-j720] / asm / asm.asm
1 TTL C:\pocket\test\asm.cpp
2
3 AREA |.drectve|, DRECTVE
4 DCB "-defaultlib:coredll.lib "
5 DCB "-defaultlib:corelibc.lib "
6
7 EXPORT |?do_it@@YAXXZ| ; do_it
8 AREA |.pdata|, PDATA
9 |$T222| DCD |?do_it@@YAXXZ|
10 DCD 0x40000100
11 AREA |.text|, CODE
12 |?do_it@@YAXXZ| PROC ; do_it
13 |$M220|
14
15
16 mcr p15, 0, r0, c7, c5, 0 ;/* invalidate i cache & BTB */
17 mrc p15, 0, r0, c2, c0, 0
18 mov r0, r0
19 sub pc, pc, #4
20
21
22 ; turn off LCD controller...
23 ; I couldn't figure out how to use armasm.exe conditional with variables
24 ; #if xscale
25 ; ldr r9, =0x44000000
26 ; ldr r8, [r9]
27 ; orr r8, r8, #0x400
28 ; str r8, [r9]
29
30 ; #elif strongarm
31 ldr r9, =0xb0100000
32 ldr r8, [r9]
33 bic r8, r8, #1
34 str r8, [r9]
35
36 ; turn off unused serial ports
37
38 mov r8, #0
39 ldr r9, =0x80010000
40 str r8, [r9, #0xC]
41 ldr r9, =0x80050000
42 str r8, [r9, #0xC]
43
44 ; #endif
45
46 add r9, r1, #0x100
47
48 ; #if xscale
49 ; ldr r5, =0xa0000100
50 ; ldr r7, =0xa0400000
51
52 ; #elif strongarm
53 ldr r5, =0xc0000100
54 ldr r7, =0xc0400000
55 ; #endif
56
57
58 label ldr r8, [r9]
59 str r8, [r5]
60 add r9, r9, #4
61 add r5, r5, #4
62 cmp r5, r7
63 blt label
64
65 ; #if xscale
66 ; MOV r4, #0xA0000000
67
68 ; #elif strongarm
69 MOV r4, #0xc0000000
70 ; #endif
71
72 add r11,r4,#0x8000
73
74 mov r10,r2 ;machine number passed from DRAMloader
75
76 mcr p15, 0, r0, c8, c7, 0x00 ;/* invalidate I+D TLB */
77 mrc p15, 0, r0, c2, c0, 0
78 mov r0, r0
79 sub pc, pc, #4
80
81 ; they skipped this, unnecessary? seems like we need to do this
82
83 mcr p15, 0, r0, c7, c5, 0 ;/* invalidate i cache & BTB */
84
85 mov r0, #0
86 mcr p15, 0, r0, c13, c0, 0
87 mrc p15, 0, r0, c2, c0, 0
88 mov r0, r0
89 sub pc, pc, #4
90
91 mov r0, #0
92 mov r1, r10
93 ldr r2, [r2, #0]
94 mov r2, #0
95
96 ; Jump into the kernel:
97 mov pc, r11
98
99
100 |$M221|
101 ENDP ; |?do_it@@YAXXZ|, do_it
102 END
103
Impressum, Datenschutz