X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 318770 DOT 14407 DOT bm AT omp1011 DOT mail DOT sp2 DOT yahoo DOT com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.ar; s=s1024; t=1296418691; bh=L/BLn25SOV9zS1CewqkFpMsx5MfgBF7G+J2jP7wxLnI=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=N7sTZMW2PU63A7dYxtLfBDeg9wbj4J/5npOkwPlaQ/FYgXXrpQ5zkKPpO6yeDFxU9g3yhu5aC6r+jPoFQwf3aQE6tBYSaZW1ajavTqbbipS7ztwjGjxUB4m3Cdq8KEiG5xNobvJbPlAPkZ9JkO/UGf2re2lc+7TI1WczRp5Y0Ug= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.ar; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=258btLwt7Nk5EtHFom8sVJESjSWk+gJ5/Sj+2/Fj5xtsDcufsPX0eaiA7SCtQfkfmpxvcpfNkqk9/Pv0C2JTKye5oPpi0pUq1y26dcR4tjBpazfRQyK+t4fxE/FoOoHS1/TI/YxaK4uhnLqX8EEmdRBY0vlerOhz+++YU6kpxTI=; Message-ID: <880318.53118.qm@web45107.mail.sp1.yahoo.com> X-YMail-OSG: To98eUoVM1mFdPT_Ie9vav_hhoisrm2akIrRb6UQ6l3B4wv rVHGpCK8tC3ktQqEjE_CbVxoruJ.iFB2sGN442GPvn4erJXVcxTGtjXdqmCs 2XM6_VB14qT5mSlBSngDQ1B4tD_lgaUEX1JtCLajz9J1m1BVnI7Ds5NacOY6 y1_Gn6M_CoZIW1r6s2gK4sHKHFkBWgF6RjE.IKcZqQn9uj1Bh7Pqg7zzevvv dVv6fcqDbk74fiOL4izeKY.EXTOe34KcotoMJQq7Sw9n5WL4- X-Mailer: YahooMailClassic/11.4.20 YahooMailWebService/0.8.107.285259 Date: Sun, 30 Jan 2011 12:18:11 -0800 (PST) From: Pablo Marty <tigrepotrazosalvaje AT yahoo DOT com DOT ar> Subject: Re: question of assembler To: djgpp AT delorie DOT com In-Reply-To: <if0r8s$ahk$1@speranza.aioe.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-328552469-1296418691=:53118" Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk --0-328552469-1296418691=:53118 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Mr Rod Pemberton thank you very much, the solution you gave me succeded =A0 What I found out is that what was wrong was not the linear framebuffer I al= so succesfully compiled (but my game still ran slow under DOSBox) but DOSBo= x itself Why? If the problem was the video system, something like an archive load into me= mory would be normally fast; under Windows XP (whose problem is that does n= ot support sound) my program loads very fast from the disk the files that c= ontains the graphics, also the game runs fast. Under DOSBox both are slow. = So the problem is not either the protected mode bank switching nor the line= ar framebuffer. It's something about DOSBox speed. Yes,=A0I tried=A0setting= the CPU Cicles higher but it was the same. =A0 Does someone have an idea about how to solve this??? If necessary, I can se= nd my code, EXE, and all files needed =A0 thank you =A0 Pablo Asesinar y comer un perro o un gato es lo mismo q hacerlo a una vaca, un po= llo, un cerdo o un pez. El genocidio no discrimina. No seas complice de gen= ocidas. No seas genocida. En la vida tarde o temprano todo vuelve. No comas= cadaveres. No seas necr=F3fago.=20 --- El vie 24-dic-10, Rod Pemberton <do_not_have AT notreplytome DOT cmm> escribi= =F3: De: Rod Pemberton <do_not_have AT notreplytome DOT cmm> Asunto: Re: question of assembler Para: djgpp AT delorie DOT com Fecha: viernes, 24 de diciembre de 2010, 1:01 "Pablo Marty" <tigrepotrazosalvaje AT yahoo DOT com DOT ar> wrote in message news:846345 DOT 79275 DOT qm AT web45108 DOT mail DOT sp1 DOT yahoo DOT com... > hi guys and girls > I'm still a the search of the VESA VBE protected mode bank switching function in order to run my SuperMarioBros videogame normally fast and with music under DOSBox > > this is the code I got from the DJGPP page about VESA 2.0 > the compiler throws an error at the set_vesa_bank_pm() function (at the end of the code) > In the last time I wrote to the list, Mr DJ Delorie told me that "you can't clobber and use them", I suppose refering to the CPU registers. But h= e didn't tell me how to clobber them without using them .... > I suppose that's what has to be done, because beside the code there is a coment that says "clobber list ..." There are three colons that can follow the inline assembly.=A0 The first is for the input.=A0 The second is for the output.=A0 GAS understands that registers used for the inputs and outputs get "clobbered", i.e., destroyed, changed, modified...=A0 The third is for the "clobber" list.=A0 That's for registers which get modified that are in the assembly which GAS was not tol= d about in the input and output sections.=A0 E.g., if you used %ecx in the assembly, but it was not an input or output register, it'd go into the clobber list. > Can someone tell me how to clobber the list of registers correctly? ... > >This code will give you a pointer to the protected mode bank switching function, but you cannot call this directly from C because it uses a specia= l register based argument passing convention. A little bit of inline >asm is needed to make sure the parameters go into the correct registers, eg:=A0=A0= =A0void set_vesa_bank_pm(int bank_number) > { >=A0 =A0 =A0 asm ( >" call *%0 " This assembly doesn't modify any registers.=A0 If it did, it would need to = go into the clobber list, if it isn't being used as an input or output. >=A0 =A0 =A0 :=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0=A0= /* no outputs */ There are no outputs. >=A0 =A0 =A0 : "r" (pm_bank_switcher),=A0 =A0=A0=A0/* function pointer in a= ny register */ There are inputs.=A0 This will clobber a register, but GCC understands whic= h register it chose. > "b" (0),=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0=A0/* set %ebx to zero */ ebx is used.=A0 It shouldn't be in the clobber list below. > "d" (bank_number)=A0 =A0 =A0 =A0 =A0 /* bank number in %edx */ edx is usd.=A0 It shouldn't be in the clobber list below. >=A0 =A0 =A0 : "%eax",=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0=A0/* clobb= er list (we have no way of */ > "%ebx",=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* knowing which registers= the VESA */ I think you need to remove the ebx line. > "%ecx",=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* code is going to change= , so we */ > "%edx",=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* have to assume the wors= t and list */ I think you need to remove the edx line. > "%esi",=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* them all here) */ > "%edi" >=A0 =A0 =A0=A0=A0); >=A0 =A0 } > You may also need to remove one more register from the list, perhaps eax, s= o that GCC can pick a register for the "r" input.=A0 Try something like that. Rod Pemberton =0A=0A=0A --0-328552469-1296418691=:53118 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable <table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"= top" style=3D"font: inherit;"><DIV>Mr Rod Pemberton</DIV> <DIV>thank you very much, the solution you gave me succeded</DIV> <DIV> </DIV> <DIV>What I found out is that what was wrong was not the linear framebuffer= I also succesfully compiled (but my game still ran slow under DOSBox) but = DOSBox itself</DIV> <DIV>Why?</DIV> <DIV>If the problem was the video system, something like an archive load in= to memory would be normally fast; under Windows XP (whose problem is that d= oes not support sound) my program loads very fast from the disk the files t= hat contains the graphics, also the game runs fast. Under DOSBox both are s= low. So the problem is not either the protected mode bank switching nor the= linear framebuffer. It's something about DOSBox speed. Yes, I tried&n= bsp;setting the CPU Cicles higher but it was the same.</DIV> <DIV> </DIV> <DIV>Does someone have an idea about how to solve this??? If necessary, I c= an send my code, EXE, and all files needed</DIV> <DIV> </DIV> <DIV>thank you</DIV> <DIV> </DIV> <DIV>Pablo<BR><BR><FONT style=3D"BACKGROUND-COLOR: #8000ff" face=3D"arial, = helvetica, sans-serif"><FONT color=3D#ffff00>Asesinar y comer un perro o un= gato es lo mismo q hacerlo a una vaca, un pollo, un cerdo o un pez. El gen= ocidio no discrimina. No seas complice de genocidas. No seas genocida. En l= a vida tarde o temprano todo vuelve. No comas cadaveres. No seas necr=F3fag= o.</FONT> </FONT><BR><BR>--- El <B>vie 24-dic-10, Rod Pemberton <I><do_n= ot_have AT notreplytome DOT cmm></I></B> escribi=F3:<BR></DIV> <BLOCKQUOTE style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(= 16,16,255) 2px solid"><BR>De: Rod Pemberton <do_not_have AT notreplytome DOT cm= m><BR>Asunto: Re: question of assembler<BR>Para: djgpp AT delorie DOT com<BR>Fe= cha: viernes, 24 de diciembre de 2010, 1:01<BR><BR> <DIV class=3DplainMail>"Pablo Marty" <<A href=3D"http://ar.mc451.mail.ya= hoo.com/mc/compose?to=3Dtigrepotrazosalvaje AT yahoo DOT com DOT ar" ymailto=3D"mailto= :tigrepotrazosalvaje AT yahoo DOT com DOT ar">tigrepotrazosalvaje AT yahoo DOT com DOT ar</A>>= wrote in message<BR>news:<A href=3D"http://ar.mc451.mail.yahoo.com/mc/comp= ose?to=3D846345 DOT 79275 DOT qm AT web45108 DOT mail DOT sp1 DOT yahoo DOT com" ymailto=3D"mailto:846= 345 DOT 79275 DOT qm AT web45108 DOT mail DOT sp1 DOT yahoo DOT com">846345 DOT 79275 DOT qm AT web45108 DOT mail DOT sp1= .yahoo.com</A>...<BR>> hi guys and girls<BR>> I'm still a the search = of the VESA VBE protected mode bank switching<BR>function in order to run m= y SuperMarioBros videogame normally fast and with<BR>music under DOSBox<BR>= ><BR>> this is the code I got from the DJGPP page about VESA 2.0<BR>&= gt; the compiler throws an error at the set_vesa_bank_pm() function (at the= <BR>end of the code)<BR>> In the last time I wrote to the list, Mr DJ De= lorie told me that "you<BR>can't clobber and use them", I suppose refering = to the CPU registers. But he<BR>didn't tell me how to clobber them without using = them ....<BR>> I suppose that's what has to be done, because beside the = code there is a<BR>coment that says "clobber list ..."<BR><BR>There are thr= ee colons that can follow the inline assembly. The first is<BR>for th= e input. The second is for the output. GAS understands that<BR>= registers used for the inputs and outputs get "clobbered", i.e., destroyed,= <BR>changed, modified... The third is for the "clobber" list. T= hat's for<BR>registers which get modified that are in the assembly which GA= S was not told<BR>about in the input and output sections. E.g., if yo= u used %ecx in the<BR>assembly, but it was not an input or output register,= it'd go into the<BR>clobber list.<BR><BR>> Can someone tell me how to c= lobber the list of registers correctly?<BR>...<BR><BR>><BR>>This code= will give you a pointer to the protected mode bank switching<BR>function, but you cannot call this directly from C because it= uses a special<BR>register based argument passing convention. A little bit= of inline >asm is<BR>needed to make sure the parameters go into the cor= rect registers, eg: void<BR>set_vesa_bank_pm(int bank_numb= er)<BR>> {<BR>> asm (<BR>>" call *%0 "<BR><BR>= This assembly doesn't modify any registers. If it did, it would need = to go<BR>into the clobber list, if it isn't being used as an input or outpu= t.<BR><BR>> : &nbs= p; /* no= outputs */<BR><BR>There are no outputs.<BR><BR>> : = "r" (pm_bank_switcher), /* function pointer in any = register */<BR><BR>There are inputs. This will clobber a register, bu= t GCC understands which<BR>register it chose.<BR><BR>> "b" (0), &n= bsp;/* set %ebx to zero */<BR><BR>ebx is used. It shouldn't be in the= clobber list below.<BR><BR>> "d" (bank_number) &nbs= p; /* bank number in %edx */<BR><BR>edx is usd. It shouldn't b= e in the clobber list below.<BR><BR>> : "%eax", = ;  = ;/* clobber list (we have no way of */<BR>> "%ebx", = /* knowing which registers= the VESA */<BR><BR>I think you need to remove the ebx line.<BR><BR>> "%= ecx", = /* code is going to change, so we */<BR>> "%edx", &n= bsp; /* have to assume the worst = and list */<BR><BR>I think you need to remove the edx line.<BR><BR>> "%esi", = /* them all here) */<BR>> "%edi"<BR>> &nbs= p; );<BR>> }<BR>><BR><BR>You may also = need to remove one more register from the list, perhaps eax, so<BR>that GCC= can pick a register for the "r" input. Try something like that.<BR><= BR><BR>Rod Pemberton<BR><BR><BR></DIV></BLOCKQUOTE></td></tr></table><br>= =0A=0A=0A=0A=0A --0-328552469-1296418691=:53118--