Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This code first clears the screen at line 12, by making a call to Irvine's library function Clrscr. Then it makes another call to DumpRegs

image text in transcribed

This code first clears the screen at line 12, by making a call to Irvine's library function Clrscr. Then it makes another call to DumpRegs in line 13. At this point, it will dump the registers on the console. Their content will be whatever value happens to be in that moment.

Line 14 introduces a new instruction to you, which is mov. It "moves" meaning updates the content of al segment with a hex value 22h which is a byte. (The meaning of al is in your textbook). Then the program calls again DumpRegs. The EAX register is updated in the lest significant byte. Insert a comment here in your code and explain why the EAX register shows 22h in the last byte, when you updated the al register segment. Make sure you also explain why the rest of the bytes in EAX are unaffected.

Line 16 does the same, only that it updates the ax segment. When DumpRegs is called, you will see EAX with a certain value. Explain in your code, in a comment, why EAX shows that value. Make sure you explain why the upper two bytes of EAX are not affected.

In line 18, we move 33h hex value, this time into ah. Explain the result in a comment in your code.

In line 20, we move 4444h hex value, this time into eax. Explain the result in a comment in your code. Make sure you explain why the upper two bytes of EAX were cleared although the program updated just the last two bytes.

Build and run your program. Your console should look like in the following figure. I highlighted the EAX results.

image text in transcribed

10 .code 11 main PROC 12 13 14 15 16 17 18 19 20 21 1 call Clrscr call DumpRegs mov al, 22h call DumpRegs mov ax, 2222h call DumpRegs mov ah, 33h call DumpRegs mov eax, 4444h call DumpRegs 23 24 main ENDP 25 26 END main exit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions