Hi,
I've been trying to convert allegro.h into a Pascal unit.
Has anyone already done this?
One of the problems I'm having is translating the asm statements from C to PASCAL. I keep getting the compiler error:
allegro.pas(1204) Error: cannot reload integer constant operand in `asm'.
I have absolutely no idea what this means.
The offending code is as follows:
asm ('call *%3' : '=a' (result) { result in eax } : 'd' (bmp), { bitmap in edx } '0' (line), { line number in eax } 'r' (bmp^.write_bank) { the bank switch routine } );
All I've done is changed all double quotes to single quotes and changed -> to ^.
Could you please cc any replies to me as I am not subscribed to this mailing list despite several requests.
thanks russell
Hi, Russell! Hi, all!
I've been trying to convert allegro.h into a Pascal unit.
(-8 Great!
Has anyone already done this?
No.
I keep getting the compiler error:
allegro.pas(1204) Error: cannot reload integer constant operand in `asm'.
I cannot reproduce this error with the code fragment. Could you please mail me some more complete source?
All I've done is changed all double quotes to single quotes and changed -> to ^.
Yes, that's the correct way to do that.
Could you please cc any replies to me as I am not subscribed to this mailing list despite several requests.
Oha! Then you are not aware of the Beta announcement. I will forward you a copy in separate mail.
Greetings,
Peter
On Tue, 1 Sep 1998, Thamm, Russell wrote:
The offending code is as follows:
asm ('call *%3' : '=a' (result) { result in eax } : 'd' (bmp), { bitmap in edx } '0' (line), { line number in eax } 'r' (bmp^.write_bank) { the bank switch routine } );
I think the problem is one of two things, one is the double-quotes (I've done many ASM routines with doubles, I haven't tried it with single quotes since double quotes are more portable to GCC). The other one could be the register usage, instead of specifying which register the inline assembler should use via "d", "=a", instead use "g" or "=g" while including the variable name and then manually load the register with the value using the form "movl %0, %%eax" for example.
See ya! Orlando Llanes
"Meine Damen und Herren, Elvis hat soeben das Gebaeude verlassen!"
"Look out fo' flyeeng feet" O__/ a010111t@bc.seflin.org /|____. O <__. /> / \ ____________|_________ http://ourworld.compuserve.com/homepages/Monkey414