Jump to content
Sign in to follow this  
Alexandre C Nunes

Working With 32 Bits

Recommended Posts

C2C does not support 32-bit variables. I solved this by using two 16-bit variables and

check for rollover during addition or substraction. Maybe somebody has a better solution?

Share this post


Link to post
Share on other sites
C2C does not support 32-bit variables. I solved this by using two 16-bit variables and

check for rollover during addition or substraction. Maybe somebody has a better solution?

 

 

But I did not understand, therefore in the message "Next generatios C Compiler"9ht october 2004 for Pavel he informs the following :

 

Optimizing Compiler and Linker features

Base Data types:

8 bit char - signed and unsigned.

16 bit int - signed and unsigned.

32 bit long - signed and unsigned (won't be available in alpha).

 

It will be that I can make operation of addition and subtraction of 32bit long?

I'm using the versionSourceBoost IDE 5.8 & BoostC 1.9

Share this post


Link to post
Share on other sites

Alexandre,

 

But I did not understand, therefore in the message "Next generatios C Compiler"9ht october 2004 for Pavel he informs the following :

 

Optimizing Compiler and Linker features

Base Data types:

8 bit char - signed and unsigned.

16 bit int - signed and unsigned.

32 bit long - signed and unsigned (won't be available in alpha).

 

Thats the plan, but 32bit maths has yet to be implemented.

 

Regards

Dave

Share this post


Link to post
Share on other sites
Alexandre,

 

But I did not understand, therefore in the message "Next generatios C Compiler"9ht october 2004 for Pavel he informs the following :

 

Optimizing Compiler and Linker features

Base Data types:

8 bit char - signed and unsigned.

16 bit int - signed and unsigned.

32 bit long - signed and unsigned (won't be available in alpha).

 

Thats the plan, but 32bit maths has yet to be implemented.

 

Regards

Dave

 

I am facing a problem while performing multiplication, follwing code doesnt work.

 

unsigned short mul(unsigned char multiplier,unsigned char multiplicand)

{

unsigned short TempResult;

TempResult = multiplier * multiplicand;

return TempResult;

}

 

I have called it with :

unsigned short rslt;

rslt = mul(0x56,0xff);

 

I see the problem when running in the debugger and get the following message in the debugger window.

 

Debugging...

 

Can't locate source line for the current instruction

 

 

 

Can somebody help. Secondly I need to multiply 'unsigned short' with a 'unsigned char' to get an 3 byte result, for which I wrote an algorithm but it didnt work. Since the above code was part of it , and has to be resolved prior. Has anyone generated such code.

Pl Help.

Share this post


Link to post
Share on other sites

pbraju123,

 

I see the problem when running in the debugger and get the following message in the debugger window.

 

Debugging...

 

Can't locate source line for the current instruction

 

This message is created when the debugger doesn't know which source line is associated with a give value of the program counter (PC) register. Nothing is missing from the code, but from the debug information.

 

Currently there are some circumstances when this can happen, these should all be fixed in the next release - mainly todo with global variable initialisation code.

 

The work around is set a break in the function and run the code to that point, or try just keep stepping the code, it shouldn't take too long before you see source code high lighted in the source window.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...