Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!wjh12!lotto From: lotto@wjh12.UUCP Newsgroups: comp.sys.ibm.pc Subject: MASM quirk, is this a bug or my problem? Message-ID: <62@wjh12.UUCP> Date: Sun, 5-Apr-87 09:44:46 EST Article-I.D.: wjh12.62 Posted: Sun Apr 5 09:44:46 1987 Date-Received: Sun, 5-Apr-87 21:41:48 EST Reply-To: lotto@wjh12.UUCP (Jerry Lotto) Organization: Harvard Univ. Chem. Dept. Lines: 34 The following code fragment was assembled using MASM 4.0, linked with the linker provided in that package and the exe2bin'ed to a .COM file with the DOS 3.2 incarnation of that utility. Title FOO Cseg segment para 'CODE' org 100H assume CS:Cseg, DS:Cseg, ES:Cseg Start: jmp Begin Label db 'Post no bills' Begin: lea DX, Cseg:Label . . . Cseg ends end Start When I looked at the resulting code, the line at label begin got: LEA DX, [0003] 100H before the actual location of Label. The same (incorrect) results were obtained with the source line: Begin: lea DX, CS:Label Removing the explicit segment reference to make: Begin: lea DX, Label gave the correct result: LEA DX, [0103] My understanding of the ASSUME directive is that labels located in Cseg should assume the use of CS: as the segment register. No changes are observed with the segment declaration, assume directive and org assignment in any order! Why is this a problem? Thanks.