473,883 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CPU simulator written in C

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.
Nov 14 '05
61 16333
In <40************ ***********@new s.xs4all.nl> Case <no@no.no> writes:
CBFalconer wrote:
Case wrote:
CBFalconer wrote:
Case wrote:
>Eric Sosman wrote:
... snip ...
>> Note that you must issue the occasional no-op when
>>using instructions of the first type, to give the singed
>>registe rs time to cool.
>
>You are talking about signed registers. I was talking about the

No, he's talking about singed registers.

Sure. Would you care to tell me what singed registers are?
(It takes pecial effort to deliberately type ng.)


I expect they are registers that have been exposed to sufficient
heat to singe them. For a definitive answer you will probably
have to ask whomever Eric Sosman was originally responding to.


He told me it was just a typo. And that he was wondering if this
was all, or that there might be something to learn from the well
repected Eric Sosman.


It was obvious for everybody except you that the well re[s]pected Eric
Sosman made a joke: look up the word "singe" in your English dictionary
and compare with Eric's reply.

If you don't want to be exposed to this kind of jokes, carefully
proofread your posts before using the Send command of your news client.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #51
Dan Pop wrote:
In <40************ ***********@new s.xs4all.nl> Case <no@no.no> writes:
He told me it was just a typo. And that he was wondering if this
was all, or that there might be something to learn from the well
repected Eric Sosman.
It was obvious for everybody except you that the well re[s]pected Eric
Sosman made a joke: look up the word "singe" in your English dictionary
and compare with Eric's reply.


Thanks Dan, I was unaware of the fact the singe is an English word.
However, from the start (as can be read in my first reply to Eric's
post) I was joke aware, but wondered if that was all.
If you don't want to be exposed to this kind of jokes, carefully
proofread your posts before using the Send command of your news client.


I don't mind much, and actually like this kind of jokes. I hope you
understood mine when I responded to you with:

'I didn't say what kind of int, so technically what you propose
is covered by my statement'

Where I referred to our endless and entertaining discussion about the
meaning of the word 'more' a few day ago. :-)

But yes, I bet I'd better better proofread my posts.

The difficult thing in understanding jokes on Usenet, is the lack of
all non-verbal information.

All the best,

Case

Nov 14 '05 #52


Richard Bos wrote:
/* frank */ <__*******@desp ammed.com> wrote:
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.


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?


I don't believe the requestor mentioned anything about learning as part of
the homework assignment.

Nov 14 '05 #53
if you would like to see a MIPS style simulator which contains all the
arhictectural features of modern microprocessors (5-stage pipeline,
branch prediction, separate instruction/data fetch units, etc etc.)
you may want to take a look at the SimpleScalar Toolset by Todd Austin
from the University of Michigan. Its written in C and is quite easy to
understand.

for my comp. arch project, i used it and hacked it to implement
different branch prediction schemes to see their performance. its
relatively easy to understand.

i think this will give you a good idea of how to write architectural
simulators in C.

good luck.

pallav
Nov 14 '05 #54


Dan Pop wrote:
In <40************ ***@yahoo.com> CBFalconer <cb********@yah oo.com> writes:
Dan Pop wrote:

... snip ...

Many of these people were vendors of such products. But, of
course, you know better than them...

^^^^
Aha! Finally caught in an English inaccuracy. They. :-)


If this is my first English inaccuracy you've caught in one of my posts,
you must be *really* reading them with your brain firmly set into Neutral.

Given that I've never even tried to learn the proper English grammar and
that I'm posting quite a lot, there *must* be several English mistakes in
my daily output... (without even mentioning typos and omitted words)


I think what he is saying that one mistake means that everything else you have
written is incorrect on some level.

Nov 14 '05 #55
On Fri, 25 Jun 2004, Case wrote:
Dan Pop wrote:
It was obvious for everybody except you that the well re[s]pected Eric
Sosman made a joke: look up the word "singe" in your English dictionary
and compare with Eric's reply.


Thanks Dan, I was unaware of the fact the singe is an English word.


OT remark: most c.l.c regulars have been singed by Dan Pop
during the period of 2001-2004.

Tak-Shing, eyewitness

Nov 14 '05 #56
kal
"osmium" <r1********@com cast.net> wrote in message news:<2j******* ******@uni-berlin.de>...
To simulate is to try to predict how fast some CPU design (probably unbuilt)
will be. To emulate is to produce the effect on computer B that a program
was run on computer A.


From The American Heritage Dictionary, second college edition, 1985.

emulate tr. v. 1. To strive to equal or excel, esp. through
imitation. 2. To compete with or rival successfully.
3. Computer Sci. To imitate one system with another so that
both accept the same data, execute the same programs and
achieve the same results.

simulate tr. v. 1. To have or take on the appearance, form,
or sound of; imitate. 2. To make a pretense of; feign.

Etymologically the proper word to use in this context is "simulate."
This is because "simulate" (from Latin similis) connotes likeness,
whereas "emulate" (from latin aemulus) connotes rivalry/competition.

However, as can be seen in the aforementioned dictionary entries,
in computer science the use of the word "emulate" to mean something
akin to "simulate" has been accepted for sometime now.

Note that the presence of entry (3) for "emulate" should not be
taken to mean that it is the accepted usage but rather the usage
is an exceptional case in the field of computer science.

That said, depending on the circumstances, even at present one or
the other of these words is preferred.
Nov 14 '05 #57
kal <k_*****@yahoo. com> wrote:

However, as can be seen in the aforementioned dictionary entries,
in computer science the use of the word "emulate" to mean something
akin to "simulate" has been accepted for sometime now.


The traditional distinction is that "simulation " is done entirely in
software whereas "emulation" is done with special-purpose hardware
(either with or without additional software).

-Larry Jones

Bad news, Mom. I promised my soul to the Devil this afternoon. -- Calvin
Nov 14 '05 #58
In <40************ ***********@new s.xs4all.nl> Case <no@no.no> writes:
I don't mind much, and actually like this kind of jokes. I hope you
understood mine when I responded to you with:

'I didn't say what kind of int, so technically what you propose
is covered by my statement'

Where I referred to our endless and entertaining discussion about the
meaning of the word 'more' a few day ago. :-)


It was a failed attempt at humour (yes, I recognised the parallel with
the other thread) due to the precise meaning of the word "int" in the
context of c.l.c.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #59
On 28 Jun 2004, Dan Pop wrote:
It was a failed attempt at humour (yes, I recognised the parallel with


Is anyone aware of /any/ successful attempts coming from
Dan Pop on c.l.c (that is, if there was any at all)?

Tak-Shing

Nov 14 '05 #60

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2314
by: Alex Vinokur | last post by:
C++ Simulator of a Universal Turing Machine can be downloaded at : * http://alexvn.freeservers.com/s1/utm.html * http://sourceforge.net/projects/turing-machine/ The program simulates a Universal Turing Machine (UTM). The UTM used in the Simulator is three-tape Turing Machine: * Tape#0 contains transition table and initial instantaneous description of a Particular Turing Machine (TM);
9
2638
by: Milk | last post by:
Hi all, Can anyone help me to do this Question. Coz this is my first time study C++ language and my lecture want me to do this kind of program, i really don't have any ideal pls help me here is the Question:: Improve the following (badly written) matrix multiplicationprogram and translate it into MIPs assembly language then assemble into machine language (hexadecimal representation). You may use a compiler to produce an assembly
26
5597
by: Wouter van Teijlingen | last post by:
Dear Readers, This is my first post to this group. I was pointed to this group in a other vb group, so i have better luck here! For my learning curve of VB .NET i want to make a traffic simulation program. Before i start programming, i need to know if there even is a possibility to make a algorithm in VB .NET that is able to let traffic drive and making the lights go green, orange or red.
0
1612
by: SatishPasala | last post by:
Hi I am developing a Windows Mobile application. I want Visual Studio to use Palm Simulator to display the application. Now it is pointing to Default Simulator. I downloaded the Palm Simulator. I need to add it to Visual Studio. Can some one help me to add the simulator?
0
1412
by: François | last post by:
Hi, My current job is to develop VoiceXML dialogs. The voice platform that we use provides neither a debugger nor a simulator, and each time I want to test a new dialog, I have to upload it on the remote production server, and to call the voice platform. So I would like to know where I can find a freeware VoiceXML simulator able to run a VoiceXML dialog. As my dialogs only use DTMF as an input, and text-to-speech synthesis for the...
1
4498
by: Ciko | last post by:
Was wondering how I could write a simple simulator (assembler CPU Z80). Thanks for any advice, link.
0
4086
by: Killingkids | last post by:
hello, everyone...im facing a big problem in my final year project, hope that u all can help me solve the problem ... i was doing a mobile web application which enable student to check the college information through mobile, however i just use simulator to test my system... one of modules or function was enable the student to downloads some notes which in txt file format through mobile.Hence, i tested using IE,it does not appear any problem, i...
0
1709
by: Killingkids | last post by:
hello, everyone...im facing a big problem in my final year project, hope that u all can help me solve the problem ... i was doing a mobile web application which enable student to check the college information through mobile, however i just use simulator to test my system... one of modules or function was enable the student to downloads some notes which in txt file format through mobile.Hence, i tested using IE,it does not appear any problem, i...
3
4748
by: DanielJohnson | last post by:
I was wondering if anyblody can suggest me a network simulator written in python in which I can add on my own code and extend its functionality. I am looking for a simulator which will simualte TCP, UDP, RTP and most networking protocol. The learning curve for ns2 and other simulator is too high for me at this time and thats why I am considering Python for it. Every help will be appreciated.
0
9932
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9777
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11109
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10728
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10833
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7959
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7114
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5782
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.