how to use WHILE directive

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

how to use WHILE directive

4,209 次查看
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
标签 (1)
标记 (1)
0 项奖励
4 回复数

739 次查看
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 项奖励

739 次查看
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 项奖励

739 次查看
jjl3
Contributor I
Thanks for your support!
I used it in inline assembler.
0 项奖励

739 次查看
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 项奖励