mpc5554  c code to assembly code help

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

mpc5554  c code to assembly code help

3,229 次查看
juzi
Contributor I
 
 hello,
     i  need to  translate the following c code             
             SIU.PCR[189].R=0X0100;
into  assembly code,i do not  how to do it.
   the code is for mpc5554.can you help me? thanks.
 
标签 (1)
标记 (1)
0 项奖励
回复
2 回复数

1,706 次查看
lptttt
Contributor I
directly write the memory address
like this:not real code
 
lwz  r13,0X0100
lwz  r14,adress_of_SIU.PCR[189].R
stw  r13,0(r14)
0 项奖励
回复

1,706 次查看
CrasyCat
Specialist III
Hello
 
You can let CodeWarrior disassemble the generated code.
This is done in the following way:
  - Open your project in CodeWarrior
  - Open the Target settings dialog (press ALT + F7)
  - Switch to the "EPPC Disassembler" panel
  - Check "Show Source Code" check box.
  - Click OK to close the dialog.
  - Open the C source file, where you have the instruction in an edit window
  - Click with the right mouse button in the edit window
  - Select Disassemble. A new window is opened showing disassembly listing.
 
Scroll down until you see source code for your function and check the code
generated by the compiler here.
 
CrasyCat
0 项奖励
回复