mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-22 09:49:28 +02:00
+ avrsim controller target requiring a special avr simulator with a certain memory location handling, see avrsim.pp controller helper unit for what it is needed
git-svn-id: trunk@30385 -
This commit is contained in:
parent
9ae76c3246
commit
dfd4d3656b
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8206,6 +8206,7 @@ rtl/embedded/arm/stm32f10x_md.pp svneol=native#text/pascal
|
|||||||
rtl/embedded/arm/stm32f10x_xl.pp svneol=native#text/pascal
|
rtl/embedded/arm/stm32f10x_xl.pp svneol=native#text/pascal
|
||||||
rtl/embedded/arm/xmc4500.pp svneol=native#text/pascal
|
rtl/embedded/arm/xmc4500.pp svneol=native#text/pascal
|
||||||
rtl/embedded/avr/atmega128.pp svneol=native#text/plain
|
rtl/embedded/avr/atmega128.pp svneol=native#text/plain
|
||||||
|
rtl/embedded/avr/avrsim.pp svneol=native#text/plain
|
||||||
rtl/embedded/avr/start.inc svneol=native#text/plain
|
rtl/embedded/avr/start.inc svneol=native#text/plain
|
||||||
rtl/embedded/buildrtl.lpi svneol=native#text/plain
|
rtl/embedded/buildrtl.lpi svneol=native#text/plain
|
||||||
rtl/embedded/buildrtl.pp svneol=native#text/plain
|
rtl/embedded/buildrtl.pp svneol=native#text/plain
|
||||||
|
@ -56,6 +56,8 @@ Type
|
|||||||
tcontrollertype =
|
tcontrollertype =
|
||||||
(ct_none,
|
(ct_none,
|
||||||
|
|
||||||
|
ct_avrsim,
|
||||||
|
|
||||||
ct_atmega16,
|
ct_atmega16,
|
||||||
ct_atmega32,
|
ct_atmega32,
|
||||||
ct_atmega48,
|
ct_atmega48,
|
||||||
@ -120,6 +122,16 @@ Const
|
|||||||
eeprombase:0;
|
eeprombase:0;
|
||||||
eepromsize:0
|
eepromsize:0
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
controllertypestr:'AVRSIM';
|
||||||
|
controllerunitstr:'AVRSIM';
|
||||||
|
flashbase:0;
|
||||||
|
flashsize:$20000;
|
||||||
|
srambase:0;
|
||||||
|
sramsize:4096;
|
||||||
|
eeprombase:0;
|
||||||
|
eepromsize:4096;
|
||||||
|
),
|
||||||
(
|
(
|
||||||
controllertypestr:'ATMEGA16';
|
controllertypestr:'ATMEGA16';
|
||||||
controllerunitstr:'ATMEGA16';
|
controllerunitstr:'ATMEGA16';
|
||||||
|
@ -369,7 +369,7 @@ CPU_UNITS=allwinner_a20
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),avr)
|
ifeq ($(ARCH),avr)
|
||||||
CPU_UNITS=atmega128
|
CPU_UNITS=atmega128 avrsim
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),i386)
|
ifeq ($(ARCH),i386)
|
||||||
CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts
|
CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts
|
||||||
|
@ -84,7 +84,7 @@ endif
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),avr)
|
ifeq ($(ARCH),avr)
|
||||||
CPU_UNITS=atmega128
|
CPU_UNITS=atmega128 avrsim
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),i386)
|
ifeq ($(ARCH),i386)
|
||||||
|
57
rtl/embedded/avr/avrsim.pp
Normal file
57
rtl/embedded/avr/avrsim.pp
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
{******************************************************************************
|
||||||
|
Startup code for an avr simulator
|
||||||
|
|
||||||
|
******************************************************************************}
|
||||||
|
unit avrsim;
|
||||||
|
|
||||||
|
{$goto on}
|
||||||
|
{$macro on}
|
||||||
|
|
||||||
|
interface
|
||||||
|
var
|
||||||
|
OUTPUTREG : byte absolute $20;
|
||||||
|
EXITCODEREG : byte absolute $21;
|
||||||
|
HALTREQUEST : byte absolute $22;
|
||||||
|
|
||||||
|
{$define DOCALL:=call}
|
||||||
|
{$define DOJMP:=jmp}
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
procedure PASCALMAIN; external name 'PASCALMAIN';
|
||||||
|
|
||||||
|
procedure _FPC_haltproc(exitcode : longint); public name '_haltproc'; noreturn;
|
||||||
|
|
||||||
|
begin
|
||||||
|
EXITCODEREG:=exitcode;
|
||||||
|
HALTREQUEST:=1;
|
||||||
|
{ really stop }
|
||||||
|
while true do
|
||||||
|
;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
_data: record end; external name '__data_start';
|
||||||
|
_edata: record end; external name '__data_end';
|
||||||
|
_etext: record end; external name '_etext';
|
||||||
|
_bss_start: record end; external name '__bss_start';
|
||||||
|
_bss_end: record end; external name '__bss_end';
|
||||||
|
_stack_top: record end; external name '_stack_top';
|
||||||
|
|
||||||
|
procedure _FPC_start; assembler; nostackframe;
|
||||||
|
label
|
||||||
|
_start;
|
||||||
|
asm
|
||||||
|
.init
|
||||||
|
.globl _start
|
||||||
|
jmp _start
|
||||||
|
|
||||||
|
{
|
||||||
|
all ATMEL MCUs use the same startup code, the details are
|
||||||
|
governed by defines
|
||||||
|
}
|
||||||
|
{$i start.inc}
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user