<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 15, 2009, at 7:12 PM, <a href="mailto:Vasudev.Negi@microchip.com">Vasudev.Negi@microchip.com</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div lang="EN-US" link="blue" vlink="purple"><div class="Section1"><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "> I am assuming address space 1 for variables in ROM. Now if I want a pointer to contain the address the this variable then how do I declare it? In other words I want to declare rom int *ptr.<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p> </o:p></span></font></div></div></div></span></blockquote>Something like this works for me:</div><div><br></div><div><div>#define rom __attribute__((address_space(1))) </div><div>rom int *ptr;</div><div><br></div><div><div>$ clang rom.c -emit-llvm -o -</div><div>; ModuleID = 'rom.c'</div><div>target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"</div><div>target triple = "i386-apple-darwin9"</div><div>@ptr = common global i32 addrspace(1)* null, align 4<span class="Apple-tab-span" style="white-space:pre">    </span></div><div><br></div><div>-Chris</div></div></div></body></html>