The assembler directive DS can't take effect in IAR IDE

Thread Starter

zhangyong

Joined Mar 12, 2011
1
Hi, Who can help me?

I want to reserve memory space for 128 bytes (0x100) with the directive DS, but DS can't take efffect. my code likes the following:


ASEGN datas:IDATA,0x20
result DS 0x100
temp DB 0xFF,oxFF

the right result is that the two 0xFF should locate 0x11F of internal memory, but they locate 0x20, that is, the directive DS does not reserve any space, the space should be reserved still can be occupied!


why?
 
Last edited:

Papabravo

Joined Feb 24, 2006
21,225
For starters 0x100 is equal to 256, not 128. The size of the IDATA section is only 128 bytes. So in effect you said reserve twice as much space as the size of the section and then allocate two more bytes. It should have thrown an error, but I guess it gave you a pass an optimized away the allocation with no "purpose". RTFDS man!
 
Top