Assembly error A2119

Asked

Viewed 90 times

2

I’m a beginner in Assembly and I’m now trying to run my first program Hello World. Using Windows 7 and MASM.

I am following a tutorial the source of the program until the following:

.386
model falt, stdcall
option casemap:none

include     \masm32\include\windows.inc

include     \masm32\include\masm32.inc
includelib  \masm32\lib\masm32.lib

include     \masm32\include\kernel32.inc
includelib  \masm32\lib\kernel32.lib

include     \masm32\include\user32.inc
includelib  \masm\lib\user32.lib

.data
msg db "Hello World!!!", 0
cpt db "MY FIRST PROGRAM!!!", 0

.code
start:
invoke MessageBox, NULL, ADDR msg, ADDR cpt, MB_OK
invoke ExitProcess, NULL
end start

By sending the editor assemble source code, I get the following errors:

\Masm32 include windows.inc(78) : error A2119: language type must be specified Masm32 include windows.inc(79) : error A2119: language type must be specified Masm32 include windows.inc(80) : error A2119: language type must be specified Masm32 include windows.inc(81) : error A2119: language type must be specified Masm32 include windows.inc(82) : error A2119: language type must be specified ... ...

Does anyone know what the mistake means?

1 answer

2

There are three errors.

  • The first two errors are in the second line, model falt, stdcall, you should put the point . in front of the model, getting .model and use flat in place of falt.

  • The last error is on the top line, includelib \masm\lib\user32.lib must be includelib \masm32\lib\user32.lib, lacked the 32 in front of masm.

Your code should look like this:

.386
.model flat, stdcall
option casemap:none

include     \masm32\include\windows.inc

include     \masm32\include\masm32.inc
includelib  \masm32\lib\masm32.lib

include     \masm32\include\kernel32.inc
includelib  \masm32\lib\kernel32.lib

include     \masm32\include\user32.inc
includelib  \masm32\lib\user32.lib

.data
msg db "Hello World!!!", 0
cpt db "MY FIRST PROGRAM!!!", 0

.code
start:
invoke MessageBox, 0h, ADDR msg, ADDR cpt, MB_OK
invoke ExitProcess, 0h
end start

Browser other questions tagged

You are not signed in. Login or sign up in order to post.