X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Tue, 01 Nov 2005 20:33:02 +0100 From: Pafo007 <"Pafo007 at wanadoo dot fr"@unknown.addr> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: fr, en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Why the call instruction points 2 bytes before to the real start sub-routine ? References: <003201c5df0c$20f5abe0$2432a8c0 AT dcueva> In-Reply-To: <003201c5df0c$20f5abe0$2432a8c0@dcueva> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lines: 33 Message-ID: <4367c38f$0$7862$8fcfb975@news.wanadoo.fr> Organization: les newsgroups par Wanadoo NNTP-Posting-Date: 01 Nov 2005 20:35:43 CET NNTP-Posting-Host: 82.124.255.112 X-Trace: 1130873743 news.wanadoo.fr 7862 82.124.255.112:2731 X-Complaints-To: abuse AT wanadoo DOT fr To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello. In 32 bits mode, displacement is 4 bytes long: it is not 0B00 at address 0101, but 0b000000 (look at 0000 at address 0104), whitch is 11 (decimal) in intel-hexa. And it is relative to the address of the next instruction, whitch is 0106 and not 0104. And so 106 + 0B = 111 and not 10F ! Hth > 1579:0100 90 NOP > 1579:0101 E80B00 CALL 010F > 1579:0104 0000 ADD [BX+SI],AL > 1579:0106 66 DB 66 > 1579:0107 BE5C01 MOV SI,015C > 1579:010A E83400 CALL 0141 > 1579:010D 0000 ADD [BX+SI],AL > 1579:010F CD20 INT 20 > > NOTE!!! > CALL 010F: Must point to the "clrscr" subroutine, but this subroutine > start at 0111. > CALL 0141: Must point to the "impstr" subroutine, but this subroutine > start at 0143. > > Note 2 bytes of displacement in the CALL instruction. > > Obviously the ipl.com file compiled with .code32 does not work fine. > 010F points directly to INT 0x20 :( :'( > > Thanks a lot for your help and time. >