Board index » cppbuilder » Re: bcc32pch 2.75 - C++ Compiler Enhancements

Re: bcc32pch 2.75 - C++ Compiler Enhancements


2007-03-19 10:57:19 AM
cppbuilder73
Hi,
I try this version and find a problem when project files include in line
assembly. That is, if a project file that have "in line aseembly code" then
the obj can't be linked correctly.
Best Regards,
Eric
 
 

Re:Re: bcc32pch 2.75 - C++ Compiler Enhancements

DotNetTest wrote:
Quote
That is, if a project file that have "in line aseembly
code" then the obj can't be linked correctly.
Do you have any (simple) examples that I could try to compile?
--
Regards,
Andreas Hausladen
 

Re:Re: bcc32pch 2.75 - C++ Compiler Enhancements

Hi,
There is an asm code.
Best regards
Eric
bool ColorSpaceConverter::yuvToRGB888_oneLine(void *destBuf, void *srcBuf,
int pixelWidth)
{
BYTE *rgbBuf;
BYTE *yuvBuf;
rgbBuf = (BYTE *)destBuf;
yuvBuf = (BYTE *)srcBuf;
WORD yData, uData, vData;
int i;
BYTE rData, gData, bData;
int evenIsY, oddIsUV, uvOrder;
evenIsY = 1;
uvOrder = 0;
oddIsUV = 0;
yData = yuvBuf[1];
uData = yuvBuf[1];
vData = yuvBuf[3];
for(i=0; i<pixelWidth; i++)
{
if((i%2)==uvOrder)
{
yData = *(yuvBuf + (i*2+evenIsY));
uData = *(yuvBuf + (i*2+oddIsUV));
}
else
{
yData = *(yuvBuf + (i*2+evenIsY));
vData = *(yuvBuf + (i*2+oddIsUV));
}
asm
{
//Cr
mov ax, uData
sub ax, 128
mov bx, 351
imul bx
push dx
push ax //(cr-128)*351
sar dx, 1
rcr ax, 1
push dx //(cr-128)*178
push ax
//Cb
mov ax, vData
sub ax, 128
mov cx, ax
mov bx, 86
imul bx
push dx
push ax //(cb-128)*86
mov ax, cx
mov bx, 443
imul bx
push dx //(cb-128)*443
push ax
//********
xor dx, dx
mov ax, yData
xchg ah, al //y * 256
mov si, ax
pop bx
pop cx
add ax, bx
adc dx, cx
test dh, 80h
jz __notzero1
xor ah, ah
jmp __notover1
__notzero1:
cmp dx, 0
jz __notover1
mov ah, 0xff
__notover1:
mov bData, ah
//
xor dx, dx
mov ax, si
pop bx
pop cx
sub ax, bx
sbb dx, cx
pop bx
pop cx
sub ax, bx
sbb dx, cx
test dh, 80h
jz __notzero2
xor ah, ah
jmp __notover2
__notzero2:
cmp dx, 0
jz __notover2
mov ah, 0xff
__notover2:
mov gData, ah
//
xor dx, dx
mov ax, si
pop bx
pop cx
add ax, bx
adc dx, cx
test dh, 80h
jz __notzero3
xor ah, ah
jmp __notover3
__notzero3:
cmp dx, 0
jz __notover3
mov ah, 0xff
__notover3:
mov rData, ah
}
rgbBuf[i*3] = (unsigned char)rData; //&bMask;//rData;
rgbBuf[i*3+1] = (unsigned char)gData; //&gMask;//gData;
rgbBuf[i*3+2] = (unsigned char)bData; //&rMask;//bData;
}
return true;
}
"Andreas Hausladen" < XXXX@XXXXX.COM >glsD:45fe742a$ XXXX@XXXXX.COM ...
Quote
DotNetTest wrote:

>That is, if a project file that have "in line aseembly
>code" then the obj can't be linked correctly.

Do you have any (simple) examples that I could try to compile?


--
Regards,

Andreas Hausladen
 

{smallsort}

Re:Re: bcc32pch 2.75 - C++ Compiler Enhancements

Thanks, I'll have a look at this.
--
Regards,
Andreas Hausladen
 

Re:Re: bcc32pch 2.75 - C++ Compiler Enhancements

DotNetTest wrote:
Quote
I try this version and find a problem when project files include in
line assembly. That is, if a project file that have "in line aseembly
code" then the obj can't be linked correctly.
What C++Builder do you use? I tried your code with BDS 2006 and BCB 6
and both compiled and linked the code without any problem.
--
Regards,
Andreas Hausladen
 

Re:Re: bcc32pch 2.75 - C++ Compiler Enhancements

Hi
I use BCB6. I put the asm code in another cpp file and call the asm code
from main form. Do you call the asm code in you project?
Regards,
Eric Yang
"Andreas Hausladen" < XXXX@XXXXX.COM >
???????:46031a7e$ XXXX@XXXXX.COM ...
Quote
DotNetTest wrote:

>I try this version and find a problem when project files include in
>line assembly. That is, if a project file that have "in line aseembly
>code" then the obj can't be linked correctly.

What C++Builder do you use? I tried your code with BDS 2006 and BCB 6
and both compiled and linked the code without any problem.

--
Regards,

Andreas Hausladen
 

Re:Re: bcc32pch 2.75 - C++ Compiler Enhancements

DotNetTest wrote:
Quote
Do you call the asm code in you project?
Yes, I do.
I have uploaded my test project to
andy.jgknet.de/misc/inlineasmTest.zip
--
Regards,
Andreas Hausladen
 

Re:Re: bcc32pch 2.75 - C++ Compiler Enhancements

I'm getting an Application Error, memory could not be "written" on exit from
my program when I use this version. I've noticed that the file is slightly
smaller
size 4,525,056 size on disk 4,526,080 for version 2.75
size 4,529,664 size on disk 4,530,176 for version 2.7 no error
size 4,528,128 size on disk 4,530,176 for no bcc32pch installed
I've tried 2.75 for several apps and get the same basic results. Slightly
small exe's and an Application Error on exit.