Home / Expert Answers / Computer Science / i-tried-to-type-in-the-sample-code-in-visual-studio-in-order-to-build-the-project-but-i-am-getting-pa558

(Solved): I tried to type in the sample code in Visual Studio in order to build the project, but I am getting ...



I tried to type in the sample code in Visual Studio in order to build the project, but I am getting all these errors.

What did I do wrong and how do I solve this issue? / STEP BY STEP PLEASE

INCLUDE Irvine32.inc
. data
bigEndian BYTE \( 12 \mathrm{~h}, 34 \mathrm{~h}, 56 \mathrm{~h}, 78 \mathrm{~h} \)
littleEndian​​​​​​​

INCLUDE Irvine32.inc . data bigEndian BYTE littleEndian DWORD? . code main proc mov ah, byte ptr mybigEndian mov al, byte ptr [mybigEndian+1] mov word ptr [mylittleEndian+2], ax mov ah, byte prt [mylittleEndian+2] mov al, byte prt [mylittleEndian+3] mov word ptr [mylittleEndian], ax invoke ExitProcess, 0 main endp end Output Show output from: Build Build started... 1>-.-- Build started: Project: Project1, Configuration: Debug Win32 1>Assembling Pro.asm... 1>Pro.asm(5): error A2608: syntax error : littleEndian 1>Pro.asm(11): error A2006: undefined symbol : mybigEndian 1>Pro.asm(12): error A2006: undefined symbol : mybigEndian 1>Pro.asm(13): error A2006: undefined symbol : mylittleEndian 1>Pro.asm(14): error A2206: missing operator in expression 1>Pro.asm(15): error A2206: missing operator in expression 1>Pro. asm(16): error A2006: undefined symbol : mylittleEndian 1>Done building project "Project1.vcxproj" -- FAILED. Build: succeeded, 1 failed, up-to-date, skipped


We have an Answer from Expert

View Expert Answer

Expert Answer





My dear Chegg student it looks like there are several errors in the sample code that you've provided. Here are the issues that need to be addressed:



1. The first line of your code includes the Irvine32 library. You need to make sure that this library is properly installed in your system and its path is correctly set in your Visual Studio project.

2. In the .data section, you have defined a byte variable called bigEndian but you are referring to it as mybigEndian in your code. You need to use the correct variable name to avoid an "undefined symbol" error.

3. Similarly, you have defined a DWORD variable called LittleEndian but you are referring to it as mylittleEndian in your code. Again, you need to use the correct variable name.

4. In the .code section, you are using the mov instruction to move a byte from mybigEndian to the ah register. However, mybigEndian is a byte variable and you can't move it directly into a 16-bit register like ah. Instead, you need to use a 16-bit register to load the byte value and then move it to the ah register.

5. In the same mov instruction, you are using mybigEndian as an operand without enclosing it in brackets. You need to use [mybigEndian] to access the value of the variable.

6. In the second mov instruction, you have misspelled the byte ptr operator as "byte prt". It should be "byte ptr".

7. Similarly, in the third mov instruction, you have misspelled mylittleEndian as "nylittleEndian".



We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe