用C语言编写的CPU模拟器 [英] CPU simulator written in C

查看:1033
本文介绍了用C语言编写的CPU模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须做一个功课:使用C语言制作一个CPU模拟器。


我有一套asm指令所以我必须写一个程序

应该:

- 加载.asm文件

- 查看.asm文件

- 一步一步模拟

- 显示寄存器内容


我试图搜索谷歌没有成功。


任何帮助(链接,技巧/提示) ...)

非常感谢。


提前致谢。

I have to do a homework: make a CPU simulator using C language.

I have a set of asm instructions so I have to write a program
that should:
- load .asm file
- view .asm file
- do a step by step simulation
- display registers contents

I tried to search con google with no success.

Any help (links, tricks/tips...)
would be really appreciated.

Thanks in advance.

推荐答案

在''comp.lang.c'',/ * frank * /< __ ******* @ despammed.com>写道:
In ''comp.lang.c'', /* frank */ <__*******@despammed.com> wrote:
我必须做一个功课:使用C语言制作CPU模拟器。

我有一套asm指令所以我必须写一个程序
应该:
- 加载.asm文件
- 查看.asm文件
- 一步一步模拟
- 显示寄存器内容


这是一个设计问题。这没有特别的问题。这只是

另一位翻译。

我试图搜索谷歌没有成功。
I have to do a homework: make a CPU simulator using C language.

I have a set of asm instructions so I have to write a program
that should:
- load .asm file
- view .asm file
- do a step by step simulation
- display registers contents
It''s a design question. There is no particular problem with that. It''s just
another interpreter.
I tried to search con google with no success.




最好挖掘你的大脑。答案就在那里。


BTW,您对C语言有什么疑问?


-

-ed-在这里收到我的电子邮件: http://marreduspam.com/ad672570

C语言常见问题解答: http ://www.eskimo.com/~scs/C-faq/top.html

C-reference: http://www.dinkumware.com/manuals/reader.aspx?lib=c99

FAQ de fclc: http://www.isty- info.uvsq.fr/~rumeau/fclc/



Better to dig your brain. The answer is there.

BTW, what is your question about the C-language?

--
-ed- get my email here: http://marreduspam.com/ad672570
The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
C-reference: http://www.dinkumware.com/manuals/reader.aspx?lib=c99
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/


/ * frank * /< __ ******* @ despammed.com>写道:
/* frank */ <__*******@despammed.com> wrote:
我必须做一个功课:使用C语言制作CPU模拟器。

我有一套asm指令所以我必须写一个程序
应该:
- 加载.asm文件
- 查看.asm文件
- 一步一步模拟
- 显示寄存器内容
<我试图搜索谷歌没有成功。
I have to do a homework: make a CPU simulator using C language.

I have a set of asm instructions so I have to write a program
that should:
- load .asm file
- view .asm file
- do a step by step simulation
- display registers contents

I tried to search con google with no success.




您的作业说:_制作一个CPU模拟器。不是复制CPU

模拟器。这是有充分理由的。如果你只是交给别人的工作,你怎么期望

学到什么?


Richard



Your assignment said: "_make_ a CPU simulator". Not "copy a CPU
simulator". There is a very good reason for this. How do you expect to
learn anything if you just hand in someone else''s work?

Richard


/ * frank * /写道:
/* frank */ wrote:
我必须做一个功课:用C语言制作一个CPU模拟器。

我有一套asm指令所以我必须写一个程序
应该:
- 加载.asm文件
- 查看.asm文件
- 一步一步模拟
- 显示寄存器内容

我试图搜索谷歌没有成功。

任何帮助(链接,技巧/提示......)
将非常感激。
I have to do a homework: make a CPU simulator using C language.

I have a set of asm instructions so I have to write a program
that should:
- load .asm file
- view .asm file
- do a step by step simulation
- display registers contents

I tried to search con google with no success.

Any help (links, tricks/tips...)
would be really appreciated.




关键的想法是在C结构上映射CPU的所有部分

和例程。例如:程序计数器(PC)可以将
简单地映射到int变量。现在你应该为寄存器创建

映射,......这并不复杂。


HTH


案例



The key idea is to map all parts of a CPU on C structures
and routines. For example: the program counter (PC) can
be simply mapped to an int variable. Now you should create
mappings for registers, .... It''s not that complicated.

HTH

Case


这篇关于用C语言编写的CPU模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆