BASIC compiler/interpreter for PIC32MX/MZ-80K
修訂 | aa09df1005a8a6c4ae1be00d1229c4337c89a4cb (tree) |
---|---|
時間 | 2019-05-13 12:23:49 |
作者 | Katsumi <kmorimatsu@sour...> |
Commiter | Katsumi |
Revise comments in clib template.
@@ -36,7 +36,9 @@ const void* const clibdata[]={ | ||
36 | 36 | * This function will be called when initializing library, |
37 | 37 | * and used to exchange data between MachiKania BASIC and this library. |
38 | 38 | * This is only a function placed in .machikania_clib section for providing |
39 | - * static start address at 0xA0000100. | |
39 | + * static start address at 0xA0008000. When editing this function is required, | |
40 | + * the size of kseg2_program_mem and address of kseg0_program_mem | |
41 | + * in linker script must be changed. | |
40 | 42 | */ |
41 | 43 | void* CLIBINIT clib_init(void** data){ |
42 | 44 | // Store pointer to data |
@@ -4,12 +4,15 @@ | ||
4 | 4 | * * |
5 | 5 | ***********************************/ |
6 | 6 | |
7 | + | |
8 | +// Definition of data and program area. | |
9 | +// See also linker library. | |
10 | +// When expansion of data area size is required, edit following value | |
11 | +// as well as kseg1_data_mem in linker script. | |
7 | 12 | #define CLIB_PROGMRAM_MEM 0xA0008000 |
8 | 13 | #define CLIB_DATA_MEM_SIZE 0x0080 |
9 | 14 | #define CLIB_DATA_MEM (CLIB_PROGMRAM_MEM-CLIB_DATA_MEM_SIZE) |
10 | 15 | |
11 | - | |
12 | - | |
13 | 16 | // Global variables |
14 | 17 | // These must be defined by user |
15 | 18 | extern const void* const functions[]; |
@@ -26,9 +29,9 @@ void init(void); | ||
26 | 29 | malloc(int size); |
27 | 30 | calloc(int size); |
28 | 31 | */ |
29 | -extern void** g_data; | |
30 | 32 | #define malloc(x) clib_calloc(((x)+3)>>2,g_data) |
31 | 33 | #define calloc(x) clib_calloc(((x)+3)>>2,g_data) |
34 | +extern void** g_data; | |
32 | 35 | void* clib_calloc(int size, void** g_data); |
33 | 36 | |
34 | 37 | /* |
@@ -26,8 +26,6 @@ char* test_private(int param1){ | ||
26 | 26 | } |
27 | 27 | } |
28 | 28 | char* test_public(int param1){ |
29 | - void* test=malloc(16); | |
30 | - free(test); | |
31 | 29 | return test_private(param1); |
32 | 30 | } |
33 | 31 |
@@ -5,6 +5,7 @@ | ||
5 | 5 | <group> |
6 | 6 | <file>file:/C:/Users/kmorimatsu/Documents/At%20Home/PIC/PIC32/PIC32MX370F512H/clib/clib.X/clib.h</file> |
7 | 7 | <file>file:/C:/Users/kmorimatsu/Documents/At%20Home/PIC/PIC32/PIC32MX370F512H/clib/clib.X/clib.c</file> |
8 | + <file>file:/C:/Users/kmorimatsu/Documents/At%20Home/PIC/PIC32/PIC32MX370F512H/clib/clib.X/clib_p32MX370F512H.ld</file> | |
8 | 9 | <file>file:/C:/Users/kmorimatsu/Documents/At%20Home/PIC/PIC32/PIC32MX370F512H/clib/clib.X/example.c</file> |
9 | 10 | </group> |
10 | 11 | </open-files> |