* fix compilation of atmega128 startup code, not working yet

git-svn-id: trunk@18006 -
This commit is contained in:
florian 2011-07-17 08:54:24 +00:00
parent 840b158eb8
commit ac17ee8acb
2 changed files with 11 additions and 8 deletions

View File

@ -6,9 +6,13 @@ Register definitions and startup code for ATMEL ATmega128
unit atmega128;
{$goto on}
{$macro on}
interface
{$define DOCALL:=call}
{$define DOJMP:=jmp}
implementation
procedure PASCALMAIN; external name 'PASCALMAIN';
@ -17,7 +21,7 @@ unit atmega128;
asm
cli
.Lhalt:
xjmp .Lhalt
jmp .Lhalt
end;
var
@ -36,7 +40,7 @@ unit atmega128;
.init
.align 16
.globl _start
b _start
{ b _start
b .LUndefined_Addr // Undefined Instruction vector
b .LSWI_Addr // Software Interrupt vector
b .LPrefetch_Addr // Prefetch abort vector
@ -63,7 +67,6 @@ unit atmega128;
.LFIQ_Addr:
ldr r0,.L5
ldr pc,[r0]
.L1:
.long Undefined_Handler
.L2:
@ -76,7 +79,7 @@ unit atmega128;
.long IRQ_Handler
.L6:
.long FIQ_Handler
}
{
all ATMEL MCUs use the same startup code, the details are
governed by defines

View File

@ -1,13 +1,12 @@
_start:
clr r1
{
// load stack pointer
ldi r0,lo8(_stack_top)
out 0x3d,r0
ldi r0,hi8(_stack_top)
out 0x3e,r0
// copy initialized data from flash to ram
ldr r1,.L_etext
ldr r2,.L_data
@ -26,8 +25,9 @@
cmp r1,r2
strls r0,[r1],#4
bls .Lzeroloop
}
xcall PASCALMAIN
xcall _FPC_haltproc
call PASCALMAIN
call _FPC_haltproc
.text