【发布时间】:2013-05-02 17:18:40
【问题描述】:
我有一个用 c++ 编写的现有程序,用于计算字数。我将如何将其转换为程序集以在 68000 处理器之类的设备上运行?我应该从哪里开始?
int _tmain(int argc, _TCHAR* argv[])
{
int i=0;
int words=0;
bool last_space=true;
while( test_string[i]!=0)
{
if(!last_space && test_string[i]==' ')//end of word - space preceded by not space must handle multi spaces
words=words+1;
if (test_string[i]==' ')
last_space=true;
else
last_space=false;
i++;
}
return 0;
}
【问题讨论】:
-
用68000编译器编译,看看它的汇编输出“-S”
-
我会首先通过编译器运行它并查看它...
-
你应该从学习68000处理器的组装开始。
-
大约 20 年前,我可以在 6 品脱啤酒后用一只手绑在背后来做到这一点。不幸的是,自 1996 年左右以来,我一次都没碰过 68K 汇编程序,所以它从缓存中掉了下来……
-
@mats,这正是我的想法。 :)