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 Subject: Re: question of assembler To: djgpp AT delorie DOT com In-Reply-To: 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 escribi= =F3: De: Rod Pemberton Asunto: Re: question of assembler Para: djgpp AT delorie DOT com Fecha: viernes, 24 de diciembre de 2010, 1:01 "Pablo Marty" 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
Mr Rod Pemberton
thank you very much, the solution you gave me succeded
 
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
Why?
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.
 
Does someone have an idea about how to solve this??? If necessary, I c= an send my code, EXE, and all files needed
 
thank you
 
Pablo

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.

--- El vie 24-dic-10, Rod Pemberton <do_n= ot_have AT notreplytome DOT cmm> escribi=F3:

De: Rod Pemberton <do_not_have AT notreplytome DOT cm= m>
Asunto: Re: question of assembler
Para: djgpp AT delorie DOT com
Fe= cha: 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= .yahoo.com...
> hi guys and girls
> I'm still a the search = of the VESA VBE protected mode bank switching
function in order to run m= y SuperMarioBros videogame normally fast and with
music under DOSBox
= >
> this is the code I got from the DJGPP page about VESA 2.0
&= gt; 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 De= lorie told me that "you
can't clobber and use them", I suppose refering = to the CPU registers. But he
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 thr= ee colons that can follow the inline assembly.  The first is
for th= e input.  The second is for the output.  GAS understands that
= registers used for the inputs and outputs get "clobbered", i.e., destroyed,=
changed, modified...  The third is for the "clobber" list.  T= hat's for
registers which get modified that are in the assembly which GA= S was not told
about in the input and output sections.  E.g., if yo= u 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 c= lobber 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 special
register based argument passing convention. A little bit= of inline >asm is
needed to make sure the parameters go into the cor= rect registers, eg:   void
set_vesa_bank_pm(int bank_numb= er)
> {
>      asm (
>" call *%0 "

= This assembly doesn't modify any registers.  If it did, it would need = to go
into the clobber list, if it isn't being used as an input or outpu= t.

>      :          &nbs= p;                  /* no= outputs */

There are no outputs.

>      : = "r" (pm_bank_switcher),     /* function pointer in any = register */

There are inputs.  This will clobber a register, bu= t GCC understands which
register it chose.

> "b" (0),                  &n= bsp;/* set %ebx to zero */

ebx is used.  It shouldn't be in the= clobber list below.

> "d" (bank_number)      &nbs= p;   /* bank number in %edx */

edx is usd.  It shouldn't b= e in the clobber list below.

>      : "%eax", = ;                    = ;/* clobber list (we have no way of */
> "%ebx",      =               /* knowing which registers= the VESA */

I think you need to remove the ebx line.

> "%= ecx",                    = /* code is going to change, so we */
> "%edx",      &n= bsp;             /* have to assume the worst = and list */

I think you need to remove the edx line.

> "%esi",              =       /* them all here) */
> "%edi"
>  &nbs= p;    );
>    }
>

You may also = need to remove one more register from the list, perhaps eax, so
that GCC= can pick a register for the "r" input.  Try something like that.
<= BR>
Rod Pemberton



= =0A=0A=0A=0A=0A   --0-328552469-1296418691=:53118--