Carl Norman

Using __SEG_START_  in .asm to address memory allocated in a PRM file

Discussion created by Carl Norman on Sep 25, 2007
Latest reply on Sep 28, 2007 by bigmac
Hi,

This is probably somthing simple, but have been having troubles finding where in the help files this is explained. (Also, I have this setup working fine in C, but for some reason cannot get it working in asm). (Note, this is just an example to show my problem, not what im actually doing)

These two lines were added to the PRM in the correct areas:
added "PhoneNumbers"
;*------------------------------------------------------------------------------------------
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
    PAGEflash_PhoneNumbers =  READ_ONLY    0x8000 TO 0x81FF;
END

PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */
    PhoneNumbers                            INTO  PAGEflash_PhoneNumbers;
END
;*------------------------------------------------------------------------------------------


This is in another file added the data for PhoneNumbers:
;*------------------------------------------------------------------------------------------
PhoneNumbers: SECTION

;Factory default phone numbers
           
def_phone1      dc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
def_phone2      dc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
def_phone3      dc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
def_phone4      dc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
def_phone5      dc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
def_pin         dc '000000',0,0,0,0,0,0,0,0,0,0
def_start_msg   dc 'Watchguard Alarms  ',0
;*------------------------------------------------------------------------------------------

In main.asm added
;*------------------------------------------------------------------------------------------
ldhx   PhoneNumbers
;do somthing
ldhx  (PhoneNumbers+$10)
;do somthing else
;*------------------------------------------------------------------------------------------
Both of these lines cause " A1414: Cannot set fixup to constant "
I have tried many things, XDEF, __seg_start etc, things that work in C dont work in asm... Can someone please point me to a solution as to how to address somthing defined in the PRM... Is there a reason

(note, in C "__SEG_START_PhoneNumbers" works fine)


Thanks,
Carl

Outcomes