Link to home
Get AccessLog in
Avatar of xudeus
xudeus

asked on

Symbol type error when I compile this code.

Cant figure out the issue here, this should work but I keep getting a symbol type error. I am new to assembly so any help would be great.
INCLUDE Irvine32.inc
 
 
mReadkey MACRO ascii, scan
	mov ah,10h		; BIOS keyboard input function
	int 16h
	mov scan,ah
	mov ascii,al
ENDM
 
.data
ascii BYTE ?
scan  BYTE ?
str1  BYTE "ASCII code: ",0
str2  BYTE "Scan code:  ",0
 
.code
main PROC
	mov ax,@data
	mov ds,ax
 
; Wait for a key; when the macro returns, the two arguments
; contain the ASCII code and scan code of the key.
	mReadkey ascii, scan
 
; Display the values.
	mov edx,OFFSET str1
	call WriteString
	movzx eax,ascii
	call WriteHex
	call Crlf
 
	mov edx,OFFSET str2
	call WriteString
	movzx eax,scan
	call WriteHex
	call Crlf
 
	exit
main ENDP
END main

Open in new window

Avatar of Infinity08
Infinity08
Flag of Belgium image

What's the exact error message ?
Avatar of xudeus
xudeus

ASKER

1>------ Build started: Project: SG360test, Configuration: Debug Win32 ------
1>Assembling...
1> Assembling: ..\main.asm
1>..\main.asm(26) : error A2004: symbol type conflict
1>Project : error PRJ0019: A tool returned an error code from "Assembling..."
1>Build log was saved at "file://d:\SG360\SG360test\SG360test\Debug\BuildLog.htm"
1>SG360test - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
And what line is line 26 ?

What does the "file://d:\SG360\SG360test\SG360test\Debug\BuildLog.htm" file contain ?
What version of MASM are you using ?
Avatar of xudeus

ASKER

Build Log      Build started: Project: SG360test, Configuration: Debug|Win32
 Command Lines      Creating temporary file "d:\SG360\SG360test\SG360test\Debug\BAT00000132282868.bat" with contents
[
@echo off

ml.exe /c  /nologo /Fo"Debug\main.obj" /I "d:\Irwin" /W3 /Zi /errorReport:prompt  /Ta..\main.asm

if errorlevel 1 goto VCReportError

goto VCEnd

:VCReportError

echo Project : error PRJ0019: A tool returned an error code from "Assembling..."

exit 1

:VCEnd
]
Creating command line "d:\SG360\SG360test\SG360test\Debug\BAT00000132282868.bat"
 Output Window      Assembling...
 Assembling: ..\main.asm
..\main.asm(26) : error A2004: symbol type conflict
Project : error PRJ0019: A tool returned an error code from "Assembling..."
 Results      Build log was saved at "file://d:\SG360\SG360test\SG360test\Debug\BuildLog.htm"
SG360test - 2 error(s), 0 warning(s)
 

MASM 8.0
Avatar of xudeus

ASKER

line 26 is

mov ax, @data
ASKER CERTIFIED SOLUTION
Avatar of Infinity08
Infinity08
Flag of Belgium image

Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access