应许工要求,三菱PWM文件反汇编器PMWCompiler可执行程序及源码
应许工要求,做了一个三菱文件到语句表的反汇编程序。请大家测试。
可执行程序:
点击此处下载 ourdev_437211.rar(文件大小:1.04M) (原文件名:PMWCompiler090417.rar)
源码:
点击此处下载 ourdev_437212.rar(文件大小:3.69M) (原文件名:PMWCompiler_src090417.rar)
开发环境VC2005 顶上去 居然有人在 哈哈 版主起的真早。
阿莫睡的真晚。
签定完毕。。。 有专家就好 看看去。 lz赞一个, 许工把关没的说 修改一下许工提出的一些问题
1. ANI 类指令后编译出错,见下图。
修改
2. 请给出目前支持的指令集,未支持的指令集在反编译过程中给出出错信息,便于用户查找原因。
见帖子:上面有的全有,没有的也没加。
http://www.ourdev.cn/bbs/bbs_content.jsp?bbs_sn=3252848&bbs_page_no=1&bbs_id=3041
3. END 指令未反编译。
增加了。
4. 输出文件中指令 和 软元件之间的空格需调整到上下对齐。
中间空格换做TAB 自动对齐
5. ourDEV.com 信息笔误,需修改为:ourDEV.cn
已经修改一直以为两个都可以呢 可执行程序ourdev_438324.rar(文件大小:1.04M) (原文件名:PMWCompiler090420.rar)
源码ourdev_438325.rar(文件大小:51K) (原文件名:PMWCompiler_src090420.rar) 顶一把! 【13楼】的可执行程序ourdev_438324.rar(文件大小:1.04M) (原文件名:PMWCompiler090420.rar)
也有问题的啊?
http://cache.amobbs.com/bbs_upload782111/files_17/ourdev_473181.jpg
(原文件名:Image00015.jpg) 请问哪儿能下到完善的版本?谢谢! 回复【楼主位】adolfshxq
-----------------------------------------------------------------------
楼主,看了你编写的工程代码(ourdev_438325.rar(文件大小:51K)),对照你给出的三菱PWM文件指令集发现你缺少了
关于LDI,OUT指令的转换。
今天特意在你的工程基础上添加了几行代码用来转换LDI,OUT指令。分享如下:
//by hebin 2011-3-1
//LDI指令区
else if(inst==0x34)//LD X(0~377)
{
str.Format(_T("LDI\tX%o"),inst);
InstList.AddTail(str);
}
else if (inst==0x35)//LD Y(0~377)
{
str.Format(_T("LDI\tY%o"),inst);
InstList.AddTail(str);
}
else if (inst<=0x3D&&inst>=0x38)//LD M(0~1535)
{
str.Format(_T("LDI\tM%u"),(inst-0x38)*0x100+inst);//?????????????
InstList.AddTail(str);
}
else if (inst<=0xAD&&inst>=0xA8)//LD M(1536~3071)
{
str.Format(_T("LDI\tM%u"),(inst-0xA8)*0x100+inst+0x600); //?????????????
InstList.AddTail(str);
}
else if (inst==0x3F)//LD M(8000~8255)
{
str.Format(_T("LDI\tM8%03u"),inst);
InstList.AddTail(str);
}
else if (inst<=0x33&&inst>=0x30)//LD S(000~999)
{
str.Format(_T("LDI\tS%u"),(inst-0x30)*0x100+inst);
InstList.AddTail(str);
}
else if (inst==0x36)//LD T(000~255)
{
str.Format(_T("LDI\tT%u"),inst);
InstList.AddTail(str);
}
else if (inst==0x3E)//LD C(000~255)
{
str.Format(_T("LDI\tC%u"),inst);
InstList.AddTail(str);
}
//**********************************************
//end LDI by hebin 2011-3-1
//by hebin 2011-3-11
//补充OUT 指令
else if (inst<=0xCD&&inst>=0xC8)//OUT M(0~1535)
{
str.Format(_T("OUT\tM%u"),(inst-0xC8)*0x100+inst);
InstList.AddTail(str);
}
else if (inst<=0xAD&&inst>=0xA8)//OUT M(1536~3071)
{
str.Format(_T("OUT\tM%u"),(inst-0xA8)*0x100+inst+0x600);
InstList.AddTail(str);
}
else if (inst==0x8F)//OUT M(8000~8255)
{
str.Format(_T("OUT\tM8%03u"),inst);
InstList.AddTail(str);
}
else if (inst<=0x83&&inst>=0x80)//OUT S(000~999)
{
str.Format(_T("OUT\tS%u"),(inst-0x80)*0x100+inst);
InstList.AddTail(str);
}
//end 3-11
我简单测试了一下,挺好用,大家一起学习下,看看还有什么错误没。
另外,我对代码中有语句看的不是很明白
str.Format(_T("LDI\tM%u"),(inst-0x38)*0x100+inst);
谁能给我解释一下,什么意思啊? Thanks for sharing! 支持楼主,学习一下
页:
[1]