Dead Hackers Society
Other BBSes »
 
 
Demoscene  Coding  CT60  Buy/sell

Atari coding BBS
 
VBCC strange 16bits/32bits val
Posted by: Orion_ Mar,01.2010-16:42 

I'm trying to setup VBCC as a dev environment for compiling my programs both from my PC or my Falcon under

TOS.
It was working nice until I got strange behaviors.
For example with this little piece of code:
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240

void SomeFunction(void)
{
unsigned long i;

for (i = 0; i < SCREEN_WIDTH * SCREEN_HEIGHT; i++)
{
// do stuff...
}
}

When looking at the assembly code generated by the compiler, it was doing something like that:
cmp.l #11264,d0

where it should be:
cmp.l #76800,d0

So I guess the value computed by the preprocessor was "cropped" to 16bits

I was using the m68ks version of the compiler, so I tried the m68k version and then it was computing the good

value (76800).
But ! All the call to libc (lvc) I made didn't worked anymore.
for example printf of a number always printed "0".
I tried both libvc and libvcs.

I also tried using osbind instead of libvc, but when using the m68k version of the compiler, all the values

pushed on stack were .l !
I had to rewrite all the gemdos/xbios call in assembly to get it right. :/

I'm missing something in the configuration file or in the use of VBCC ?
Did someone had the same behavior using VBCC ?








[All messages in this thread]    [Start new thread]

Topic Posted by  Date 
VBCC strange 16bits/32bits val Orion_ Mar,01.2010-16:42
  Re: VBCC strange 16bits/32bits val mikro Mar,01.2010-19:43
    Re: VBCC strange 16bits/32bits val Orion_ Mar,01.2010-21:12
      Re: VBCC strange 16bits/32bits val mikro Mar,02.2010-00:32
        Re: VBCC strange 16bits/32bits val Orion_ Mar,02.2010-09:56
          Re: VBCC strange 16bits/32bits val mikro Mar,02.2010-10:41
            Re: VBCC strange 16bits/32bits val Orion_ Mar,02.2010-14:57


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson