Visual studio C++ and assembly language

Hello everyone,
I am trying to learn assembly language in C++ MS Visual Studio.

In my C++ I have the folloing codes:

1
2
3
4
extern "C" void doit();
void main() {
	doit();
}


First of all in Visual studio 2015 I have put the correct properties on linkage
as commandline:
ml /c /Cx /coff "%(FullPath)"
outputs:
%(Filename).obj


In my assembly I have the following codes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15


.586
.model falt, c
.stack 100h
.data

.code

doit proc


doit endp

end


I got many errors such as :

1
2
3
4
5
6
7
8
9
10
1>   Assembling: C:\myAssembly\Projects\threePowerN\myAssembly.asm
1>  C:\myAssembly\Projects\threePowerN\myAssembly.asm(4)e too large for specified size
1>: error A2008 : syntax error : falt
1>  C:\myAssembly\Projects\threePowerN\myAssembly.asm(5)e too large for specified size
1>C:\myAssembly\Projects\threePowerN\myAssembly.asm(5): error A2013: .MODÿC:\myAssembly\Projects\threePowerN\myAssembly.asm(6)e too large for specified size
1>C:\myAssembly\Projects\threePowerN\myAssembly.asm(6): error A2013: .MOD.MOC:\myAssembly\Projects\threePowerN\myAssembly.asm(8)e too large for specified size
1>C:\myAssembly\Projects\threePowerN\myAssembly.asm(8): error A2013: .MOD.MOC:\myAssembly\Projects\threePowerN\myAssembly.asm(10)de too large for specified size
1>C:\myAssembly\Projects\threePowerN\myAssembly.asm(10): error A20myAssembly.asm(8): error A2013:.MOD.MOC:\myAssembly\Projects\threePowerN\myAssembly.asm(13)de too large for specified size
1>  C:\myAssembly\Projects\threePowerN\myAssembly.asm(13) : fatal er : error A2013:.MOD.MO
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Anyone has any idea what is the problem?

thanks
A guess in the wild:

Replace .model falt, c
with .model flat, c

consider downloading the free masm to go with your visual studio, if they are still supporting that.

Topic archived. No new replies allowed.