Author |
Message |
Topic: should a right-shift on a signed int16 do sign extension? |
truevenik
Replies: 3
Views: 10664
|
Forum: General CCS C Discussion Posted: Wed Jun 16, 2004 12:14 pm Subject: should a right-shift on a signed int16 do sign extension? |
Hi the following code doesn't do sign extension. Am I missing something or is the compiler missing something?
signed int16 result = -25152;
result >>= 4;
When I replace result >>= ... |
Topic: questions for those who have experience with #org |
truevenik
Replies: 3
Views: 10534
|
Forum: General CCS C Discussion Posted: Fri Apr 09, 2004 5:12 pm Subject: copies of a fucntion |
Hi, lets say I have a function g(int x). Is there a way to make two copies of it and put one in ROM page1, and another in page2 ?
Also, does anyone know of a way to use #org on a function, keep the ... |
Topic: questions for those who have experience with #org |
truevenik
Replies: 3
Views: 10534
|
Forum: General CCS C Discussion Posted: Fri Apr 09, 2004 10:25 am Subject: questions for those who have experience with #org |
Hi. I'm using PCM v3.163 and PIC16F877. I need to reduce code size and I've noticed that about 1/10 of the assembly code deals with the A.3 and A.4 bits. I haven't yet looked at how good the compiler ... |
Topic: #define and #byte |
truevenik
Replies: 2
Views: 10057
|
Forum: General CCS C Discussion Posted: Wed Mar 24, 2004 10:43 am Subject: partial answer |
hi,
#define PORTA 0x05
PORTA = 0
is equivalent to just writing
0x05 = 0 (try to assign 0 to a litteral value = error -this is like writing 3=1)
#byte PORTA = 0x05
PORTA = 0
I think is eq ... |
Topic: square roots to the nearest integer, without floating point |
truevenik
Replies: 3
Views: 10093
|
Forum: General CCS C Discussion Posted: Tue Mar 23, 2004 11:57 pm Subject: square roots to the nearest integer, without floating point |
In case somebody else needs this, here's a routine that computes to the nearest integer the square-root of any unsigned 32-bit integer (eg. isqrt(10) = 3, isqrt(16) = 4 ). I needed this because I didn ... |
|