In assembly language, You are to create a procedure called dumpRegisters that will dump the contents of each register to
Posted: Fri May 20, 2022 4:48 pm
In assembly language,
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 like this:
Notice the tab macro?
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:
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:
To use this you can simply call showFlag, the flag to show and
its bit position. Here is an example call
ShowFlag CF,1
This shows the carry flag at bit 1
Registers EAX = OOBEFB30 EBX = OOC92000 ECX = 00296CB1 EDX = 00296CB1 ESI = 00296CB1 EDI = 00296CB1 EIP = 0029DA5B ESP = OOBEFADC EBP = OOBEFAE8 EFL = 00000246 C:\Users\sagea\OneDrive\Desktop\Homework\ASM Homework\Final Exam AsmProject\Debug\AsmProject.exe EAX: befb30 EBX: C92000 ECX: 296cb1 EDX: 296cb1 ESI: 296cb1 EDI: 296cb1 EBP: befae8 ESP: befadc
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 like this:
Notice the tab macro?
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:
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:
To use this you can simply call showFlag, the flag to show and
its bit position. Here is an example call
ShowFlag CF,1
This shows the carry flag at bit 1
Registers EAX = OOBEFB30 EBX = OOC92000 ECX = 00296CB1 EDX = 00296CB1 ESI = 00296CB1 EDI = 00296CB1 EIP = 0029DA5B ESP = OOBEFADC EBP = OOBEFAE8 EFL = 00000246 C:\Users\sagea\OneDrive\Desktop\Homework\ASM Homework\Final Exam AsmProject\Debug\AsmProject.exe EAX: befb30 EBX: C92000 ECX: 296cb1 EDX: 296cb1 ESI: 296cb1 EDI: 296cb1 EBP: befae8 ESP: befadc