File:  [OS/2 SDKs] / os2sdk / os2doc / masm500.txt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 12:25:13 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: os2sdk-1987, HEAD
Microsoft OS/2 SDK 12-15-1987

		    Microsoft Macro Assembler Package
			     Version 5.00

	If you purchased the Macro Assembler package as	an update to a
	previous version, you did not receive a	registration card.
	This is	not a mistake. The update is only available to
	registered owners, who do not need to reregister.

	Text files on the Macro	Assembler disks	are tabbed to save
	disk space. If your printer does not automatically handle
	tabs during printing, you must use a print program that
	expands	tabs. For example, use the DOS PRINT program to	print
	this and other document	or source files	on the disk.

  ==( MASM.EXE )==

  New Feature

	The /LA	option has been	added to specify a complete listing
	of all symbols,	macros,	and false conditionals.	It is
	equivalent to using the	.LIST, .LFCOND,	.LALL, and .CREF
	directives throughout the source file. The option overrides
	any conflicting	directives in the source file.

  Clarification

	The PTR	operator can be	used to	specify	the size of a
	register indirect operand for a	CALL or	JMP instruction.
	However, the size cannot be specified with NEAR	or FAR.	Use
	WORD or	DWORD instead. (In 80386 32-bit	segments, use DWORD
	or FWORD.) Examples are	shown below:

	  ; 8086, 80826, or 80386 16-bit mode

	  jmp  WORD PTR	[bx]	    ; Legal near jump
	  call NEAR PTR	[bx]	    ; Illegal near call
	  call DWORD PTR [bx]	    ; Legal far	call
	  jmp  FAR PTR [bx]	    ; Illegal far jump

	  ; 80386 32-bit mode only

	  jmp  DWORD PTR [bx]	    ; Legal near jump
	  call NEAR PTR	[bx]	    ; Illegal near call
	  call FWORD PTR [bx]	    ; Legal far	call
	  jmp  FAR PTR [bx]	    ; Illegal far jump

	This limitation	only applies to	register indirect operands.
	NEAR or	FAR can	be applied to operands associated with
	labels.	Examples are shown below:

	  jmp  NEAR PTR	pointer[bx] ; Legal
	  call FAR PTR location	    ; Legal

  Correction

	When evaluating	expressions, MASM does 16-bit arithmetic
	except when the	80386 processor	is enabled. If the .386	or
	.386P directive	has been given,	MASM does 32-bit arithmetic.
	This behavior is consistent with earlier versions of MASM,
	which always did 16-bit	arithmetic. The	notes in Sections
	9.2.1, 9.2.1.5,	and 9.2.2 of the Programmer's Guide are
	incorrect. MASM	extends	constant operands to 17	bits (33 bits
	with .386) before calculations,	but then truncates the result
	to 16 bits (32 bits with .386).	The EQ and NE operators	work
	on 16-bit operands (32-bit with	.386), but the LT, LE, GT, and
	GE operators work on 17-bit (33-bit with .386) operands.

  Clarification

	The @FARDATA predefined	equate mentioned in Section 5.1.5 does
	not exist. References to this equate and examples of it	in
	several	parts of the Programmer's Guide are incorrect. In
	particular, the	description of declaring external symbols in
	Section	8.2 is incomplete and the example is incorrect.	You
	cannot access the segment of an	external far data variable
	with the @FARDATA equate or with the segment name FAR_DATA.
	Instead	you must use the SEG operator as shown below:

		 .FARDATA
		 EXTRN	   fvar:WORD	   ; FAR variable in far data
		 .CODE
	  start: ASSUME	   es:SEG fvar	   ; Tell the assembler
		 mov	   ax,SEG fvar	   ; Tell the processor
		 mov	   es,ax

	This is	the same limitation described for communal variables
	in Section 8.4.	The reason is that under the DOS segment
	conventions, multiple far data segments	share the same name
	(FAR_DATA) and have private combine type. Segments with	the
	same name can only be distinguished indirectly using the SEG
	operator.

  Clarification

	New CS assume statements are automatically given each time you
	use the	.CODE directive, as shown below:

	  .CODE	TASK1		  ; Does ASSUME	CS:TASK1_TEXT
	  .
	  .
	  .
	  .CODE	TASK2		  ; Does ASSUME	CS:TASK2_TEXT
	  .
	  .
	  .

  Clarification

	The .286P and .386P processor directives enable	instructions
	that are normally used in systems programming. However,
	some of	these instructions do not necessarily require that
	the processor be in privileged or protected mode.

  Correction

	Public absolute	symbols	must be	declared during	pass 1.	This
	means that aliases for absolute	symbols	or other forward
	references to them will	cause errors. For example, the
	following code generates an error:

		 PUBLIC	lines
	  lines	 EQU	rows
	  rows	 EQU	25

	This behavior is different than	in previous versions of	MASM
	and contrary to	the note in Section 8.1.

  Behavior Change

	Some errors and	questionable practices that were ignored by
	earlier	versions are now flagged as errors. As a result,
	existing source	code may produce errors	or warnings.
	The following are examples:

	  - Labels defined only	during pass 1 will cause errors	if
	    used in expressions.
	  - A CS assume	that changes from pass 1 to pass 2 causes
	    an error.
	  - Constants are now checked for type overflow.
	  - Reserved words used	as labels produce warnings.
	  - The	OFFSET operator	used with a constant produces a
	    warning.

   Correction

	The assembler documentation indicates in several places	that
	CX will	be 0 following a SCAS or CMPS instruction if no	match
	is found. This is misleading since CX may also be zero after
	a search or compare in which the last string element matches.

	Testing	the zero flag is more reliable.	After a	REPNE
	comparison or scan, the	zero flag will be cleared if no	match
	was found. After a REPE	comparison or scan, the	zero flag
	will be	set if no nonmatch was found. This correction affects
	the following references:

	   Assembler Reference

	      CMPS instruction,	last paragraph

	      SCAS instruction,	last paragraph

	   Programmer's Guide

	      Section 18.3, last paragraph of description; in example,
	      change "JCXZ notfound" to "JNZ notfound"

	      Section 18.4, last paragraph of description; in example,
	      change "JCXZ allmatch" to "JZ allmatch"

  Other	Corrections

	Section	    Description

	5.2.2	    The	segment	align, combine,	use, and class types
		    can	be given in ANY	order.

	13.3	    Pushing a value DECREASES the value	of SP. Popping
		    INCREASES the value.

	16.3	    When two 16-bit numbers are	multiplied with	MUL or
		    IMUL, the LEAST-signicant bits of the product will
		    be in AX and the MOST-significant bits in DX.

	16.4	    To divide a	32-bit number by a 16-bit number with
		    DIV	or IDIV, put the LEAST-signicant bits in AX
		    and	the MOST-significant bits in DX.

	16.5	    In several cases, the registers and	values
		    described in text do not match those used in the
		    examples. The examples are correct.

  ==( MASM.EXE,	LINK.EXE, and LIB.EXE )==

  Clarification

	The description	of STACK combine type in Section 5.2.2.3
	does not explain how multiple initialized stack	segments are
	combined. The total size of the	stack is the total size	of
	all stack definitions. LINK puts initialized data for each
	defined	stack segment at the end of the	stack. Data initialized
	in the last segment linked overrides data initialized in
	previoussegments. This behavior	is usually not relevant, since
	most programs only define one stack of uninitialized data.
	Stack data cannot be initialized with simplified segment
	directives.

  New Feature

	The /NOE[XTDICTIONARY] option has been added to	the linker. It
	Tells the linker not to	use the	extended dictionary in
	searching libraries. Use this option if	you redefine a
	standard-library routine (such as _setargv or _nullcheck) in a
	program	module,	or if you get linker error L2044 during
	linking. This option may slow linking on some programs.

	The "extended dictionary" is a block of	data telling the linker
	about interlibrary dependencies; that is, for each module in
	the library, the extended dictionary tells the linker which
	other modules in the same library are also required. Although
	the linker can process libraries faster	with this information,
	it has trouble in processing if	you redefine symbols (such as
	the names of standard-library routines)	that otherwise would
	have been defined in one of the	modules	described in the
	extended dictionary.

	One new	LINK error message and two LIB messages	have been
	added to support this option. The linker message is shown
	below:

	  L2044	  <name> : symbol multiply defined, use	/NOE

	The message indicates that the linker found what it interprets
	as a public-symbol redefinition, probably because you have
	redefined a symbol that	is defined in a	library. Relink	with
	the /NOE option. If error L2025	results	for the	same symbol,
	then you have a	genuine	symbol-redefinition error.

	The following LIB messages are new:

	  U4157	  insufficient memory, extended	dictionary not created
	  U4158	  internal error, extended dictionary not created

	This indicates that LIB	could not create an extended
	dictionary. The	library	is still valid,	but the	linker will
	not be able to take advantage of the extended dictionary to
	speed linking.

  New Feature

	LIB has	a new option, /N[OIGNORECASE]. It tells	LIB to ignore
	case when comparing symbols in the extended and	regular
	dictionaries. The default is to	ignore case.

  New Message

	The following new LINK message warns about a practice that is
	legal in real mode, but	illegal	in protected mode:

	  warning L4003: intersegment self-relative fixup at <position>

	In assembly-language, the warning only occurs if the DOSSEG
	directive or /DOSSEG linker option is used. It indicates a
	16-bit jump to an address in another segment. For example,
	the following code produces the	error:

	  _TEXT	  SEGMENT
		  EXTRN	   doit:NEAR
		  jmp	   _TEXT2:doit
		  .
		  .
		  .
	  _TEXT	  ENDS

	  _TEXT2  SEGMENT
		  PUBLIC   doit
	  doit	  PROC	   NEAR
		  .
		  .
		  .
	  doit	  ENDP
	  _TEXT2  ENDS

	The warning usually indicates a	fatal error in high-level-
	language programs. It can occur	when the /NT option is used
	to compile a small-model C program.

  New Messages

	The following LINK messages are	related	to quick libraries.
	See you	QuickBASIC or QuickC documentation for details:

	  L2043	  Quick	Library	support	module missing
	  L1003	  /QUICKLIB, /EXEPACK incompatible
	  L1115	  /QUICKLIB, overlays incompatible

  New Message

	The following new LIB message warns that a module specified to
	be replaced does not exist in the library:

	  U4155	  <modulename> : module	not in library

	LIB adds the module anyway.

  ==( CodeView Debugger	)==

  New Feature

	The /R option has been added to	enable the CodeView debugger
	to use the debug registers (DR0, DR1, DR2, and DR3) of the
	80386 processor. The option is ignored if you do not have an
	80386 processor.

	The display does not change to indicate	that the debug
	registers are in use, but debugger operations with
	tracepoint or trace memory statements (but not with
	watchpoint statements) will be much faster. Any	of the
	following conditions will prevent the debugger from using
	debug registers:

	  1) /E	is used.
	  2) More than four tracepoints	are set.
	  3) A tracepoint watches more than four bytes of memory.
	  4) A watchpoint is set.

  Clarification

	The Pascal expression evaluator	described in the CodeView
	and Utilities manual is	not implemented	in this	version	of
	the CodeView debugger. It will be implemented in the
	debugger supplied with the next	version	of Pascal, which
	will also produce executable files with	CodeView symbolic
	information. Current versions of Pascal	do not work with the
	CodeView debugger.

  Corrections

	Section	4.2 of the CodeView and	Utilities manual should	mention
	that FORTRAN relational	operators do not work with string
	variables or constants.

	Use the	/Zi option, not	/D as indicated	in Sections 1.2.2 and
	1.2.6, when using BC to	compile	BASIC programs for the
	CodeView debugger.

  Warning

	Some versions of the GENOA EGA short card are incompatible
	with CodeView when used	with a mouse. You can work around this
	problem	by turning off the mouse with /M.

  ==( CREF.EXE )==

  New Feature

	Cross-reference	listing	files created with CREF	now have an
	additional symbol. A line number followed by + indicates
	that a symbol is modified at the given line. For example:

	  TST .	. . . .	. . . .	. . . .	.  134#	  237	 544+

	The symbol TST is defined at line 134, used at line 237, and
	modified at line 544.

  ==( MAKE.EXE )==

  Warning

	MAKE considers a backslash immediately followed	by a carriage
	return-line feed to be a continuation character. When it finds
	this combination in a description file,	MAKE concatenates the
	line immediately following to the current line.

	If you define a	macro that ends	in a backslash,	make sure that
	you put	a space	after the terminating backslash. For example:

	  BINPATH=C:\SRC\BIN\<space><new-line>
	  LIBPATH=C:\SRC\LIB\<space><new-line>

  New Feature

	The new	/X option has the following syntax:

	  /X <filename>

	This option redirects errors output by MAKE, or	by any
	programs that MAKE runs, to the	given file. If the <filename>
	argument is a dash (-),	MAKE redirects error output to STDOUT.
	You may	send both error	output and standard output to the same
	file by	combining the "/X -" form of this option with DOS
	redirection, as	in the following example:

	  MAKE /X - project.mak	>make.log

	DO NOT specify the same	file name for /X as the	file name
	following the redirection symbol (>).

  ==( ERROUT.EXE )==

  Correction

	The ERROUT utility does	not accept batch files.	To redirect
	standard-error output from a batch file, you must enter	a
	command	of the following form:

	   ERROUT COMMAND /c <batchfile>

	If no /f option	is given, ERROUT redirects standard-error
	output to the standard-output device.

  ==( Exit Codes )==

	Exit codes returned by LINK, LIB, and MAKE have	changed:

	       Code	Meaning

		0	No error.

		2	Program	error. Something was wrong with	the
			commands or files input	to the utility.

		4	System error, such as a	file error or user
			interrupt.


  ==( Mixed-Languages Programming Guide	)==

  Correction

	C recognizes up	to 31 characters of symbol names, not eight
	as stated in Section 1.2.

  Clarification

	The example programs for BASIC in Chapter 6 will not work
	with QuickBASIC	Versions 2.0 or	3.0. They will work if you
	rewrite	the function as	a subprogram, and omit the DECLARE
	statement. Functions and DECLARE statements are	supported
	in QuickBASIC 4.0 and in future	versions of Microsoft BASIC
	compilers.

  Clarification

	Section	6.6 of the Mixed Languages Programming Guide gives
	instructions for setting up a call to a	high-level language
	from assembly language.	Before you execute a call to a BASIC,
	Pascal,	or FORTRAN routine, declare an additional parameter if
	the return value is noninteger.	This additional	parameter must
	contain	the offset address of the return value,	for which you
	must allocate room within the stack segment (normally DGROUP,
	the same as the	default	data segment).

  ==( Macro Files )==

  New Feature

	Macro files have been added to the Macro Assembler package.
	The following files are	provided:

	      MIXED.INC	      For defining assembler procedures
			      that can be called from high-level
			      languages

	      MIXED.DOC	      Documentation for	the macros in
			      MIXED.INC.

	      DOS.INC	      For calling common DOS interrupts

	      BIOS.INC	      For calling common BIOS interrupts
			      used on IBM and IBM-compatible computers

	      MACRO.DOC	      Description, syntax, and reference
			      for using	the macros in DOS.INC and
			      BIOS.INC.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.