Question: There are several errors in this code, please avoid using . 3 6 0 / . model / . stack Build started at 9 :
There are several errors in this code, please avoid using modelstack
Build started at : PM
Build started: Project: AsmProject, Configuration: Debug Win
Assembling main.asm...
asmLib.inc: warning A: multiple MODEL directives found : MODEL ignored
main.asm: error A: too many arguments to INVOKE
main.asm: error A: undefined symbol : GetKey
main.asm: error A: undefined symbol : StrLen
main.asm: error A: too many arguments to INVOKE
main.asm: error A: undefined symbol : WriteDec
main.asm: error A: too many arguments to INVOKE
main.asm: error A: undefined symbol : StrLen
main.asm: error A: too many arguments to INVOKE
main.asm: error A: undefined symbol : WriteDec
main.asm: error A: too many arguments to INVOKE
main.asm: error A: undefined symbol : StrLen
main.asm: error A: too many arguments to INVOKE
main.asm: error A: undefined symbol : WriteDec
main.asm: error A: too many arguments to INVOKE
main.asm: error A: undefined symbol : StrLen
main.asm: error A: too many arguments to INVOKE
main.asm: error A: undefined symbol : WriteDec
main.asm: error A: too many arguments to INVOKE
main.asm: error A: undefined symbol : StrLen
main.asm: error A: too many arguments to INVOKE
main.asm: error A: undefined symbol : WriteDec
main.asm: error A: too many arguments to INVOKE
main.asm: error A: undefined symbol : StrLen
main.asm: error A: too many arguments to INVOKE
main.asm: error A: undefined symbol : WriteDec
main.asm: error A: too many arguments to INVOKE
main.asm: error A: too many arguments to INVOKE
main.asm: error A: too many arguments to INVOKE
main.asm: error A: too many arguments to INVOKE
main.asm: error A: too many arguments to INVOKE
main.asm: error A: undefined symbol :
main.asm: error A: undefined symbol :
main.asm: error A: undefined symbol :
main.asm: error A: undefined symbol : A
main.asm: error A: undefined symbol : D
main.asm: error A: undefined symbol :
main.asm: warning A: procedure argument or local not referenced : regName
main.asm: warning A: procedure argument or local not referenced : regValue
C:Program FilesMicrosoft Visual StudioCommunityMSBuildMicrosoftVCvBuildCustomizationsmasmtargets: error MSB: The command mlexe c nologo Zi FoDebugmainobj" WerrorReport:prompt Tamainasm" exited with code
Done building project "AsmProject.vcxproj" FAILED.
Build: succeeded, failed, uptodate, skipped
Build completed at : PM and took seconds
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, Ldata flagStr BYTE" &flagName flagVal BYTE?,code push eax push edx mov eax,eflags ; retrieve the flags mov flagVal, shr eax,shiftCount ; shift into carry flag jc L mov flagVal, L: 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. You also need to define eflags which is a DWORD variable and should be located in the data segment of main. Here is an example call
ShowFlag CF
This shows the carry flag at bit and
ShowFlag ZF
shows the zero flag at bit
The esp, ip and flags register will take a little bit of thought so you should be prepared to discuss this in the discussion board for this unit.
You can use global variables here as needed but you really must pass parameters to the showRegister procedure. Ideally we would create this as its own module but for now I am OK with things simply being in the main.asm file
dumpRegs should be a selfcontained function. This means that in main you should only have the call to dumpRegs and the exit macro.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
