include all files
This commit is contained in:
17
src/crt0.S
Normal file
17
src/crt0.S
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "avr128da28.h"
|
||||
|
||||
/* This section contains the executable code. */
|
||||
.section .text
|
||||
/* Entry-point as defined by the linker at address 0x00. */
|
||||
.global _start
|
||||
_start:
|
||||
ldi r16, hi8(RAMEND)
|
||||
out SPH, r16
|
||||
ldi r16, lo8(RAMEND)
|
||||
out SPL, r16
|
||||
|
||||
rcall main
|
||||
|
||||
.section .data /* Initialised data */
|
||||
.section .bss /* Uninitialised data*/
|
||||
.section .rodata /* Initialised read-only data */
|
||||
7
src/main.c
Normal file
7
src/main.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "types.h"
|
||||
|
||||
int main(void) __attribute__((noreturn));
|
||||
int main(void)
|
||||
{
|
||||
while (1);
|
||||
}
|
||||
47
src/types.h
Normal file
47
src/types.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
|
||||
typedef long long llong;
|
||||
|
||||
typedef unsigned char uchar;
|
||||
typedef unsigned short ushort;
|
||||
typedef unsigned int uint;
|
||||
typedef unsigned long ulong;
|
||||
typedef unsigned long long ullong;
|
||||
|
||||
typedef __INT8_TYPE__ i8;
|
||||
typedef __INT16_TYPE__ i16;
|
||||
typedef __INT32_TYPE__ i32;
|
||||
typedef __INT64_TYPE__ i64;
|
||||
typedef __UINT8_TYPE__ u8;
|
||||
typedef __UINT16_TYPE__ u16;
|
||||
typedef __UINT32_TYPE__ u32;
|
||||
typedef __UINT64_TYPE__ u64;
|
||||
|
||||
typedef __INTPTR_TYPE__ intptr;
|
||||
typedef __UINTPTR_TYPE__ uintptr;
|
||||
|
||||
#if __SIZEOF_SIZE_T__ == 8
|
||||
typedef i64 ssize;
|
||||
typedef u64 usize;
|
||||
#elif __SIZEOF_SIZE_T__ == 4
|
||||
typedef i32 ssize;
|
||||
typedef u32 usize;
|
||||
#elif __SIZEOF_SIZE_T__ == 2
|
||||
typedef i16 ssize;
|
||||
typedef u16 usize;
|
||||
#elif __SIZEOF_SIZE_T__ == 1
|
||||
typedef i8 ssize;
|
||||
typedef u8 usize;
|
||||
#else
|
||||
#error could not determine the appropriate type for usize and ssize
|
||||
#endif
|
||||
|
||||
#if __SIZEOF_FLOAT__ == 4
|
||||
typedef float f32;
|
||||
#endif
|
||||
|
||||
#if __SIZEOF_DOUBLE__ == 8
|
||||
typedef double f64;
|
||||
#elif __SIZEOF_LONG_DOUBLE__ == 8
|
||||
typedef long double f64;
|
||||
#endif
|
||||
Reference in New Issue
Block a user