mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-06 23:28:28 +02:00
+ AVR: initial support of the avrtiny architecture in the rtl
git-svn-id: trunk@43988 -
This commit is contained in:
parent
2d9cdab264
commit
28391e04bc
@ -18,6 +18,7 @@ function fpc_setjmp(var S : jmp_buf) : shortint;assembler;[Public, alias : 'FPC_
|
||||
asm
|
||||
mov r26,r24
|
||||
mov r27,r25
|
||||
{$ifndef CPUAVR_16_REGS}
|
||||
st x+,r1
|
||||
st x+,r2
|
||||
st x+,r3
|
||||
@ -33,8 +34,13 @@ function fpc_setjmp(var S : jmp_buf) : shortint;assembler;[Public, alias : 'FPC_
|
||||
st x+,r13
|
||||
st x+,r14
|
||||
st x+,r15
|
||||
{$endif CPUAVR_16_REGS}
|
||||
st x+,r16
|
||||
st x+,r17
|
||||
{$ifdef CPUAVR_16_REGS}
|
||||
st x+,r18
|
||||
st x+,r19
|
||||
{$endif CPUAVR_16_REGS}
|
||||
st x+,r28
|
||||
st x+,r29
|
||||
|
||||
@ -65,6 +71,7 @@ procedure fpc_longjmp(var S : jmp_buf;value : shortint);assembler;[Public, alias
|
||||
asm
|
||||
mov r26,r24
|
||||
mov r27,r25
|
||||
{$ifndef CPUAVR_16_REGS}
|
||||
ld r1,x+
|
||||
ld r2,x+
|
||||
ld r3,x+
|
||||
@ -80,8 +87,13 @@ procedure fpc_longjmp(var S : jmp_buf;value : shortint);assembler;[Public, alias
|
||||
ld r13,x+
|
||||
ld r14,x+
|
||||
ld r15,x+
|
||||
{$endif CPUAVR_16_REGS}
|
||||
ld r16,x+
|
||||
ld r17,x+
|
||||
{$ifdef CPUAVR_16_REGS}
|
||||
ld r18,x+
|
||||
ld r19,x+
|
||||
{$endif CPUAVR_16_REGS}
|
||||
ld r28,x+
|
||||
ld r29,x+
|
||||
|
||||
|
@ -16,7 +16,14 @@
|
||||
|
||||
type
|
||||
jmp_buf = packed record
|
||||
r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16,r17,r28,r29,splo,sphi,pclo,pchi : byte;
|
||||
{$ifndef CPUAVR_16_REGS}
|
||||
r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,
|
||||
{$endif CPUAVR_16_REGS}
|
||||
r16,r17,
|
||||
{$ifdef CPUAVR_16_REGS}
|
||||
r18,r19,
|
||||
{$endif CPUAVR_16_REGS}
|
||||
r28,r29,splo,sphi,pclo,pchi : byte;
|
||||
{$ifdef CPUAVR_3_BYTE_PC}
|
||||
pchighest : byte
|
||||
{$endif CPUAVR_3_BYTE_PC}
|
||||
|
@ -385,6 +385,10 @@ endif
|
||||
endif
|
||||
ifeq ($(ARCH),avr)
|
||||
CPU_SPECIFIC_COMMON_UNITS=intrinsics
|
||||
ifeq ($(SUBARCH),avrtiny)
|
||||
CPU_UNITS=attiny4 attiny5 attiny9 attiny10 attiny20 attiny40
|
||||
CPU_UNITS_DEFINED=1
|
||||
endif
|
||||
ifeq ($(SUBARCH),avr25)
|
||||
CPU_UNITS=attiny44a attiny26 attiny48 attiny10 attiny84a attiny2313 attiny461 attiny43u \
|
||||
attiny24a attiny88 attiny40 attiny861 attiny85 attiny20 attiny24 attiny9 \
|
||||
|
@ -101,6 +101,10 @@ endif
|
||||
|
||||
ifeq ($(ARCH),avr)
|
||||
CPU_SPECIFIC_COMMON_UNITS=intrinsics
|
||||
ifeq ($(SUBARCH),avrtiny)
|
||||
CPU_UNITS=attiny4 attiny5 attiny9 attiny10 attiny20 attiny40
|
||||
CPU_UNITS_DEFINED=1
|
||||
endif
|
||||
ifeq ($(SUBARCH),avr25)
|
||||
CPU_UNITS=attiny44a attiny26 attiny48 attiny10 attiny84a attiny2313 attiny461 attiny43u \
|
||||
attiny24a attiny88 attiny40 attiny861 attiny85 attiny20 attiny24 attiny9 \
|
||||
|
@ -1,5 +1,9 @@
|
||||
_start:
|
||||
{$ifdef CPUAVR_16_REGS}
|
||||
clr r17
|
||||
{$else CPUAVR_16_REGS}
|
||||
clr r1
|
||||
{$endif CPUAVR_16_REGS}
|
||||
|
||||
// load stack pointer
|
||||
ldi r30,lo8(_stack_top)
|
||||
@ -16,8 +20,13 @@
|
||||
|
||||
rjmp .LCopyDataLoopEntry
|
||||
.LCopyDataLoop:
|
||||
lpm r0, Z+
|
||||
st X+, r0
|
||||
{$ifdef CPUAVR_16_REGS}
|
||||
//!!!! FIXME? lpm r0, Z+
|
||||
//!!!! FIXME? st X+, r0
|
||||
{$else CPUAVR_16_REGS}
|
||||
lpm r16, Z+
|
||||
st X+, r16
|
||||
{$endif CPUAVR_16_REGS}
|
||||
|
||||
.LCopyDataLoopEntry:
|
||||
cpi XL, lo8(_edata)
|
||||
@ -35,7 +44,11 @@
|
||||
jmp .LZeroBssLoopEntry
|
||||
{$endif RELBRANCHES}
|
||||
.LZeroBssLoop:
|
||||
{$ifdef CPUAVR_16_REGS}
|
||||
st X+, r17
|
||||
{$else CPUAVR_16_REGS}
|
||||
st X+, r1
|
||||
{$endif CPUAVR_16_REGS}
|
||||
|
||||
.LZeroBssLoopEntry:
|
||||
cpi XL, lo8(_bss_end)
|
||||
|
Loading…
Reference in New Issue
Block a user