still can't fix my printf problem ... I linked the program without the option to overlay variables and it still didn't work ... does this eliminate the overlay feature as a problem? my putchar is exactly like the example on how to do serial communications with interrupts ... my serial com is interrupt driven I have a 22K program in a 64K code space ... a few K of the 32K xdata ram are used ... I use the favor small code option and have the large memory and xdata options selected when the printf does not work, it looks like it is printing a series of zeros rather than the string constants .... I kept removing code until I could make it work or fail ... with adding/removing one line of code this is the info from the working version: 370 1 str[0] = 'H'; 371 1 str[1] = 'V'; 372 1 str[2] = '3'; 373 1 str[3] = '0'; 374 1 str[4] = 'X'; 375 1 str[5] = 0; 376 1 printf(str); 377 // 378 1 printf ("AAAA...AAAAAAAA"); working assembly code
; SOURCE LINE # 376 005A 7B01 MOV R3,#01H 005C 7A02 MOV R2,#HIGH str 005E 799B MOV R1,#LOW str 0060 120FF3 LCALL _printf ; SOURCE LINE # 378 0063 7BFF MOV R3,#0FFH 0065 7A1F MOV R2,#HIGH ?SC_0 0067 797E MOV R1,#LOW ?SC_0 0069 120FF3 LCALL _printf
; SOURCE LINE # 376 005A 7B01 MOV R3,#01H 005C 7A02 MOV R2,#HIGH str 005E 799B MOV R1,#LOW str 0060 120FF3 LCALL _printf ; SOURCE LINE # 378 0063 7BFF MOV R3,#0FFH 0065 7A20 MOV R2,#HIGH ?SC_0 0067 7902 MOV R1,#LOW ?SC_0 0069 120FF3 LCALL _printf