* entry code fixed

git-svn-id: trunk@12615 -
This commit is contained in:
florian 2009-01-26 17:22:54 +00:00
parent 5f9b82d38b
commit 40b86f9fa8

View File

@ -1,3 +1,4 @@
{$goto on}
{******************************************************************************
lpc2114.h - Register defs for Philips LPC2114, LPC2124
@ -17,6 +18,7 @@ Created by Sten Larsson (sten_larsson at yahoo com)
Free Pascal conversion by the Free Pascal development team
******************************************************************************}
unit lpc21x4;
interface
@ -414,13 +416,24 @@ unit lpc21x4;
end;
procedure PASCALMAIN; external name 'PASCALMAIN';
procedure PASCALMAIN; external name 'PASCALMAIN';
begin
procedure _FPC_haltproc; assembler; nostackframe; public name '_haltproc';
asm
.Lhalt:
b .Lhalt
end;
procedure _FPC_start; assembler; nostackframe;
label
_start;
asm
// code derived from phillips appnote 10254
.init
ldr pc, .Lstart
.align 16
.globl _start
b _start
ldr pc, .LUndefined_Addr
ldr pc, .LSWI_Addr
ldr pc, .LPrefetch_Addr
@ -428,35 +441,35 @@ begin
// signature
nop
ldr pc, [PC, #-0xFF0] // load irq vector from vic
ldr pc, [pc, #-0xFF0] // load irq vector from vic
ldr pc, .LFIQ_Addr
.LUndefined_Addr:
.LUndefined_Addr:
ldr r0,.L1
ldr pc,[r0]
.LSWI_Addr:
.LSWI_Addr:
ldr r0,.L2
ldr pc,[r0]
.LPrefetch_Addr:
.LPrefetch_Addr:
ldr r0,.L3
ldr pc,[r0]
.LAbort_Addr:
.LAbort_Addr:
ldr r0,.L4
ldr pc,[r0]
.LFIQ_Addr:
.LFIQ_Addr:
ldr r0,.L5
ldr pc,[r0]
.L1:
.word Undefined_Handler
.L2:
.word SWI_Handler
.L3:
.word Prefetch_Handler
.L4:
.word Abort_Handler
.L5:
.word FIQ_Handler
.L1:
.long Undefined_Handler
.L2:
.long SWI_Handler
.L3:
.long Prefetch_Handler
.L4:
.long Abort_Handler
.L5:
.long FIQ_Handler
.Lstart:
_start:
(*
Set SP for Supervisor mode. Depending upon
the stack the application needs this value
@ -493,6 +506,9 @@ begin
msr cpsr_c, #0x13 // supervisor mode F,I enabled
bl PASCALMAIN
bl _FPC_haltproc
.LVBPDIV:
.long 0xE01FC100
.text
end;