Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!wjh12!lotto From: lotto@wjh12.HARVARD.EDU (Jerry Lotto) Newsgroups: comp.sys.ibm.pc Subject: Re: Please explain this MASM/LINK behavior... Message-ID: <90@wjh12.HARVARD.EDU> Date: Wed, 2-Sep-87 13:19:28 EDT Article-I.D.: wjh12.90 Posted: Wed Sep 2 13:19:28 1987 Date-Received: Sat, 5-Sep-87 06:20:05 EDT References: <88@wjh12.HARVARD.EDU> <2474@bnrmtv.UUCP> Reply-To: lotto@wjh12.UUCP (Jerry Lotto) Organization: Harvard Univ. Chem. Dept. Lines: 36 Keywords: MASM LINK bug? In article <2474@bnrmtv.UUCP> perkins@bnrmtv.UUCP (Henry Perkins) writes: > >The problem is with MASM not complaining about the > > mov ax, Code_Seg:[2ch] > >line. This SHOULD be written as > > mov ax, cs:[2ch] > >if you want to make use of the ASSUME directive and specify the >code segment. There's no 8086 addressing mode that allows a >segment to be specified as immediate data for a MOV instruction. Whoa! Segment overrides to operand fetches are NOT a function of the instruction. These two cases above should generate the same code! The CS assume should work two ways. MASM "knows" that Code_Seg is in CS: and should not have to be told twice. You are absolutely correct that using CS: explicity works. The point was that using CS: implicitly fails (but should not). You also correctly pointed out that my posted workaround ends up using DS: (the default). I should have specified your line above as the workaround example in my original posting to illustrate the problem more clearly. BTW, Microsoft tech support acknowledged this as a known bug after my posting and are supposed to be getting back to me with a real work around that permits me to use a segname. Explicit use of CS: because there is other code that has to look at stuff in Code_Seg from the outside. They claim that MASM 5.0 does not share this problem. -- Gerald Lotto - Harvard Chemistry Dept. UUCP: {seismo,harpo,ihnp4,linus,allegra,ut-sally}!harvard!lotto ARPA: lotto@harvard.harvard.edu