how to use WHILE directive

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to use WHILE directive

4,177 Views
jjl3
Contributor I
when I use WHILE(see below), the compiler always reports error.
I can't find an example program.
 
 
WHILE r1 <EQ> #0 
.
.
ENDW
 
or
 
WHILE r1 == #0 
.
.
ENDW
 
or
 
WHILE r1 
.
.
ENDW
Labels (1)
Tags (1)
0 Kudos
4 Replies

707 Views
jjl3
Contributor I
I use it in assembler source file, target is dsp56f801a60.
for example, I want to know how implement below statements in assembler language.
 
while(abc > 1)
{
...
}
0 Kudos

707 Views
CrasyCat
Specialist III
Hello
 
 I have created a sample project for DSP56F801_60MHz an I am able
 to assemble an assembly source file containing following code:
  .WHILE x:smileysad:r1)+ <EQ> #0 DO
     nop
 .ENDW
 This generates following code:
   move     X:smileysad:R1)+,A
   movei    #0,X0
   cmp      X0,A
   bne      *+3                   ; 0x000006
   nop     
   bra      *-5                   ; 0x000000
   rts      
Which from my prospective looks good.
Can you please check which Linker you have specified in the Target Settings Panel?
Did you specify M56800 Linker there?
This is the linker you should use for DSP56801.
 
I know that structured programming is not supported for DSP56800E Linker.
i.e. you cannot use structured assembler for Hawk II cores.
 
Also make sure you are not using the .WHILE directive in inline assembler. It is supported in macro assembler only.
 
I hope this helps.
 
Crasycat
0 Kudos

707 Views
jjl3
Contributor I
Thanks for your support!
I used it in inline assembler.
0 Kudos

707 Views
CrasyCat
Specialist III

Hello

Where are you trying to use the WHILE construct?
Are you trying to use that in a C source file, in an assembler source file, in a debugger command file?

Which processor are you targeting (HC08, HC12, Coldfire, ....)

CrasyCat

0 Kudos