Hello all, I am trying do simple input/output in assembly language but keep getting the error
Deleting intermediate and output files for project 'windows32', configuration 'Debug|Win32'
Assembling...
Assembling: ..\PeachesAssembly\Ex_3_5_1.asm
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\io.h(3) : error A2044:invalid character in file
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\io.h(4) : error A2044:invalid character in file
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\io.h(5) : error A2044:invalid character in file
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\io.h(6) : error A2044:invalid character in file
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\io.h(7) : error A2044:invalid character in file
here is my code
When I click open the io.h file under the header folder (I am using a windows32 template for GUI application, so input/output is via windows dialog box, instructor recommended this) Visual Studio 2008 says it cannot open the file, but when I double click the first error message the io.h file does open and it stops on this line of code
#if _MSC_VER > 1000
in fact everywhere there is a "#" there is also an error message
Is there a way to fix this? This code comes from a book called "Introduction To 80x86 Assembly Language and Computer Architecture" by Richard C. Detmer figure 3.10 page 69
I am on a windows PC using Windows 7
Any Ideas? Anyone?
Deleting intermediate and output files for project 'windows32', configuration 'Debug|Win32'
Assembling...
Assembling: ..\PeachesAssembly\Ex_3_5_1.asm
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\io.h(3) : error A2044:invalid character in file
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\io.h(4) : error A2044:invalid character in file
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\io.h(5) : error A2044:invalid character in file
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\io.h(6) : error A2044:invalid character in file
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\io.h(7) : error A2044:invalid character in file
here is my code
;Example assembly language program that adds two numbers
.586
.MODEL FLAT
INCLUDE io.h
.STACK 4096
.DATA
number1 DWORD ?
number2 DWORD ?
prompt1 BYTE "Enter the first number ",0
prompt2 BYTE "Enter the second number ",0
string BYTE 40 DUP (?)
resultLbl1 BYTE "The sum is ",0
sum BYTE 11 DUP (?)
.CODE
_MainProc PROC
input prompt1, string, 40 ;read ASCII characters
atod string ;convert string to integer
mov number1, eax ;store in memory
input prompt2, string, 40 ;repeat for second number
atod string
mov number2, eax
mov eax, number1 ;first number to EAX
add eax, number2 ;add second number
dtoa sum, eax ;convert to ASCII characters
output resultLbl1, sum ;output label and sum
mov eax, 0 ;exit with return code 0
ret
_MainProc ENDP
END ;end of source code
When I click open the io.h file under the header folder (I am using a windows32 template for GUI application, so input/output is via windows dialog box, instructor recommended this) Visual Studio 2008 says it cannot open the file, but when I double click the first error message the io.h file does open and it stops on this line of code
#if _MSC_VER > 1000
in fact everywhere there is a "#" there is also an error message
Is there a way to fix this? This code comes from a book called "Introduction To 80x86 Assembly Language and Computer Architecture" by Richard C. Detmer figure 3.10 page 69
I am on a windows PC using Windows 7
Any Ideas? Anyone?