I just download msm9.0 When I compile and link my asm programs
follows, I always get error messages:
Assembling: example4.asm
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/z2
"example4.obj" /t
"example4.com"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
LINK : warning LNK4044: unrecognized option "t"; ignored
example4.obj : warning LNK4033: converting object format from OMF to
COFF
example4.obj : fatal error LNK1190: invalid fixup found, type 0x0001
What's run with it?
Thanks.
Z. Du
; DOSWIN.COM -- Simple MASM example program for MS-DOS or
MS-Windows.
; It can be run in a DOS-box as others usually are, or executed from
the
; Windows Shell (Explorer.exe) *without* disappering!
;
; Copyright(C)2004 by Daniel B. Sedory.
;
; Assemble using MASM's 16-bit assembler/linker ( \MASM>ml DOSWIN.ASM
).
;
; Many optional switches exist under MASM; for example:
; /Fl[file] -- To generate a listing
; /Sa -- To maximize source listing
; /WX -- To treat 'warnings' as errors
; Enter "ml /?" for a full list. So, "ml /Fl /Sa /WX" would be good
for
; catching any warnings and creating a detailed listing of your
program.
;
; The specific code used here is to show beginning MASM programmers
that
; data bytes (as seen in the first message here) can be inserted inside
of
; a .code section and jumped over. Also that any labels used inside of
the
; .code section to define a location must end with a colon (:)
*whereas*
; those inside of a .data section do not end with a colon.
;
.MODEL TINY
.286
.code
.startup
jmp ToStart ; Jump over data we placed in .code section.
Message:
db 13, 10, 13, 10
db " This .COM program runs under MS-DOS or MS-Windows."
db 13, 10, 24h ; $-sign-terminated string
ToStart:
mov dx, OFFSET Message ; Offset of our Message
mov ah, 9 ; Function 9 of INT 21
int 21h ; Display $-String
mov dx, OFFSET WinMsg
mov ah, 9
int 21h
mov ah, 0 ; Function 0 of INT 16
int 16h ; Wait for a keypress
mov ax, 4c01h ; Function 4C01 of INT 21
int 21h ; Normal Program Termination
.data
WinMsg db 13, 10, 13, 10
db " Press any key to exit program . . ."
db 13, 10, 24h ; $-sign-terminated string
END
;
; Example of how to assemble and link of the DOSWIN.COM source code:
;
=======================================================================
; C:\theStarman\asm\jkirwin\MASM>ml /Fl /Sa /WX DOSWIN.ASM
; Microsoft (R) Macro Assembler Version 6.15.8803
; Copyright (C) Microsoft Corp 1981-2000. All rights reserved.
;
; Assembling: DOSWIN.ASM
;
; Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5
1994
; Copyright (C) Microsoft Corp 1984-1993. All rights reserved.
;
; Object Modules [.obj]: DOSWIN.obj /t
; Run File [DOSWIN.com]: "DOSWIN.com"
; List File [nul.map]: NUL
; Libraries [.lib]:
; Definitions File [nul.def]:
;
=======================================================================
--
Computers are not intelligent. They only think they are.
And you don't have MASM v9.0. The latest ML.EXE is v8.0 - You have MASM32 v9.0,
which is designed for 32-bit code. See:
http://www.masm32.com/board/index.php?topic=161.0
To get the 16-bit linker, visit here under "Microsoft Tools":