- IAR Embedded Workbench for Arm 9.70.x
- IAR C/C++ 開発
- リンカ設定ファイル
- メモリおよび領域の定義
- define memoryディレクティブ
define memoryディレクティブ
このセクションの内容:
構文
define memory with size = expr;注記
For reasons of backward compatibility, it is also possible to specify a name for the defined memory like this: define memory [ name ] with size = expr[ ,unit-size];. unit-size is an optional parameter that specifies how many bits or bytes each unit contains.
パラメータ
| メモリ空間に含まれるユニット数を指定。これは常にアドレスゼロからカウントされます。 |
説明
define memoryディレクティブは、指定したサイズでメモリ空間を定義します。これは、アドレス可能メモリの最大サイズで、必ずしも物理的に使用できるサイズではありません。このディレクティブは、使用可能アドレスの制限をリンカ設定ファイルで設定します。通常のマイクロコントローラでは、1つのメモリ空間で十分ですが、 場合によっては、複数のメモリ空間が必要です。たとえば、ハーバードアーキテクチャでは、通常、コードとデータ用に1つずつ、2つの異なるメモリ空間が必要です。メモリが1つだけ定義されている場合、そのメモリ範囲はオプションです。unit-sizeが指定されていない場合、ユニットには8ビットが含まれます。
注記
This directive is optional and only relevant in 64-bit mode. It is recommended that you do not use it in 32-bit mode.
例
/* Declare a memory space of four Gigabytes */ define memory with size = 4G;