Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

visual studio 2010 - assembly fatal error LNK1190: invalid fixup found, type 0x0001

I want to write 16 bit 8086 assembly code in visual studio 2010 but gives me error: code:

.MODEL small
.STACK 100h
.data
message BYTE "Hello, world!","$"
.code
mov ah,9
mov dx,OFFSET message ; addr of buffer
int 21h
END

output gives me this error:

fm.obj : fatal error LNK1190: invalid fixup found, type 0x0001

I using masm32v11. What should I do?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Where does the Assembler know where the starting address is? Using Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994 (16bit linker) and added start and end start the code Assembles and links just fine. MASM32 includes a 16bit linker in the bin directory. You must pass different command line parameters to ML to Assemble 16bit code correctly though.

.MODEL small
.STACK 100h
.data
message BYTE "Hello, world!","$"
.code
start:
mov ah,9
mov dx,OFFSET message ; addr of buffer
int 21h
END start

So to recap - your code needs a starting address and an end, You can use the current ML that comes with MASM32 to Assemble 16 bit and 32 bit code. To link 16 bit code you must use a 16 bit linker, to link 32 bit code, you must use a 32 bit linker.

From one of my 16 bit DOS apps:

ML.EXE /DMASM /DDOS /Zm /c /nologo /I"f:masm32Include" "dosdisplay.asm"
link16.exe /NOLOGO "dosdisplay.obj"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...