Create a procedure called dumpregisters

Assignment Help Custom Essay
Reference no: EM133393810

Question: One of the things missing from asmLib is the ability to display the values of all of the registers and the flags to the screen. In this assignment you are going to get a chance to do exactly that for me.

You are to create a procedure called dumpRegisters that will dump the contents of each register to the screen. This includes the flags register and each independent flag. The output of your dumpRegisters procedure should look like this:

EAX: 5afafc EBX: 9db000 ECX: 5ebdec EDX: 5ebdec
ESI: 5ebdec EDI: 5ebdec EBP: 5afab0 ESP: 5afaa8
EIP: 763afa29 EFL: 246 CF=0 SF=0 ZF=1 OF=0 AF=0 PF=1
C:\Users\gstev\source\repos\AsmProject\AsmProject\Debug\AsmProject.exe (process 3468) exited with code 0.
Press any key to close this window . . .

Notice the use of the tab macro?

On the surface this seems like an easy chore for the most part but you need to be careful how you save and restore the registers. Remember these registers should match what is shown in the registers window of the debugger.

Some Hopefully Helpful Things

You should have your dumpRegisters procedure call a procedure called showRegister. You want to pass the name of the register along with the value of the register to be displayed. I found that it was probably best to use invoke for this. My prototype looks like this:

showRegister PROTO,
regName:PTR BYTE , regValue:DWORD
Displaying each value of the flags register is probably the most difficult thing here. Because it is I am going to provide a macro that you can use to make the chore easier:

ShowFlag MACRO flagName,shiftCount
LOCAL flagStr, flagVal, L1

.data
flagStr DB " &flagName="
flagVal DB ?,0

.code
push eax
push edx

mov eax,eflags ; retrieve the flags
mov flagVal,'1'
shr eax,shiftCount ; shift into carry flag
jc L1
mov flagVal,'0'
L1:
mov edx,OFFSET flagStr ; display flag name and value
call WriteString

pop edx
pop eax
ENDM
To use this you can simply call showFlag, the flag to show and its bit position. Here is an example call

Reference no: EM133393810

Questions Cloud

What is wrong with maria philosophy : What is wrong with Maria's philosophy? How might this idea of overtraining contribute to negative health problems such as bulimia and anorexia?
What are the three characteristic of a market : What are the three characteristic of a market that is an oligopoly - what quantity would they choose (what market structure would they copy to maximize profit)
What is a joint tenancy in common with right of survivorship : What is a joint tenancy in common with right of survivorship? What are the requirements for one? Can you locate a case in which this was at issue
Examine the legal issue of smart contracts surrounding : Examine the legal issue of smart contracts surrounding the introduction of a local CBDC, particularly in the context of Singapore's real estate finance laws
Create a procedure called dumpregisters : create a procedure called dumpRegisters that will dump the contents of each register to the screen. This includes the flags register and each independent flag
Analyse the role of the leader and the importance of trust : Explore the critical nature of relationships between people in an organisation especially with regard to leaders and followers. Identify how leaders
Relation of power to culture and politics : relation of power to culture and politics, as well as your experience exploring the logic of press treatments of religion, in what you write
Types of sexual harassment : What are the two types of sexual harassment? Describe an example of each. As a manager, how do you ensure that your workplace is harassment free?
Discuss other aspects of music : Discussion on ancient music before we discuss other aspects of music.

Reviews

Write a Review

Custom Essay Questions & Answers

  Reread the given essay and rewrite it

Reread the given essay. -  and rewrite it. - The essay topic is : "Apple and the San Bernardino". - Apple Company, has to remained to be smartphones powerhouse with one of most loyal user based on history.

  Write essay for scholarship

Write essay for scholarship - Personal Community Service - Do volunteer service withing the public such as Nurse home, Picking up trash in the park, MLK march

  Essay on aqueous acid base equilibria

Write me an essay on Aqueous Acid - Base Equilibria, sighting what you feel that 'take-home' message is from this topic, AND applying one thing from the topic to something you know in 'real life.'  This is an extremely broad question and lots of answ..

  Analyze the relationship between nationalism and imperialism

What factors led to Europe's partition of Africa, and what effects did the subsequent occupation have on the lives of Africans

  Essay - how smoking is dangouers to our life

It is about smoking and how it is dangouers to our life. the eassy have to be about 3-3 and half pages I just need two resourse from good websites to support the idea in the essay.

  Develop a thesis statement that identifies the problem

Develop a thesis statement that identifies the problem and proposes a solution for reader - End your essay with a solid conclusion

  Write persuasive essay on diversity at the workplace

For this assignment, you must compose a persuasive essay by making a case on a controversial topic, problem, issue, or question. The chosen topic is "diversity at the workplace", the paper cannot be pro/con, but you need to take a position on a de..

  Why is an organised communication always more effective

Why is an organised communication always more effective than an unorganised one? Identify and discuss the advantages of organisation and planning in effective communication.

  Write the short story essay

Write the Short Story Essay.- Choose either "Hills Like White Elephants" or "A Rose for Emily" to analyze.- Reference and discuss one secondary source in this essay.

  Write a seven paragraph essay about the hunger games

Write a 7 paragraph essay 1000 words about the hunger games compare to todays word.Reality tv and the book etc.

  Art hide folder informationfolder m5 studio project

ltbrgthide folder information ltbrgtfolder ltbrgtm5 studio project dropboxoriginalitycheck enabled ltbrgtinstructions

  Propose the general communication strategies

Determine the main goals and objectives of your proposed communication plan. Predict the target group of your communication plan and Propose the general communication strategies.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd