내 어셈블리가 너무 복잡한 이유는?

기술노트 28162

아키텍처:

ARM, RH850, RISC-V, RL78, RX, SH, STM8

컴포넌트:

assembler

업데이트:

2018-02-28 오전 1:44

Introduction

This Technical Note discusses a situation that occurs when writing an assembly statement that is too complex. This situation most often occurs when migrating from IAR Embedded Workbench for ARM version 4.x to version 5.x and newer.

The diagnostic

Error[109]: Expression is too complex

.. will be generated for assembler instructions that are to complex.

Please Note that the error message might point to the wrong line. That is, the unsupported expression can be on a line above the line to which the error message points.

Search

Double-click on the error message to see which instruction that generated your error. And search from that line and upwards. The offending instruction need to be rewritten.

Details

It is not possible to have two symbols in one expression, if these two symbols are solved at link-time.

If the symbols in the expression are solved at assembly-time then the expression is not "to complex".

The most complex allowed expression is: 
"An expression with 1 symbol and 1 fixed value".

Example

The following source gives the impression of "An expression with 2 symbols".

Stack_Size     EQU   0x00000800   ;; fixed value
Stack_Mem DS8 Stack_Size
Heap_Size EQU 0x00001000 ;; fixed value
Heap_Mem DS8 Heap_Size

set_up
LDR R0, = Heap_Mem
LDR R1, = (Stack_Mem + Stack_Size)
LDR R2, = (Heap_Mem + Heap_Size)
LDR R3, = Stack_Mem

The Stack_Size and Heap_Size are resolved at assembly-time, that is, replaced with fixed values. Thus, at link-time, the expressions looks like:

               LDR    R0, = Heap_Mem
LDR R1, = (Stack_Mem + 0x00000800)
LDR R2, = (Heap_Mem + 0x00001000)
LDR R3, = Stack_Mem

 

All product names are trademarks or registered trademarks of their respective owners.

죄송하지만, 당사 사이트에서는 Internet Explorer를 지원하지 않습니다.보다 편안한 사이트를 위해 Chrome, Edge, Firefox 등과 같은 최신 브라우저를 사용해 주시길 부탁드립니다.