Path: utzoo!attcan!uunet!cs.utexas.edu!uwm.edu!gem.mps.ohio-state.edu!apple!sun-barr!decwrl!hplabs!hpfcso!hpldola!hpctdlb!hpctdls!wei From: wei@hpctdls.HP.COM (Bill Ives) Newsgroups: comp.sys.ibm.pc Subject: Re: MASM 5.1 help needed Message-ID: <2010017@hpctdls.HP.COM> Date: 21 Sep 89 15:57:38 GMT References: <1885@cbnewsd.ATT.COM> Organization: Hewlett-Packard CTD, Colo. Spgs. Lines: 40 In response to your phase error problem,... I tried your piece of code and found the same problem. I do have a couple of suggestions of fixes though. First, instead of install proc near mov cx, seg myproc ret install endp myproc proc far ret myproc endp you could switch the order of the procs so the "seg" doesn't have to reference a forward label. Or you could put the "myproc" in a separate file module and declare it as EXTRN myproc:FAR ... again giving the assembler exact resolution of its whereabouts. Another possiblity... depending on what you are trying to do is to load the segment value from the segment name or register al la: mov cx, _TEXT OR mov cx, cs ; since you told the assembler to ASSUME cs:_text BUT if you must forward reference like the example you posted you can use the segment override prefix-this worked for me- although I am not sure what you want put into cx (see previous discussion).. The segment override form is: mov cx, seg cs:myproc If you had a data segment in your example and wanted to forward reference to a variable in it along the same lines you would have to do: mov cx, seg ds:thevarname. Hope this clears it up some. I cannot explain why MS MASM 5.1 can't handle what you gave it ( IT seems a semi-smart assemebler could provide fix-ups for the forward reference you gave --padded with nops perhaps--). Bill Ives HP CTD #include