Actually i have taken TI application example code for meter reading which
is in assembly.
This assembly code is in old TI format and i am trying to convert it into
new format.
I found some errors on assembly directives.
I have following lines of code::
Could you tell me why i am getting this error even though the syntax is
correct?
Regards,
bharat
On 4/23/07, Anders Lindgren wrote:
> bharat wrote:
> >
> >
> > Thanks for your reply.
> > Actually i am writing the assembly code.
> > Can i use C-preprocessor directives in my assembly code.
> >
> > i am trying to do following thing
> >
> > xx EQU 00001h
> > yy EQU xx>>1
> >
> > Is this write??
>
> Hi bharat!
>
> Yes, you can use C preprocessor directives, like #defines, in assembler
> code.
>
> However, your example doesn't make sense -- if you explain what you
were
> trying to do then someone might be able to help you.
>
> -- Anders Lindgren, IAR Systems
> --
> Disclaimer: Opinions expressed in this posting are strictly my own and
> not necessarily those of my employer.
>
bharat wrote: > Thanks for your reply.
> Actually i am writing the assembly code.
> Can i use C-preprocessor directives in my assembly code.
>
> i am trying to do following thing
>
> xx EQU 00001h
> yy EQU xx>>1
>
> Is this write??
Hi bharat!
Yes, you can use C preprocessor directives, like #defines, in assembler
code.
However, your example doesn't make sense -- if you explain what you were
trying to do then someone might be able to help you.
-- Anders Lindgren, IAR Systems
--
Disclaimer: Opinions expressed in this posting are strictly my own and
not necessarily those of my employer.
Reply by bharat●April 23, 20072007-04-23
Thanks for your reply.
Actually i am writing the assembly code.
Can i use C-preprocessor directives in my assembly code.
i am trying to do following thing
xx EQU 00001h
yy EQU xx>>1
Is this write??
Regards,
bharat
On 19 Apr 2007 04:37:28 -0700, Anders Lindgren
wrote: >
> bharat wrote:
> >
> >
> > Thanks for your help.
> > It works for me .
> > I am writing the assembly code.
> > when i have the following lines
> >
> > ;----------------------
> > ; register substitution
> > ;----------------------
> > *irop2l SET R15
> > irop2m SET R14*
> >
> > i get the following error
> >
> > *Error[0]:Invalid syntax*
> >
> > Is anything worng in the above lines?
> > Could you please tell what the error is?
>
> I would suggest that you should read the manual and try to find good
> example to study.
>
> In this case, the "SET" directive is used to make one label equal
> another. Since "R14" are registers and not labels this does not work.
>
> My recommendation is to use the following:
>
> #define irop2l R15
> #define irop2m R14
>
> -- Anders Lindgren, IAR Systems
> --
> Disclaimer: Opinions expressed in this posting are strictly my own and
> not necessarily those of my employer.
>
--
Regards,
Bharat
Reply by Anders Lindgren●April 19, 20072007-04-19
bharat wrote: > Thanks for your help.
> It works for me .
> I am writing the assembly code.
> when i have the following lines
>
> ;----------------------
> ; register substitution
> ;----------------------
> *irop2l SET R15
> irop2m SET R14*
>
> i get the following error
>
> *Error[0]:Invalid syntax*
>
> Is anything worng in the above lines?
> Could you please tell what the error is?
I would suggest that you should read the manual and try to find good
example to study.
In this case, the "SET" directive is used to make one label equal
another. Since "R14" are registers and not labels this does not work.
My recommendation is to use the following:
#define irop2l R15
#define irop2m R14
-- Anders Lindgren, IAR Systems
--
Disclaimer: Opinions expressed in this posting are strictly my own and
not necessarily those of my employer.
Reply by bharat●April 19, 20072007-04-19
Thanks for your help.
It works for me .
I am writing the assembly code.
when i have the following lines
;-----
; register substitution
;-----
*irop2l SET R15
irop2m SET R14*
i get the following error
*Error[0]:Invalid syntax*
Is anything worng in the above lines?
Could you please tell what the error is?
Thanks in advance,
Regards,
bharat
On 19 Apr 2007 01:20:18 -0700, Anders Lindgren
wrote: >
> bharat wrote:
> >
> >
> > Hi,
> >
> > I am compiling the MSP430 assembly code.
> > I am using IAR workbench(IAR Assembler for MSP430 V3.30A/W32 (3.30.1.9))
> > I am using the msp430x112 controller.
> > When i try to compile the following code
> >
> > ;----------------------
> > ;word variables start here
> > ;----------------------
> > .bss v_measured_reading,2
> > .bss v_reference_reading,2
> > .bss i1_measured_reading,2
> > .bss i1_reference_reading,2
> > .bss i2_measured_reading,2
> >
> > it gives the following error
> > Error[40] bad instruction.
> >
> > Could any one tell what is wrong in those lines or am i missing any
> > includes?
>
> My guess it that you're using assembler files written for another
tool.
>
> I'm not sure what the .bss directive does, but if it reserves space
for
> a zero-initialized variable I suggest that you replace it with the
> following C code:
>
> int v_measured_reading, v_reference_reading, i1_measured_reading;
> int i1_reference_reading, i2_measured_reading;
>
> Or, if you really need to write in assembler:
>
> PUBLIC i1_measured_reading
> PUBLIC i1_reference_reading
> PUBLIC i2_measured_reading
> PUBLIC v_measured_reading
> PUBLIC v_reference_reading
>
> RSEG DATA16_Z:DATA:SORT:NOROOT(1)
> REQUIRE ?cstart_init_zero
> v_measured_reading:
> DS8 2
> v_reference_reading:
> DS8 2
> i1_measured_reading:
> DS8 2
> i1_reference_reading:
> DS8 2
> i2_measured_reading:
> DS8 2
>
> -- Anders Lindgren, IAR Systems
> --
> Disclaimer: Opinions expressed in this posting are strictly my own and
> not necessarily those of my employer.
>
--
Regards,
Bharat
Reply by Anders Lindgren●April 19, 20072007-04-19
bharat wrote: > Hi,
>
> I am compiling the MSP430 assembly code.
> I am using IAR workbench(IAR Assembler for MSP430 V3.30A/W32 (3.30.1.9))
> I am using the msp430x112 controller.
> When i try to compile the following code
>
> ;----------------------
> ;word variables start here
> ;----------------------
> .bss v_measured_reading,2
> .bss v_reference_reading,2
> .bss i1_measured_reading,2
> .bss i1_reference_reading,2
> .bss i2_measured_reading,2
>
> it gives the following error
> Error[40] bad instruction.
>
> Could any one tell what is wrong in those lines or am i missing any
> includes?
My guess it that you're using assembler files written for another tool.
I'm not sure what the .bss directive does, but if it reserves space for
a zero-initialized variable I suggest that you replace it with the
following C code:
int v_measured_reading, v_reference_reading, i1_measured_reading;
int i1_reference_reading, i2_measured_reading;
Or, if you really need to write in assembler:
PUBLIC i1_measured_reading
PUBLIC i1_reference_reading
PUBLIC i2_measured_reading
PUBLIC v_measured_reading
PUBLIC v_reference_reading
RSEG DATA16_Z:DATA:SORT:NOROOT(1)
REQUIRE ?cstart_init_zero
v_measured_reading:
DS8 2
v_reference_reading:
DS8 2
i1_measured_reading:
DS8 2
i1_reference_reading:
DS8 2
i2_measured_reading:
DS8 2
-- Anders Lindgren, IAR Systems
--
Disclaimer: Opinions expressed in this posting are strictly my own and
not necessarily those of my employer.
Reply by bharat●April 18, 20072007-04-18
Hi,
I am compiling the MSP430 assembly code.
I am using IAR workbench(IAR Assembler for MSP430 V3.30A/W32 (3.30.1.9))
I am using the msp430x112 controller.
When i try to compile the following code