Hi, my program does not do the expected things, printf a unsigned long long int.
#include <aduc7026.h> #include"stdio.h" void RS232_init(void); int main (void) { unsigned long long int A; RS232_init(); printf("Start \n"); while(1) { while(1) { printf("Enter a Hex-number\n"); if (scanf("%X",&A)) break; scanf("%*"); //Clearing scanf input stream } printf ("Your input %64.64lX\n",A); A *= A; printf ("The result %64.64lX\n",A); } } void RS232_init(void) { GP1CON = 0x011; // Setup tx & rx pins on P1.0 and P1.1 // Start setting up UART at 9600bps COMCON0 = 0x080; // Setting DLAB COMDIV0 = 0x088; // Setting DIV0 and DIV1 to DL calculated COMDIV1 = 0x000; COMCON0 = 0x007; // Clearing DLAB }
"It only remains to check the GCC manual to see wether or not GCC supports it." Once you can actually find the manual! :-( http://www.keil.com/forum/docs/thread7639.asp Here it is: http://www.gnu.org/software/libc/manual/html_node/Integer-Conversions.html#Integer-Conversions It says that you can us 'L' (uppercase), 'll' (lowercase), or 'q' to qualify a long long int. Note that a single lowercase 'l' still indicates a long int