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 .360/.model/.stack
Build started at 9:28 PM...
1>------ Build started: Project: AsmProject, Configuration: Debug Win32------
1>Assembling main.asm...
1>asmLib.inc(2): warning A4011: multiple .MODEL directives found : .MODEL ignored
1>main.asm(47): error A2136: too many arguments to INVOKE
1>main.asm(48): error A2006: undefined symbol : GetKey
1>main.asm(76): error A2006: undefined symbol : StrLen
1>main.asm(76): error A2136: too many arguments to INVOKE
1>main.asm(76): error A2006: undefined symbol : WriteDec
1>main.asm(76): error A2136: too many arguments to INVOKE
1>main.asm(77): error A2006: undefined symbol : StrLen
1>main.asm(77): error A2136: too many arguments to INVOKE
1>main.asm(77): error A2006: undefined symbol : WriteDec
1>main.asm(77): error A2136: too many arguments to INVOKE
1>main.asm(78): error A2006: undefined symbol : StrLen
1>main.asm(78): error A2136: too many arguments to INVOKE
1>main.asm(78): error A2006: undefined symbol : WriteDec
1>main.asm(78): error A2136: too many arguments to INVOKE
1>main.asm(79): error A2006: undefined symbol : StrLen
1>main.asm(79): error A2136: too many arguments to INVOKE
1>main.asm(79): error A2006: undefined symbol : WriteDec
1>main.asm(79): error A2136: too many arguments to INVOKE
1>main.asm(80): error A2006: undefined symbol : StrLen
1>main.asm(80): error A2136: too many arguments to INVOKE
1>main.asm(80): error A2006: undefined symbol : WriteDec
1>main.asm(80): error A2136: too many arguments to INVOKE
1>main.asm(81): error A2006: undefined symbol : StrLen
1>main.asm(81): error A2136: too many arguments to INVOKE
1>main.asm(81): error A2006: undefined symbol : WriteDec
1>main.asm(81): error A2136: too many arguments to INVOKE
1>main.asm(91): error A2136: too many arguments to INVOKE
1>main.asm(92): error A2136: too many arguments to INVOKE
1>main.asm(94): error A2136: too many arguments to INVOKE
1>main.asm(95): error A2136: too many arguments to INVOKE
1>main.asm(76): error A2006: undefined symbol : ??0001
1>main.asm(77): error A2006: undefined symbol : ??0004
1>main.asm(78): error A2006: undefined symbol : ??0007
1>main.asm(79): error A2006: undefined symbol : ??000A
1>main.asm(80): error A2006: undefined symbol : ??000D
1>main.asm(81): error A2006: undefined symbol : ??0010
1>main.asm(97): warning A6004: procedure argument or local not referenced : regName
1>main.asm(97): warning A6004: procedure argument or local not referenced : regValue
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\masm.targets(70,5): error MSB3721: The command "ml.exe /c /nologo /Zi /Fo"Debug\main.obj" /W3/errorReport:prompt /Tamain.asm" exited with code 1.
1>Done building project "AsmProject.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 9:28 PM and took 00.422 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, L1.data flagStr BYTE" &flagName=" flagVal BYTE?,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. 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,0
This shows the carry flag at bit 0 and
ShowFlag ZF,6
shows the zero flag at bit 6.
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 self-contained 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!